Using the section formula, if a point (x,y) divides the line joining the points (x1,y1) and (x2,y2) in the ratio m:n, then
(x,y)=(mx2+nx1m+n,my2+ny1m+n)
We know if a point is on x-axis, then y coordinate is zero.