It can certainly be done by looking at the distance between points, however, the first distance is not necessarily 3 (you could call it 3z for instance, and the other one would be z)
^2+\left(y-6\right)^2}=3\sqrt{\left(x-6\right)^2+\left(y+7\right)^2})
You'd also need to use the fact that the point P is on the line segment AB (i.e. find the equation of the line and substitute it in).
This, however, could be an algebraic nightmare.
A much simpler solution would be to consider the problem geometrically (there is a formula that we could generate for the coordinates of a point split in an arbitrary ratio internally on a line segment, but isn't required for methods).
The ratio AP:PB=3:1 suggests that the line segment is split into 4 equal length segments (and P is closer to B than to A).
If we let M be the midpoint of the line segment AB, then P is simply the midpoint of MB.