Using the Maclaurin series of $\arctan(x)$ to evaluate $\int_{0}^{\frac{\pi}{2}} \arctan( a \sin x) \, \mathrm dx$ I want to use the Maclaurin series of $\arctan (x)$ to show that
\begin{align}\int_{0}^{\pi/ 2} \arctan (a \sin x) \,  \mathrm dx &= 2 \sum_{k=0}^{\infty} \frac{\left(\frac{\sqrt{1 + a^{2}}- 1}{a}\right)^{2k+1}}{(2k+1)^{2}} \\ &= \operatorname{Li}_{2} \left(\frac{\sqrt{1+a^{2}}-1}{a} \right) -  \operatorname{Li}_{2} \left(\frac{1-\sqrt{1+a^{2}}}{a} \right).
\end{align}
I guess we should first impose the restriction $  |a| \le 1$.
Then we have
$$ \begin{align} \int_{0}^{\pi/ 2} \arctan (a \sin x) \ dx  &= \int_{0}^{\pi /2} \sum_{k=0}^{\infty} (-1)^{k} \, \frac{(a \sin x)^{2k+1}}{2k+1} \, \mathrm  dx \\ &= \sum_{k=0}^{\infty} (-1)^{k} \, \frac{a^{2k+1}}{2k+1} \int_{0}^{\pi /2} \sin^{2k+1} (x) \, \mathrm  dx \\ &= \sum_{k=0}^{\infty} (-1)^{k} \frac{a^{2k+1}}{(2k+1)^{2}} \frac{2^{2k}}{\binom{2k}{k}}. \end{align}$$
But how do we proceed from here?

Here is an idea: We prove the following identity instead.
$$ \int_{0}^{\frac{\pi}{2}} \arctan\left(\frac{2a\sin x}{1-a^{2}} \right) \, dx = 2 \sum_{n=0}^{\infty} \frac{a^{2n+1}}{(2n+1)^{2}}. $$
Expanding left-hand side,
\begin{align*}
\int_{0}^{\frac{\pi}{2}} \arctan\left(\frac{2a\sin x}{1-a^{2}} \right) \, dx
&= \sum_{n=0}^{\infty} \frac{(-1)^{n}}{2n+1} \int_{0}^{\frac{\pi}{2}} \left(\frac{2a\sin x}{1-a^{2}} \right)^{2n+1} \, dx \\
&= \sum_{n=0}^{\infty} \frac{(-1)^{n}}{2n+1} (2a)^{2n+1}  \int_{0}^{\frac{\pi}{2}} \frac{\sin^{2n+1}x}{(1-a^{2})^{2n+1}} \, dx \\
&= \sum_{n=0}^{\infty} \sum_{j=0}^{\infty}  \left( \frac{(-1)^{n}2^{2n+1} }{2n+1} \binom{2n+j}{j} \int_{0}^{\frac{\pi}{2}} \sin^{2n+1}x \, dx\right) a^{2j+2n+1}.
\end{align*}
Plugging $m = n+j$, it follows that
\begin{align*}
\int_{0}^{\frac{\pi}{2}} \arctan\left(\frac{2a\sin x}{1-a^{2}} \right) \, dx
&= \sum_{m=0}^{\infty} \left( \sum_{n=0}^{m}  \frac{(-1)^{n}2^{2n+1} }{2n+1} \binom{m+n}{m-n} \int_{0}^{\frac{\pi}{2}} \sin^{2n+1}x \, dx\right) a^{2m+1}.
\end{align*}
Thus plugging the Wallis formula, the problem reduces to showing that
$$ \sum_{n=0}^{m} (-1)^{n} \frac{(m+n)!}{(m-n)!} \left( \frac{n!2^{2n}}{(2n+1)!} \right)^{2} = \frac{1}{(2m+1)^{2}}. $$
But I have no idea how to prove this.
