Suppose the line y−x+2=0 divides the line segment joining A(3,−1) and B(8,9) in the ratio λ: 1at point P, then the coordinates of the point P are (λ+18λ+3,λ+19λ−1).
But P lies on y−x+2=0, therefore (λ+19λ−1)−(λ+18λ+3)+2=0 ⇒9λ−1−8λ−3+2λ+2=0 ⇒3λ−2=0
or λ=32
So, the required ratio is 32:1, i.e., 2:3 (internally), since here λ is positive.