Using the Maclaurin series of $\arctan(x)$ to evaluate $\int_{0}^{\frac{\pi}{2}} \arctan( a \sin x) \, \mathrm dx$

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.


$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ \begin{align}&\color{#c00000}{\int_{0}^{\pi/2}\arctan\pars{a\sin\pars{x}}\,\dd x} ={\pi \over 2}\,\arctan\pars{a} -\int_{0}^{\pi/2}x\,{a\cos\pars{x} \over a^{2}\sin^{2}\pars{x} + 1}\,\dd x \\[3mm]&={\pi \over 2}\,\arctan\pars{a} -a\,\Re\color{#00f}{\int_{0}^{\pi/2}{x\cos\pars{x} \over 1 + \verts{a}\sin\pars{x}\ic}\,\dd x} \end{align}

\begin{align}&\color{#00f}{\int_{0}^{\pi/2}{x\cos\pars{x}\over 1 + \verts{a}\sin\pars{x}\ic}\,\dd x} = \oint_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {-\ic\ln\pars{z}\pars{z^{2} + 1}/\pars{2z}\over 1 + \verts{a}\pars{z^{2} - 1}/\pars{2\ic z}}\,{\dd z \over \ic z} \\[3mm]&=\ic \oint_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {\ln\pars{z}\pars{z^{2} + 1} \over \verts{a}z^{2} + 2\ic z - \verts{a}} \,{\dd z \over z} \\[3mm]&={\ic \over \verts{a}} \oint_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {\ln\pars{z}\pars{z^{2} + 1} \over \pars{z - z_{-}}\pars{z - z_{+}}} \,{\dd z \over z}\,,\qquad z_{\pm} \equiv {-\ic \pm \root{a^{2} - 1} \over \verts{a}} \end{align}

Note that $\ds{z_{-}\,z_{+} = -1}$.

Also, \begin{align}&{z^{2} + 1 \over \pars{z - z_{-}}\pars{z - z_{+}}} =\pars{{z^{2} + 1 \over z - z_{+}} - {z^{2} + 1 \over z - z_{-}}} \,{1 \over z_{+} - z_{-}} \\[3mm]&={1 \over z_{+} - z_{-}}\,\pars{z + z_{+} + {z_{+}^{2} + 1 \over z - z_{+}} -z - z_{-} - {z_{-}^{2} + 1 \over z - z_{-}}} =1 + {1 \over z_{+} - z_{-}} \sum_{\sigma = \pm}\sigma\,{z_{\sigma}^{2} + 1 \over z - z_{\sigma}} \end{align}

and \begin{align}&{z^{2} + 1 \over \pars{z - z_{-}}\pars{z - z_{+}}z} ={1 \over z} + {1 \over z_{+} - z_{-}} \sum_{\sigma = \pm}\sigma\,{z_{\sigma}^{2} + 1 \over \pars{z - z_{\sigma}}z} \\[3mm]&={1 \over z} + {1 \over z_{+} - z_{-}} \sum_{\sigma = \pm}\sigma\,\pars{z_{\sigma}^{2} + 1} \pars{{1 \over z - z_{\sigma}} - {1 \over z}}\,{1 \over z_{\sigma}} \\[3mm]&=\pars{1 - {1 \over z_{+} - z_{-}}% \sum_{\sigma = \pm}\sigma\,\pars{z_{\sigma} - z_{-\sigma}}}\,{1 \over z} +{1 \over z_{+} - z_{-}}\sum_{\sigma = \pm} {\sigma\pars{z_{\sigma} - z_{-\sigma}} \over z - z_{\sigma}} \\[3mm]&=-\,{1 \over z} +\sum_{\sigma = \pm}{1 \over z - z_{\sigma}} \end{align}

\begin{align}&\color{#00f}{\int_{0}^{\pi/2}{x\cos\pars{x}\over 1 + \verts{a}\sin\pars{x}\ic}\,\dd x} \\[3mm]&=-\,{\ic \over \verts{a}}\ \underbrace{% \oint_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {\ln\pars{z} \over z}\,\dd z}_{\ds{=\ -\,{\pi^{2} \over 8}}}\ +\ {\ic \over \verts{a}}\sum_{\sigma=\pm} \oint_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {\ln\pars{z} \over z - z_{\sigma}}\,\dd z \end{align}

\begin{align}&\color{#c00000}{\int_{0}^{\pi/2}\arctan\pars{a\sin\pars{x}}\,\dd x} ={\pi \over 2}\,\arctan\pars{a} +\sgn\pars{a}\,\Im\sum_{\sigma=\pm} \oint_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {\ln\pars{z} \over z - z_{\sigma}}\,\dd z \end{align} With \begin{align}& \oint_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {\ln\pars{z} \over z - z_{\sigma}}\,\dd z =-\int_{1}^{0}{\ln\pars{y} + \ic\pi/2 \over \ic y - z_{\sigma}}\,\ic\dd y -\int_{0}^{1}{\ln\pars{x} \over x - z_{\sigma}}\,\dd x \\[3mm]&=\ic\,{\pi \over 2}\int_{0}^{1}{\dd y \over y + z_{\sigma}\,\ic} +\int_{0}^{1}{\ln\pars{y} \over z_{\sigma}\ic + y}\,\dd y -\int_{0}^{1}{\ln\pars{x} \over -z_{\sigma} + x}\,\dd x \\[3mm]&=\ic\,{\pi \over 2}\,\ln\pars{1 + z_{\sigma}\ic \over z_{\sigma}\ic} +{\rm Li}_{2}\pars{-\,{1 \over z_{\sigma}\ic}} -{\rm Li}_{2}\pars{-\,{1 \over z_{\sigma}}} \\[3mm]&=\ic\,{\pi \over 2}\,\ln\pars{1 + z_{-\sigma}\ic} + {\rm Li}_{2}\pars{-z_{-\sigma}\ic} - {\rm Li}_{2}\pars{z_{-\sigma}} \end{align}

since \begin{align} &\int_{0}^{1}{\ln\pars{\xi}\,\dd\xi \over b + \xi} =-\int_{0}^{-1/b}{\ln\pars{-b\xi}\,\dd\xi \over 1 - \xi} =-\int_{0}^{-1/b}{\ln\pars{1 - \xi} \over \xi}\,\dd\xi \\[3mm]&= \int_{0}^{-1/b}{\rm Li}_{2}'\pars{\xi}\,\dd xi={\rm Li}_{2}\pars{-\,{1 \over b}} \end{align}

The final result becomes \begin{align} &\color{#c00000}{\int_{0}^{\pi/2}\arctan\pars{a\sin\pars{x}}\,\dd x} \\[3mm]&={\pi \over 2}\,\arctan\pars{a} + {\pi\sgn\pars{a} \over 2}\,\ln\pars{2\,{\verts{a} + 1 \over \verts{a}}} \\[3mm]&+\sgn\pars{a}\Im\left\lbrack% {\rm Li}_{2}\pars{-1 - \ic\root{a^{2} - 1} \over \verts{a}} -{\rm Li}_{2}\pars{-\ic + \root{a^{2} - 1} \over \verts{a}}\right. \\[3mm]&\phantom{\sgn\pars{a}\Im\bracks{}}\left.+{\rm Li}_{2}\pars{-1 + \ic\root{a^{2} - 1} \over \verts{a}} -{\rm Li}_{2}\pars{-\ic - \root{a^{2} - 1} \over \verts{a}}\right\rbrack \end{align}