Given that \(A = \arctan \frac12\) and that \(B = \arctan\frac13\,\) (where \(A\) and \(B\) are acute) show, by considering \(\tan \left( A + B \right)\), that \(A + B = {\frac{1}{4}\pi }\).
The non-zero integers \(p\) and \(q\) satisfy
\[
\displaystyle \arctan {\frac1 p} + \arctan {\frac1 q}
= {\frac\pi 4}\,.
\]
Show that \( \left ( p-1 \right) \left(q-1 \right) = 2\) and hence determine \(p\) and \(q\).
Let \(r\), \(s\) and \(t\) be positive integers such that the highest common factor of \(s\) and \(t\) is \(1\). Show that, if
\[
\arctan {\frac1 r} + \arctan \frac s {s+t} = {\frac\pi 4}\,,
\]
then there are only two possible values for \(t\), and give \(r\) in terms of \(s\) in each case.
Solution:
\begin{align*}
&& \tan (A+B) &= \frac{\tan A + \tan B}{1-\tan A \tan B}\\
&&&= \frac{\tan \arctan \frac12 + \tan \arctan \frac13}{1-\tan \arctan \frac12 \tan \arctan \frac13}\\
&&&= \frac{\frac12+\frac13}{1-\frac16} \\
&&&= \frac{3+2}{5} \\
&&&= 1 \\
\Rightarrow && A+B &= \frac{\pi}{4} + n \pi
\end{align*}
but since \(A,B\) are acute \(0 < A+B < \pi\), so \(A+B = \frac{\pi}{4}\)
\begin{align*}
&& 1 &= \tan \frac{\pi}{4} \\
&&&= \tan \left ( \arctan {\frac1 p} + \arctan {\frac1 q}\right) \\
&&&= \frac{\frac1p + \frac1q}{1-\frac1{pq}} \\
&&&= \frac{q+p}{pq-1} \\
\Rightarrow && pq-1 &= q+p \\
\Rightarrow && 0 &= pq-q-p-q \\
&&&= (p-1)(q-1)-2 \\
\Rightarrow && 2 &= (p-1)(q-1)
\end{align*}
But \(p\),\(q\) are integers, so \(p-1 \in \{-2,-1,1,1\} \Rightarrow p \in \{-1,0,2,3\}\) but we cannot have \(p= 0\), so we must have
\((p,q) = (2,3), (3,2)\)
\begin{align*}
&& 1 &= \tan \frac{\pi}{4} \\
&&&= \tan \left ( \arctan {\frac1 r} + \arctan \frac s {s+t} \right) \\
&&&= \frac{\frac1r + \frac{s}{s+t}}{1-\frac{s}{r(s+t)}} \\
&&&= \frac{s+t+sr}{r(s+t)-s} \\
\Rightarrow && rs+rt-s &= s+t + sr \\
\Rightarrow && 0 &= rt-2s-t \\
&&2s&= t(r-1)
\end{align*}
Since \((s,t) =1\), we must have \(t \mid 2\), so \( t = 1,2\) and \(r = 2s+1\) or \(r=s+1\) respectively.