I need to Evaluate $$\int_0^\pi \arctan(\cos x)\,\mathrm dx$$ . I tried to make an exchage $t=\cos x$ and then take the integral by parts
[Math] Evaluate $\int_0^\pi \arctan(\cos x)\,\mathrm dx$
calculusdefinite integralsintegration
Related Solutions
Okay, finally I was able to prove it.
Step 0. Observations. In view of the following identity
$$ \int_{0}^{\frac{\pi}{2}} \arctan (r \sin\theta) \, d\theta = 2 \chi_{2} \left( \frac{\sqrt{1+r^{2}} - 1}{r} \right), $$
Vladimir's result suggests that there may exists a general formula connecting
$$ I(r, s) = \int_{0}^{\frac{\pi}{2}} \arctan (r \sin\theta) \arctan (s \sin\theta) \, d\theta $$
and the Legendre chi function $\chi_{2}$. Indeed, inspired by Vladimir's result, I conjectured that
$$ I(r, s) = \pi \chi_{2} \left( \frac{\sqrt{1+r^{2}} - 1}{r} \cdot \frac{\sqrt{1+s^{2}} - 1}{s} \right). \tag{1} $$
I succeeded in proving this identity, so I post a solution here.
Step 1. Proof of the identity $\text{(1)}$. It is easy to check that the following identity holds:
$$ \arctan(ab) = \int_{1/b}^{\infty} \frac{a \, dx}{a^{2} + x^{2}}. $$
So it follows that
\begin{align*} I(r, s) &= \int_{1/r}^{\infty} \int_{1/s}^{\infty} \int_{0}^{\frac{\pi}{2}} \frac{\sin^{2}\theta}{(x^{2} + \sin^{2}\theta)(y^{2} + \sin^{2}\theta)} \, d\theta dy dx \\ &= \int_{1/r}^{\infty} \int_{1/s}^{\infty} \int_{0}^{\frac{\pi}{2}} \frac{1}{x^{2} - y^{2}} \left( \frac{x^{2}}{x^{2} + \sin^{2}\theta} - \frac{y^{2}}{y^{2} + \sin^{2}\theta} \right) \, d\theta dy dx \\ &= \frac{\pi}{2} \int_{1/r}^{\infty} \int_{1/s}^{\infty} \frac{1}{x^{2} - y^{2}} \left( \frac{x}{\sqrt{x^{2} + 1}} - \frac{y}{\sqrt{y^{2} + 1}} \right) \, dy dx. \end{align*}
For the convenience of notation, we put
$$ \alpha = \frac{\sqrt{r^{2} + 1} - 1}{r} \quad \text{and} \quad \beta = \frac{\sqrt{s^{2} + 1} - 1}{s}. $$
Then it is easy to check that $\mathrm{arsinh}(1/r) = - \log \alpha$ and likewise for $s$ and $\beta$. Thus with the substitution $x \mapsto \sinh x$ and $y \mapsto \sinh y$, we have
\begin{align*} I(r, s) &= \frac{\pi}{2} \int_{-\log\alpha}^{\infty} \int_{-\log\beta}^{\infty} \frac{\sinh x \cosh y - \sinh y \cosh x}{\sinh^{2}x - \sinh^{2}y} \, dy dx. \end{align*}
Applying the substitution $e^{-x} \mapsto x$ and $e^{-y} \mapsto y$, it follows that
\begin{align*} I(r, s) &= \pi \int_{0}^{\alpha} \int_{0}^{\beta} \frac{dydx}{1 - x^{2}y^{2}} \\ &= \pi \sum_{n=0}^{\infty} \left( \int_{0}^{\alpha} x^{2n} \, dx \right) \left( \int_{0}^{\beta} y^{2n} \, dx \right) = \pi \sum_{0}^{\infty} \frac{(\alpha \beta)^{2n+1}}{(2n+1)^{2}} \\ &= \pi \chi_{2}(\alpha \beta) \end{align*}
as desired, proving the identity $\text{(1)}$.
EDIT. I found a much simpler and intuitive proof of $\text{(1)}$. We first observe that $\text{(1)}$ is equivalent to the following identity
$$ \int_{0}^{\frac{\pi}{2}} \arctan\left( \frac{2r\sin\theta}{1-r^{2}} \right) \arctan\left( \frac{2s\sin\theta}{1-s^{2}} \right) \, d\theta = \pi \chi_{2}(rs). $$
Now we first observe that from the addition formula for the hyperbolic tangent, we obtain the following formula
$$ \operatorname{artanh}x - \operatorname{artanh} y = \operatorname{artanh} \left( \frac{x - y}{1 - xy} \right) $$
which holds for sufficiently small $x, y$. Thus
\begin{align*} \arctan\left( \frac{2r\sin\theta}{1-r^{2}} \right) &= \frac{1}{i} \operatorname{artanh}\left( \frac{2ir\sin\theta}{1-r^{2}} \right) = \frac{\operatorname{artanh}(re^{i\theta}) - \operatorname{artanh}(re^{-i\theta})}{i} \\ &= 2 \Im \operatorname{artanh}(re^{i\theta}) = 2 \sum_{n=0}^{\infty} \frac{\sin(2n+1)\theta}{2n+1} r^{2n+1}. \end{align*}
We readily check this holds for any $|r| < 1$. Therefore
\begin{align*} &\int_{0}^{\frac{\pi}{2}} \arctan\left( \frac{2r\sin\theta}{1-r^{2}} \right) \arctan\left( \frac{2s\sin\theta}{1-s^{2}} \right) \, d\theta \\ &\quad = 4 \sum_{m=0}^{\infty} \sum_{n=0}^{\infty} \frac{r^{2m+1}s^{2n+1}}{(2m+1)(2n+1)} \int_{0}^{\frac{\pi}{2}} \sin(2m+1)\theta \sin(2n+1)\theta \, d\theta\\ &\quad = 2 \sum_{m=0}^{\infty} \sum_{n=0}^{\infty} \frac{r^{2m+1}s^{2n+1}}{(2m+1)(2n+1)} \int_{0}^{\frac{\pi}{2}} \{ \cos(2m-2n)\theta - \cos(2m+2n+2)\theta \} \, d\theta\\ &\quad = \pi \sum_{m=0}^{\infty} \sum_{n=0}^{\infty} \frac{r^{2m+1}s^{2n+1}}{(2m+1)(2n+1)} \delta_{m,n} \\ &\quad = \pi \chi_{2}(rs). \end{align*}
I will refer to the following result from my previous answer:
\begin{align*} I(r, s) &= \int_{0}^{\frac{\pi}{2}} \arctan (r \sin\theta) \arctan (s \sin\theta) \, d\theta \\ &= \pi \chi_{2} \left( \frac{\sqrt{1+r^{2}} - 1}{r} \times \frac{\sqrt{1+s^{2}} - 1}{s} \right), \end{align*}
where $\chi_{2}$ is the Legendre chi function. Using the addition formula for the arctangent, it follows that
$$ \arctan\left(\frac{6\sin x}{3 + \cos 2x} \right) = \arctan \left( \frac{\frac{3}{2}\sin x}{1 - \frac{1}{2}\sin^{2} x} \right) = \arctan (\sin x) + \arctan ( \tfrac{1}{2}\sin x). $$ So it follows that
$$ \int_{0}^{\frac{\pi}{2}} \arctan^{2}\left(\frac{6\sin x}{3+\cos 2x}\right) \, dx = I(1,1) + 2I(1,\tfrac{1}{2}) + I(\tfrac{1}{2},\tfrac{1}{2}), $$
which reduces to a combination of Legendre chi functions
$$ \pi \left\{ \chi_{2}(3 - 2\sqrt{2}) + \chi_{2}(9 - 4\sqrt{5}) + 2\chi_{2}\left( (\sqrt{2} - 1)(\sqrt{5} - 2) \right) \right\}. $$
Best Answer
Let $$I=\int_0^\pi \arctan(\cos x)\,\mathrm dx\tag{1}$$ then by using using
$$\begin{align}\int_a^bf(x)\,\mathrm dx&=\int_a^bf(a+b-x)\,\mathrm dx\\ I&=\int_0^\pi \arctan(\cos (\pi-x))\,\mathrm dx\tag{2}\\ &=\int_0^\pi \arctan(-\cos x)\,\mathrm dx\tag{3}\\ &=\int_0^\pi -\arctan(\cos x)\,\mathrm dx\tag{4}\\ \end{align}$$
Adding $(1)$ and $(4)$
$$\begin{align} 2I&=\int_0^\pi \arctan(\cos x)\,\mathrm dx-\int_0^\pi \arctan(\cos x)\,\mathrm dx\\ &=0\\ \end{align}$$