Let the point on the x-axis be (x,0)
⇒Distance Formula =√(x2−x1)2+(y2−y1)2
Here (x,0)≡(x1,y1) and (5,4)≡(x2,y2)
Distance between (x,0) and (5,4)=√(5−x)2+(4−0)2=√52+x2−10x+16=√x2−10x+41
Here (x,0)≡(x1,y1) and (−2,3)≡(x2,y2)
Distance between (x,0) and (−2,3)=√(−2−x)2+(3−0)2=√22+x2+4x+9=√x2+4x+13
As the point (x,0) is equidistant from the two points, both the distances calculated are equal.
√x2−10x+41=√x2+4x+13
⇒x2−10x+41=x2+4x+13
41−13=10x+4x
x=2
Thus, the point is (2,0) ⇒p=2 and q=0 ⇒p+q=2