# What is the value of $\arctan \left(\frac xy\right) +\arctan \left(\frac yx\right)?$

I was playing about with some numbers when I came up with this fun question.

What is the value of $$\arctan \left(\frac xy\right) +\arctan \left(\frac yx\right)?$$

Here is my method: As is clearly evident from the triangle:
$$a = \arctan \left(\frac yx\right)$$ and
$$b = \arctan \left(\frac xy\right)$$
$$\therefore \arctan \left(\frac xy\right) +\arctan \left(\frac yx\right) = a + b = 90^{\circ} = \frac {\pi}2 ^c$$

Was my method right? Or can it be improved? I would appreciate any help in the comments or through answers. Thanks in advance!

• I assure you that both $x$ and $y$ are larger than $0$ else that triangle would have never appeared. – Mohammad Zuhair Khan Jan 5 '18 at 14:51
• Ok then your answer is correct according to me! You wrote the expression, triangle was brought by you afterwards – samjoe Jan 5 '18 at 14:52
• @samjoe this is the first time I used $\arctan$ so I wanted to ask if it is identical to the $\tan^{-1}$ we all learnt before high school. – Mohammad Zuhair Khan Jan 5 '18 at 14:54
• Thanks for the explanation! – Mohammad Zuhair Khan Jan 5 '18 at 14:54
• Using \circ for degree symbol looks better in my opinion e.g compare $90^\circ$ and $90^0$ – kingW3 Jan 5 '18 at 15:43

## 4 Answers

Yes it's a correct method.

As an alternative note that for $x>0$

$$\arctan x + \arctan \frac1x = \frac{\pi}2$$

indeed if you set

$$y=\arctan \frac1x$$

then

$$\tan y=\frac1x$$

that is

$$x=\cot y=\tan\left(\frac{\pi}{2}-y\right)$$

therefore

$$\arctan x=\arctan\tan\left(\frac{\pi}{2}-y\right)=\frac{\pi}{2}-y=\frac{\pi}{2}-\arctan \frac1x$$

• Should I close this question? As this is technically a duplicate as labbhattacharjee's link shows. – Mohammad Zuhair Khan Jan 5 '18 at 15:12
• @MohammadZuhairKhan Probably some moderator will set it as a duplicate with a link at the previous. – gimusi Jan 5 '18 at 15:14
• Gimusi. Very nice. – Peter Szilas Jan 5 '18 at 15:27

Using complex numbers:

Let $z = x + y \, i$ and $w = y + x \, i$. Then

$$\arctan (\frac xy) +\arctan (\frac yx) = \arg w + \arg z = \arg wz = \arg i (x^2 + y^2) = \frac{\pi}{2}$$

• I intended to use $\frac {\pi}2$ but for a triangle isn't $90^0$ a more common convention? – Mohammad Zuhair Khan Jan 5 '18 at 15:26
• Why $\arg w + \arg z = \arg wz$? – Did Jan 8 '18 at 18:21

$\newcommand{\bbx}{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}{\displaystyle{#1}} \newcommand{\expo}{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}{\mathcal{#1}} \newcommand{\mrm}{\mathrm{#1}} \newcommand{\pars}{\left(\,{#1}\,\right)} \newcommand{\partiald}[]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}{\left\vert\,{#1}\,\right\vert}$ \begin{align} \arctan\pars{x \over y}\ +\ \overbrace{\quad\qquad\arctan\pars{y \over x}\quad\qquad} ^{\ds{{\pi \over 2}\,\mrm{sgn}\pars{x \over y} - \arctan\pars{x \over y}}} & = \bbx{{\pi \over 2}\,\mrm{sgn}\pars{x \over y}} \end{align}

• Could you explain what does $sgn$ mean? – Mohammad Zuhair Khan Jan 5 '18 at 15:41
• I guess it means sign ... – Isham Jan 5 '18 at 15:49
• @MohammadZuhairKhan $\mathrm{sgn}$ is the $\texttt{sign}$ function. $\mathrm{sgn}:\mathbb{R} \to \mathbb{Z}$. $$\mathrm{sgn}\left(x\right) \equiv \left\{\begin{array}{rcrcl} -1} & \mbox{if} & x} & <} & 0} \\ 0} & \mbox{if} & x} & =} & 0} \\ 1} & \mbox{if} & x} & >} & 0} \end{array}\right.$$ – Felix Marin Jan 5 '18 at 17:23
• @FelixMarin thanks for explaining. I had never seen this function before so my apologies. – Mohammad Zuhair Khan Jan 5 '18 at 17:25
• @MohammadZuhairKhan Thanks. You're welcome. Also, it's related to the $\texttt{Heaviside Step Function}$ $\mathrm{H}$: $\mathrm{sgn}\left(x\right) = 2\,\mathrm{H}\left(x\right) - 1$ when $x \not= 0$.. – Felix Marin Jan 5 '18 at 17:28

Funny I played with it too

$$E=\arctan \left(\frac xy\right) +\arctan \left(\frac yx\right)=x_1+x_2$$

$$\tan(E)=\frac {\tan(x_1)+\tan(x_2)}{1-\tan(x_1)\tan(x_2)}$$

$$\tan(E)=\pm\infty$$

$$\vdots$$

• $E = \arctan \infty =$(b.a.a.) $\frac {\pi}2$ – Mohammad Zuhair Khan Jan 5 '18 at 15:59
• yep @MohammadZuhairKhan +or - $\frac {\pi} 2$...I didnt understand why I got a zero at the denominator but it makes sense. – Isham Jan 5 '18 at 16:01
• $\tan$ is periodic. I prefer $\pi \ge x \ge 0$ whenever possible. – Mohammad Zuhair Khan Jan 5 '18 at 17:20