# 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.

• As a side note, if the first line is true, then for $|a| \le 1$, $$\int_{0}^{\pi /2} \arctan\left(\frac{2a\sin x}{1-a^{2}} \right) \, dx = 2 \int_{0}^{\pi /2} \arcsin( a \sin x) \ dx$$ Commented Nov 28, 2013 at 21:59
• @RandomVariable, that identity fails. The left-hand side is $2\chi_{2}(a)$, while the right-hand side is $4\chi_{2}\left(\frac{\sqrt{a^{2}+1}-1}{a}\right)$. Commented Nov 29, 2013 at 6:12
• I'm fairly certain that the right-hand side is also $2 \chi_{2} (a)$. Notice that the integrand is $\arcsin (a \sin x)$ and not $\arctan (a \sin x)$. Commented Nov 29, 2013 at 6:28
• @RandomVariable Oh, I just misread the right-hand side. Thank you! Recently it's getting slightly harder to read on screen. Commented Nov 29, 2013 at 6:30
• Integrating the identity $\tan^{-1}\left(\frac{2a\sin x}{1-a^2}\right)=\tan^{-1}(aie^{-ix})\tan^{-1}(aie^{ix})$ over $x$ from $0$ to $\pi/2$ will fetch your identity immediately. Commented Oct 20, 2017 at 5:46

$\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}

Sangchul Lee showed that 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}}. \tag{1}$$

The following is a way to prove $$(1)$$ using properties of hypergeometric functions.

Using the duplication formula for the gamma function, along with the fact that $$\frac{1}{(m-n)!} = \frac{(-1)^{n}(-m)_{n}}{m!},$$ we can express the left side of $$(1)$$ as the hypergeometric series $$_{3}F_{2} \left(1,-m,m+1;\frac{3}{2}, \frac{3}{2}; 1 \right).$$

Then using Euler's integral representation of the generalized hypergeometric function, we have $$_{3}F_{2} \left(1,-m,m+1;\frac{3}{2}, \frac{3}{2}; 1 \right) = \frac{1}{2} \int_{0}^{1} (1-t)^{-1/2} \, _2F_{1} \left(-m, m+1; \frac{3}{2} ; t \right) \mathrm dt,$$

where $$_2F_{1} \left(-m, m+1; \frac{3}{2} ; t \right) = \frac{\sin \left[(2m+1)\arcsin (\sqrt{t}) \right]}{(2m+1)\sqrt{t}}.$$

(See my answer here to a previous question.)

Therefore, \begin{align} \sum_{n=0}^{m} (-1)^{n} \, \frac{(m+n)!}{(m-n)!} \left( \frac{n!2^{2n}}{(2n+1)!} \right)^{2} &= \frac{1}{2(2m+1)} \int_{0}^{1} (1-t)^{-1/2} \, \frac{\sin \left[(2m+1)\arcsin (\sqrt{t}) \right]}{\sqrt{t}} \, \mathrm dt \\ &= \frac{1}{(2m+1)^{2}} \int_{0}^{(2m+1)\pi /2} \sin (u) \, \mathrm du \\ &= \frac{1}{(2m+1)^{2}}. \end{align}

Here is a simpler derivation:

\begin{align} &\int_{0}^{\pi/ 2} \arctan (a \sin x) \ dx \>\>\>\>\>\>\> (a=\tan 2b)\\ =& \int_0^{\pi/2}\int_0^b \frac{2\sin x}{1-\sin^2 2y \cos^2x}dy \ dx\\ =& \int_0^b \frac{2\tanh^{-1}(\sin 2y)}{\sin 2y} \overset{t=\tan y}{dy}= \int_0^{\tan b}\frac{1}{t}\tanh^{-1}\frac{2t}{1+t^2}\ dt\\ =&\int_0^{\tan b}\frac{\ln(1+t)-\ln(1-t)}{t}\ dt =\text{Li}_2(\tan b) -\text{Li}_2(-\tan b)\\ = &\ \operatorname{Li}_{2} \bigg(\frac{\sqrt{1+a^{2}}-1}{a} \bigg) - \operatorname{Li}_{2} \bigg(\frac{1-\sqrt{1+a^{2}}}{a} \bigg) \end{align}