Let’s consider the point P($2$, y) divide the line segment joining the points A$(-2,2)$ and B$(3,7)$ in the ratio k: 1
Now, the coordinates of P are given by
$\left[ \frac{3k+(-2)\times 1}{k+1},\frac{7k+2\times 1}{k+1} \right]$
$=\left[ \frac{3k-2}{k+1},\frac{7k+2}{k+1} \right]$
And, given the coordinates of P are ($2$, y)
So,
$2=(3k–2)/(k+1)$ and y$=(7k+2)/(k+1)$
Now Solving for k we get,
$2(k+1)=(3k–2)$
$2k+2=3k–2$
$k=4$
By Using k to find y, we have
y $=(7(4)+2)/(4+1)$
$=(28+2)/5$
$=30/5$
y $=6$
Therefore, the ratio id $4:1$ and y $= 6$