# Find the value of $\int_{-\pi}^{\pi}\left(4\arctan\left(e^{x}\right)-\pi\right)dx$

I need to find the value of $$\int_{-\pi}^{\pi}\left(4\arctan\left(e^{x}\right)-\pi\right)\mathrm dx$$ I've tried to show this is an odd function in order to show the answer is $$0$$, but I wasn't able to do that.

How can I prove this is an odd function?

• $\arctan u+\arctan\dfrac1u=\dfrac π2$, so…
– Ѕааԁ
May 27, 2021 at 8:04
• @Saad Thanks! that should do it. but is that a basic identity? because its pretty much the first time I see it May 27, 2021 at 8:58
• @JoeBenz Yes, it is. It's quite intuitive with a right triangle drawn.
– Ѕааԁ
May 27, 2021 at 9:05
• N.b. The integrand is $2 \operatorname{gd}(x)$, where $\operatorname{gd}$ is the Gudermannian function (which is odd): en.wikipedia.org/wiki/Gudermannian_function. May 27, 2021 at 9:18
• Directly from @TravisWillse comment let $x=tu$ so $\int_{-\pi}^\pi\int_0^x\frac1{\cosh t}\,dt\,dxx=\int_0^1\int_{-\pi}^\pi\frac x{\cosh ux}\,du\,dx=\int_0^10\,dx$ since $\cosh$ is even. May 27, 2021 at 9:24

## 3 Answers

Let $$f(x)=4\arctan\left(e^{x}\right)-\pi$$. Then since $$\arctan u + \arctan 1/u = \frac{\pi}{2} \ (*)$$:

$$-f(-x) = -4 \arctan e^{-x} + \pi = -4\left(\frac{\pi}{2}-\arctan e^x\right) + \pi =4 \arctan e^x-\pi = f(x).$$

$$(*)$$ can be proved geometrically: $$\arctan u$$ is the angle with opposite side $$u$$ and adjacent side $$1$$, and $$\arctan 1/u$$ is the other acute angle in the right triangle. Their sum must thus be $$\frac{\pi}{2}$$. Alternatively, differentiate the left-hand side and show it is constant, then choose a convenient value for $$u$$ since any $$u$$ works, say $$u=1$$.

• The identity $\arctan(x)+\arctan\left(\dfrac{1}{x}\right)=\dfrac{\pi}{2}$ only works for positive $x$. Since $\arctan(x)+\arctan\left(\dfrac{1}{x}\right)$ is undefined for $x=0$, the function $f(x)=\arctan(x)+\arctan\left(\dfrac{1}{x}\right)$only has to be constant on a connected interval. Of course, these considerations are tangential to the question because in this case we are given $x\in[0,\pi]$.
– Joe
May 27, 2021 at 11:01

Write the integral as $$I=\int_{-\pi}^{0}4\arctan(e^x)-\pi \, dx + \int_{0}^{\pi}4\arctan(e^x)-\pi \, dx \, .$$ Upon making the substitution $$u=-x$$, we find that \begin{align} I &= -\int_{\pi}^{0}4\arctan(e^{-u})-\pi \, du + \int_{0}^{\pi}4\arctan(e^x)-\pi \, dx \\[5pt] &= \int_{0}^{\pi}4\arctan(e^{-x})-\pi \, dx + \int_{0}^{\pi}4\arctan(e^x)-\pi \, dx \\[5pt] &= \int_{0}^{\pi}4\left(\arctan(e^x)+\arctan(e^{-x})\right)-2\pi \, dx \end{align} Note that $$\arctan(u)+\arctan\left(\frac{1}{u}\right)=\begin{cases}\dfrac{\pi}{2} &\text{ if u>0}\\ -\dfrac{\pi}{2} &\text{ if u<0} \, .\end{cases}$$ In this case, $$x\in[0,\pi]$$, so $$u=e^x>0$$ and $$\arctan(u)+\arctan(1/u)=\pi/2$$, meaning that the integrand is the zero function. Hence, $$I=0$$.

The answer expands on my comment, which remarked that the integrand of the given integral is twice the Gudermannian function, $$\operatorname{gd}$$, which appears most famously in the equation governing the Mercator projection in cartography.

Differentiating the integrand gives $$\frac{d}{dx} \left[ 4 \arctan (e^x) - \pi \right] = 4 \cdot \frac{1}{1 + (e^x)^2} \cdot e^x = \frac{4}{e^x + e^{-x}} = 2 \operatorname{sech} x .$$ In particular, this derivative is even. Since evaluating the integrand at $$x = 0$$ gives $$4 \arctan (e^0) - \pi = 0$$ the integrand is odd; since the integral is taken over an interval symmetric around $$0$$, by symmetry $$\int_{-a}^a \left[ 4 \arctan (e^x) - \pi \right]\,dx = 0$$ for any $$a$$: In particular, the occurrence of $$\pi$$ in the limits of the integral is something of a red herring.

• +1 Gotta love an answer that brings up an obscure function like the Gudermannian. May 28, 2021 at 1:53