Finding a point on the X axis that creates a right angle. I have this problem: 
Let A be the point $(5, 9)$ and $B$ be the point $(20, 4)$. Find all points $P$ on the $x$-axis so that $\angle APB$ is a right angle.
How would you do this? I've thought about trying circles, but I am not experienced enough with them for anything useful to come out of it for me. 
Thanks. 
 A: Basic approach.  Angle $\angle APB$ is a right angle if $P$ lies on the circle that has $\overline{AB}$ as a diameter.  So:


*

*What point is the center $O$ of the circle?  It is the midpoint of the segment $\overline{AB}$.

*What is the radius of this circle?  It is the distance $AO = BO$.

*What is the equation of this circle?  A circle with center $(x_0, y_0)$ and radius $r$ has equation $(x-x_0)^2+(y-y_0)^2 = r^2$.

*Where does this circle intersect the $x$-axis?  It is the $x$-value or values you obtain when you set $y = 0$ in the equation of the circle.


ETA: Here's a diagram of this.  But you should go through the work to find the points analytically.

A: $\angle APB$ is a right angle if and only if the slope of the line from $A$ to $P$ is the opposite reciprocal of the slope of the line from $P$ to $B$. If $P$ is on the $x$-axis, we can write $P=(x,0)$ for some $x$. Then the slope of the line from $A$ to $P$ is $\frac{0-9}{x-5}$ and the slope of the line from $P$ to $B$ is $\frac{4-0}{20-x}$. Thus we require $-\frac{9}{x-5}=-\frac{20-x}{4}$. What does this tell you about $x$?
A: the slope of $PA$ is given by $$m_1=\frac{4-0}{20-x}$$ and from $$PA$$ $$m_2=\frac{9-0}{5-x}$$ since we have a right angle it must be
$$m_2=-\frac{1}{m_1}$$ this gives $$\frac{4}{x-20}=-\frac{5-x}{9}$$ can you solve this?
A: Thales Circle:
$c:=$ length $AB.$
$c^2:= (20-5)^2 +(4-9)^2 =$
$ 15^2 +5^2$. 
$r = c/2 = (1/2)\sqrt{250}$.
Midpoint $M$ of $AB$: 
$M(25/2,13/2).$
Point $x$ on axis has distance $r$ to $M$:
$(25/2-x)^2 + (13/2)^2 = 250/4.$
$(25/2-x)^2 = 250/4 -169/4 =$
$ 81/4.$
$x= 25/2$  $^+_-$ $9/2.$
$x_1= 8$,  $x_2 = 17.$
