TITLE: Prove $\int_{0}^{\pi/2} x\csc^2(x)\arctan \left(\alpha \tan x\right)\, dx = \frac{\pi}{2}\left[\ln\frac{(1+\alpha)^{1+\alpha}}{\alpha^\alpha}\right]$
QUESTION [22 upvotes]: When I showed to my brother how I proved
\begin{equation}
\int_{0}^{\!\Large \frac{\pi}{2}} \ln \left(x^{2} + \ln^2\cos x\right) \, \mathrm{d}x=\pi\ln\ln2
\end{equation}
using the following theorem by Mr. Olivier Oloa
\begin{equation}{\large\int_{0}^{\!\Large \frac{\pi}{2}}} \frac{\cos \left( s \arctan \left(-\frac{x}{\ln \cos x}\right)\right)}{(x^2+\ln^2\! \cos x)^{\Large\frac{s}{2}}}\, \mathrm{d}x = \frac{\pi}{2}\frac{1}{\ln^{\Large s}\!2}\qquad,\;\text{for }-1<s<1.\end{equation}
He showed me the following interesting formula

\begin{equation}
\int_{0}^{\!\Large \frac{\pi}{2}} x\csc^2(x)\arctan \left(\alpha \tan x\right)\, \mathrm{d}x
=\frac{\pi}{2}\,
\ln\left(\left[1 + \alpha\right]^{1 + \alpha}
\over \alpha^\alpha\right)\,,\qquad
\mbox{for}\ \alpha > 0\tag{✪}.
\end{equation}

I tried several values of $\alpha$ to check its validity (since he always messes around with me) and the numerical results match the output of Mathematica $9$. The problem is how to prove this formula since he didn't tell me (as always). I tried Feynman's integration trick and I arrived to the following result:
\begin{equation}\partial_\alpha\int_{0}^{\!\Large \frac{\pi}{2}} x\csc^2(x)\arctan \left(\alpha \tan x\right)\, \mathrm{d}x = \int_{0}^{\!\Large \frac{\pi}{2}} \frac{x\cot x}{\cos^2x+\alpha^2 \sin^2 x}\, \mathrm{d}x\end{equation}
but I am having difficulty to crack the very last integral. Could anyone here please help me to prove the formula $(✪)$ preferably with elementary ways (high school methods)? Any help would be greatly appreciated. Thank you.

REPLY [15 votes]: Note that
$$
\begin{align}
1-(1-\alpha^2)\sin^2(x)
&=1+(1-\alpha^2)\frac{e^{2ix}-2+e^{-2ix}}{4}\\
&=\frac{1-\alpha^2}4\left[e^{2ix}+2\frac{1+\alpha^2}{1-\alpha^2}+e^{-2ix}\right]\\
&=\frac{1-\alpha^2}4e^{-2ix}\left[e^{2ix}+\frac{1+\alpha}{1-\alpha}\right]\left[e^{2ix}+\frac{1-\alpha}{1+\alpha}\right]\\
&=\frac{(1+\alpha)^2}4\left[1+\frac{1-\alpha}{1+\alpha}e^{2ix}\right]\left[1+\frac{1-\alpha}{1+\alpha}e^{-2ix}\right]\tag{1}
\end{align}
$$
Taking $\frac12$ of the log of $(1)$ yields
$$
\frac12\log\left(1-(1-\alpha^2)\sin^2(x)\right)
=\log\left(\frac{\alpha+1}2\right)-\sum_{n=1}^\infty\left(\frac{\alpha-1}{\alpha+1}\right)^n\frac{\cos(2nx)}n\tag{2}
$$
Subtracting $\log(\alpha)$ from $(2)$ and sending $\alpha\to\infty$ gives
$$
\log(\sin(x))=-\log(2)-\sum_{n=1}^\infty\frac{\cos(2nx)}n\tag{3}
$$
Now, we are ready to tackle the integral given. Taking the derivative, using partial fractions, integrating by parts, then applying $(2)$ and $(3)$, yields
$$
\begin{align}
&\frac{\mathrm{d}}{\mathrm{d}\alpha}\int_0^{\pi/2}x\csc^2(x)\arctan(\alpha\tan(x))\,\mathrm{d}x\\
&=\int_0^{\pi/2}\frac{x}{\sin(x)}\frac{1}{1-(1-\alpha^2)\sin^2(x)}\,\mathrm{d}\sin(x)\tag{4a}\\
&=\int_0^{\pi/2}\left[\frac1{\sin(x)}-\frac{\raise{5mu}{\frac12}\sqrt{1-\alpha^2}}{1+\sqrt{1-\alpha^2}\sin(x)}+\frac{\raise{5mu}{\frac12}\sqrt{1-\alpha^2}}{1-\sqrt{1-\alpha^2}\sin(x)}\right]x\,\mathrm{d}\sin(x)\tag{4b}\\
&=\int_0^{\pi/2}x\,\mathrm{d}\left[\log(\sin(x))-\tfrac12\log\left(1-(1-\alpha^2)\sin^2(x)\right)\right]\tag{4c}\\
&=-\frac\pi2\log(\alpha)-\int_0^{\pi/2}\left[\log(\sin(x))-\tfrac12\log\left(1-(1-\alpha^2)\sin^2(x)\right)\right]\mathrm{d}x\tag{4d}\\
&=-\frac\pi2\log(\alpha)+\frac\pi2\log(2)+\frac\pi2\log\left(\frac{\alpha+1}2\right)\tag{4e}\\
&=\frac\pi2\log\left(\frac{\alpha+1}\alpha\right)\tag{4}
\end{align}
$$
Explanation:
$\mathrm{(4a)}$: differentiate with respect to $\alpha$
$\mathrm{(4b)}$: partial fractions
$\mathrm{(4c)}$: prepare to integrate by parts
$\mathrm{(4d)}$: integrate by parts
$\mathrm{(4e)}$: apply $(2)$ and $(3)$ noting that $\int_0^{\pi/2}\frac{\cos(2nx)}{n}\,\mathrm{d}x=\left[\frac{\sin(2nx)}{2n^2}\right]_0^{\pi/2}=0$  
Integrating $(4)$ gives
$$
\int_0^{\pi/2}x\csc^2(x)\arctan(\alpha\tan(x))\,\mathrm{d}x
=\frac\pi2\log\left(\frac{(\alpha+1)^{\alpha+1}}{\alpha^\alpha}\right)\tag{5}
$$