Simplifying an Arctan equation

Simplify $f(x)=Arctan(x)+Arctan(\frac{1}{x})$.

My attempt

For all non null real numbers $f$ is derivable and is odd:

so for all non null real number x : $f'(x)=\frac{1}{1+x^{2}}-\frac{1}{1+x^{2}}=0$ . So $f$ is constant on $\mathbb{R^{\star}}$ so $f(x)=f(1)=2Arctan(1)=\frac{\pi}{2}$ and since $f$ is odd then $f(-x)=-f(x)=-\frac{\pi}{2}$ so this is my conclusion:

$f(x)=\frac{\pi}{2}$ if x>0 and $f(x)=-\frac{\pi}{2}$ if x<0. Can someone please check my work. Thank you very much .

• math.stackexchange.com/questions/138310/… Dec 17 '13 at 11:07
• Yours @Module seems not only a correct solution but also a rather nice, elegant one. +1 Dec 17 '13 at 13:10
• @DonAntonio Thank you very much ! Dec 17 '13 at 22:15

The derivation is perfect. Let me corroborate

Using the definition of the principal values

$\displaystyle\arctan \frac1x=\begin{cases} \text{arccot}x &\mbox{if } x>0 \\ \text{arccot}x-\pi & \mbox{if } x<0 \end{cases}$

and we know $\displaystyle\arctan(y)+\text{arccot}(y) =\frac\pi2$ for all real $y$ (Proof)

Try \begin{align}\tan^{-1}x+\tan^{-1}\frac1x&=\tan^{-1}\left(\tan\left(\tan^{-1}x+\tan^{-1}\frac1x\right)\right)\\ &=\tan^{-1}\left(\frac{x+\frac1x}{1-x\cdot\frac1x}\right)\\ &=\tan^{-1}(\text{sgn}(x)\infty)=\frac\pi2\text{sgn}(x)\end{align}

Where $\text{sgn}(x)=\left\{\begin{array}{l}1\text{ if }x>0\\0\text{ if }x=0\\-1\text{ if }x<0\end{array}\right.$ (Note that the sum is actually undefined at $0$, but I'm saying it's $0$ for convenience.)

Alternatively, consider the geometric definition of arctangent: Given a right-angled triangle with sides $a,b,c$ (where $c$ is a hypotenuse) and angles $A,B,C$ ($C=\frac\pi2$), $\tan^{-1}\frac ba=A$. If we let $x=\frac ba$, then $\tan^{-1}x+\tan^{-1}\frac1x=A+B=\frac\pi2$

Your way works, too. It's pretty clever actually.

What does $\arctan x=\arctan\frac x1$ mean ? It means that you have a straight-edge triangle with one ‘leg’ of length x and the other ‘leg’ of length $1$, and your ‘arc’ or angle is the one opposite to the ‘leg’ of length x, whose tangent is obviously $\frac x1=x$. And what does $\arctan\frac1x$ mean ? It means that you have a straight-edge triangle with one ‘leg’ of length x and the other ‘leg’ of length $1$, and your ‘arc’ or angle is the one opposite to the ‘leg’ of length $1$, whose tangent is obviously $\frac1x$. In other words, your sum is the sum of the two non-straight angles of a straight-edge triangle: which is how much, exactly ? :-)