If P(xp,yp) divides a line segment from A(x1,y1) to B(x2,y2) in the ratio a:b, then:
xp = x1 + (a/(a+b))* (x2 - x1)
yp = y1 + (a/(a+b))* (y2 - y1)
In this case:
a = 5
b = 2
x1 = -3
y1 = 1
x2 = 4
y2 = 8
Replacing the data into the equations:
xp = -3 + (5/7) * (4- (-3)) = -3 + (5/7)*(7) = -3 + 5 = 2
yp = 1 + (5/7) *( 8 - 1) = 1 + (5/7)*(7) = 1 + 5 = 6
Therefore, the coordinates of the point P are:
(xp,yp) = (2,6)