2. Let $O=(0,0), Q=(13,4), A=(a, a), B=(b, 0)$, where $a$ and $b$ are positive real numbers with $b \geq a$. The point $Q$ is on the line segment $A B$.
(a) Determine the values of $a$ and $b$ for which $Q$ is the midpoint of $A B$.
(b) Determine all values of $a$ and $b$ for which $Q$ is on the line segment $A B$ and the triangle $O A B$ is isosceles and right-angled.
(c) There are infinitely many line segments $A B$ that contain the point $Q$. For how many of these line segments are $a$ and $b$ both integers?
Solution:
(a) For $Q$ to be the midpoint of $A B$ we have $(a+b) / 2=13$ and $(a+0) / 2=4$. The second equation means that $a=8$, which we can substitute into the first equation to get $b=18$.
(b) When $O A B$ is isosceles, there are 3 possibilities: $O A=O B, O A=A B, O B=A B$.
When $O B=A B$ we have a right angled triangle with a right angle at $b$, which would mean $a=b$. For the point $Q$ to be on this line, we must have $a=b=13$.
When $O A=A B$, we have a right angled triangle at $A$. By symmetry we have $b=2 a$. So we need the point $(13,4)$ to be on the line through $(a, a)$ and $(2 a, 0)$. This is the line $x+y=2 a$ and since $(13,4)$ is on the line, we have $a=8.5, b=17$.
When $O A=O B$ the triangle is not right-angled.
(c) The slope of the line segment $A Q$ is $\frac{4-a}{13-a}$ and the slope of the line segment $Q B$ is $\frac{0-4}{b-13}$. These two line segments have the same slope, so we have that:
$$
\begin{aligned}
\frac{-4}{b-13} & =\frac{4-a}{13-a} \\
52-4 a & =a b-4 b-13 a+52 \\
0 & =a b-9 a-4 b \\
36 & =(a-4)(b-9)
\end{aligned}
$$

For $a$ and $b$ to be positive integers, each of $a-4$ and $b-9$ must be positive divisors of 36. There are 9 possibilities:
\begin{tabular}{cccc}
$\mathrm{a}-4$ & $\mathrm{~b}-9$ & $\mathrm{a}$ & $\mathrm{b}$ \\
1 & 36 & 5 & 45 \\
2 & 18 & 6 & 27 \\
3 & 12 & 7 & 21 \\
4 & 9 & 8 & 18 \\
6 & 6 & 10 & 15 \\
9 & 4 & 13 & 13 \\
12 & 3 & 16 & 12 \\
18 & 2 & 22 & 11 \\
36 & 1 & 40 & 10
\end{tabular}

Since $b \geq a$ this excludes the last 3 cases, so there are 6 such line segments $A B$.