we have that
A(-2,-4) B(8,1)
let
M-------> the coordinate that divides the directed line segment from A to B in the ratio of 2 to 3
we know that
A--------------M----------------------B
2 3
distance AM is equal to (2/5) AB
distance MB is equal to (3/5) AB
so
step 1
find the x coordinate of point M
Mx=Ax+(2/5)*dABx
where
Mx is the x coordinate of point M
Ax is the x coordinate of point A
dABx is the distance AB in the x coordinate
Ax=-2
dABx=(8+2)=10
Mx=-2+(2/5)*10-----> Mx=2
step 2
find the y coordinate of point M
My=Ay+(2/5)*dABy
where
My is the y coordinate of point M
Ay is the y coordinate of point A
dABy is the distance AB in the y coordinate
Ay=-4
dABy=(1+4)=5
Mx=-4+(2/5)*5-----> My=-2
the coordinates of point M is (2,-2)
see the attached figure