# How to find the integral $\displaystyle\int_{0}^{\infty}\frac{\arctan{x}}{2+x^2}dx$

Find this integral $$I=\int_{0}^{\infty}\dfrac{\arctan{x}}{2+x^2}dx$$

My try: since let$$\arctan{x}=u$$ then $$I=\int_{0}^{\frac{\pi}{2}}\dfrac{x}{1+\cos^2{x}}dx$$

the wolf <---

then I can't.Thank you

• Please check your substitution – dajoker Jan 10 '14 at 14:57
• WA $=>$ – Felix Marin Jan 21 '14 at 5:04
• @FelixMarin Your link is irrelevant, the OP is interested in the value of the integral from 0 to infinity, not in a primitive. – Did May 16 '14 at 6:26

We start by defining $$I(a)=\int_{0}^{\infty}{\frac{\operatorname{arctan}(ax)}{2+x^{2}}dx}$$ An application of Leibniz integral rule gives $$I'(a)=\int_{0}^{\infty}{\frac{x}{(1+(ax)^{2})(2+x^{2})}dx}=\frac{1}{2a^{2}-1}\int_{0}^{\infty}{a\frac{ax}{1+(ax)^{2}}-\frac{x}{2+x^{2}}dx}=\frac{\log(\sqrt{2}a)}{2a^{2}-1}$$ Notice that $I(0)=0$ and our desired integral is $I=I(1)$, hence $$I=\int_{0}^{1}{\frac{\log(\sqrt{2}t)}{2t^{2}-1}dt}=\frac{1}{\sqrt{2}}\int_{0}^{\sqrt{2}}{\frac{\log u}{u^{2}-1}du}=\frac{1}{\sqrt{2}}[{\int_{0}^{1}{\frac{\log u}{u^{2}-1}du}+\int_{1}^{\sqrt{2}}}{\frac{\log u}{u^{2}-1}du}]$$ Substituting $u=\frac{1}{t}$ on the second integral and adding up simplifies to $$I=\sqrt{2}\int_{0}^{1}{\frac{\log u}{u^{2}-1}du}-\frac{1}{\sqrt{2}}\int_{0}^{\frac{1}{\sqrt{2}}}{\frac{\log u}{u^{2}-1}du}=$$ $$\frac{1}{\sqrt{2}}\sum_{n=0}^{\infty}\int_{0}^{\frac{1}{\sqrt{2}}}{u^{2n}\log udu}-\sqrt{2}\sum_{n=0}^{\infty}\int_{0}^{1}{u^{2n}\log udu}=\frac{\log(\frac{1}{\sqrt{2}})}{2}\sum_{n=0}^{\infty}\frac{(\frac{1}{2})^{n}}{2n+1}-\frac{1}{2}\sum_{n=0}^{\infty}\frac{(\frac{1}{2})^{n}}{(2n+1)^{2}}+\sqrt{2}\sum_{n=0}^{\infty}\frac{1}{(2n+1)^{2}}$$ For $|t|<1$, consider $$\log(\frac{1}{1-t})=\sum_{n=1}^{\infty}\frac{t^{n}}{n}=\frac{1}{2}\sum_{n=1}^{\infty}\frac{(t^{2})^{n}}{n}+\sum_{n=0}^{\infty}\frac{t^{2n+1}}{2n+1}=\frac{1}{2}\log(\frac{1}{1-t^{2}})+t\sum_{n=0}^{\infty}\frac{(t^{2})^{n}}{2n+1}$$ Solving for sum on RHS and dividing by t yields $$\sum_{n=0}^{\infty}\frac{t^{2n}}{2n+1}=\frac{\frac{1}{2}\log(1-t^{2})-\log(1-t)}{t}$$ Next we plug in $t=\frac{1}{\sqrt{2}}$ which boils down to $$\sum_{n=0}^{\infty}\frac{(\frac{1}{2})^{n}}{2n+1}=\sqrt{2}\log(1+\sqrt{2})$$ Similarly for $|t|<1$, recall that $$\operatorname{Li}_{2}(t)=\sum_{n=1}^{\infty}\frac{t^{n}}{n^{2}}=\frac{1}{4}\sum_{n=1}^{\infty}\frac{(t^{2})^{n}}{n^{2}}+\sum_{n=0}^{\infty}\frac{t^{2n+1}}{(2n+1)^{2}}=\frac{1}{4}\operatorname{Li}_{2}(t^{2})+t\sum_{n=0}^{\infty}\frac{t^{2n}}{(2n+1)^{2}}$$ Solving for the sum on the RHS, dividing by t and pluggin $t=\frac{1}{\sqrt{2}}$ yiels $$\sum_{n=0}^{\infty}\frac{(\frac{1}{2})^{n}}{(2n+1)^{2}}=\sqrt{2}(\operatorname{Li}_{2}(\frac{1}{\sqrt{2}})-\frac{1}{4}\operatorname{Li}_{2}(\frac{1}{2}))$$ Furthermore it can be shown that $$\sum_{n=0}^{\infty}\frac{1}{(2n+1)^{2}}=\frac{\pi^{2}}{8}$$ $$\operatorname{Li}_{2}(\frac{1}{2})=\frac{\pi^{2}}{12}-\frac{\log^{2}2}{2}$$. So it simplifies further to $$\sum_{n=0}^{\infty}\frac{(\frac{1}{2})^{n}}{(2n+1)^{2}}=\sqrt{2}\operatorname{Li}_{2}(\frac{1}{\sqrt{2}})+\frac{\log^{2}2}{4\sqrt{2}}-\frac{\pi^{2}}{24\sqrt{2}}$$ Now collecting every single piece and adding up we finally arrive at $$I=\int_{0}^{\infty}{\frac{\operatorname{arctan}x}{2+x^{2}}dx}=\frac{13\pi^{2}}{48\sqrt{2}}-\frac{\log^{2}2}{8\sqrt{2}}-\frac{1}{\sqrt{2}}\operatorname{Li}_{2}(\frac{1}{\sqrt{2}})-\frac{\log(1+\sqrt{2})\log2}{2\sqrt{2}}$$

• Does it strike you odd that you have a positive integrand and a negative integral? – Ron Gordon May 15 '14 at 22:01
• yes, indeed.. Im looking for the error... :/ – TheOscillator May 15 '14 at 22:04
• I think its alright now.. Forgot to add the minus signs when integrating by parts, classic! – TheOscillator May 15 '14 at 22:26
• My bad! My notes are a total mess, 4 pages of pure calculations.. Hope I finally got this one straight, Thanks for your input Ron! – TheOscillator May 15 '14 at 22:43
• Looks like you got agreement. You should make sure you have numerical agreement before posting - you'll catch a lot of mistakes that way. WA is free of charge and will do reasonable numerical integrals and most special functions, so there is no excuse not to check. – Ron Gordon May 15 '14 at 22:45

See my paper Some Integrals of the Arctangent Function, M. L. Glasser, Mathematics of Computation, Vol. 22, No. 102 (Apr., 1968), pp. 445-447.

• should at least provide a link for a free read of the pages in question.. – Ant Jan 10 '14 at 17:20
• or at least a summary of the key result. – Batman May 15 '14 at 21:58

$\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{\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}}$ $\ds{I=\int_{0}^{\infty}{\arctan\pars{x} \over 2 + x^{2}}\,\dd x:\ {\large ?}}$.

\begin{align} I&=\ \overbrace{\int_{0}^{\infty}{\arctan\pars{x} \over 2 + x^{2}}\,\dd x} ^{\ds{\mbox{Set}\ \arctan\pars{x} \equiv \theta\ \imp\ x = \tan\pars{\theta}}}\ =\ \int_{0}^{\pi/2}{\theta \over 2 + \tan^{2}\pars{\theta}}\,\sec^{2}\pars{\theta}\,\dd\theta \\[3mm]&=\int_{0}^{\pi/2}{\theta \over \cos^{2}\pars{\theta} + 1}\,\dd\theta =\Im\int_{0}^{\pi/2}{\theta \over \cos\pars{\theta} - \ic}\,\dd\theta \\[3mm]&=\Im \int_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {-\ic\ln\pars{z} \over \pars{z^{2} + 1}/\pars{2z} - \ic}\,{\dd z \over \ic z} =-2\,\Im \int_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}0\ <\ {\rm Arg}\pars{z}\ <\ \pi/2}} {\ln\pars{z} \over z^{2} - 2\ic z + 1}\,\dd z \\[3mm]&=2\,\Im\bracks{\int_{1}^{0}{\ln\pars{y} + \pi\ic/2 \over -y^{2} + 2y + 1}\, \ic\,\dd y +\int_{0}^{1}{\ln\pars{x} \over x^{2} - 2\ic x + 1}\,\dd x} \end{align}

$$\begin{array}{|c|}\hline\\ \quad I=\int_{0}^{\infty}{\arctan\pars{x} \over 2 + x^{2}}\,\dd x =2\color{#00f}{\int_{0}^{1}{\ln\pars{x}\over x^{2} -2x - 1}\,\dd x} +2\Im\color{#f00}{\int_{0}^{1}{\ln\pars{x} \over x^{2} - 2\ic x + 1}\,\dd x}\quad \\ \\ \hline \end{array}\tag{1}$$

$\ds{r_{\pm} \equiv 1 \pm \root{2}}$ are zeros of $\ds{x^{2} - 2x - 1 = 0}$ while $\quad\ds{r_{\pm}\ic}\quad$ are zeros of $\ds{x^{2} - 2\ic x - 1 = 0}$. Note that $\ds{r_{-}r_{+} = -1}$.

The RHS integral is evaluated as follows: \begin{align}&\int_{0}^{1}{\ln\pars{x} \over x - a}\,\dd x =-\int_{0}^{1/a}{\ln\pars{ax} \over 1 - x}\,\dd x =-\int_{0}^{1/a}{\ln\pars{1 - x} \over x}\,\dd x =\int_{0}^{1/a}{{\rm Li}_{1}\pars{x} \over x}\,\dd x \end{align} where $\ds{{\rm Li}_{s}\pars{z}}$ is a PolyLogarithm Function and, hereafter, we'll use well known properties of them as reported in the above cited link. \begin{align}&\int_{0}^{1}{\ln\pars{x} \over x - a}\,\dd x =\int_{0}^{1/a}{\rm Li}_{2}'\pars{x}\,\dd x={\rm Li}_{2}\pars{1 \over a} \end{align}
Expression $\pars{2}$ becomes: \begin{align}&\color{#00f}{\int_{0}^{1}{\ln\pars{x}\over x^{2} -2x - 1}\,\dd x} ={\root{2} \over 4}\sum_{\sigma = \pm}\sigma\, {\rm Li}_{2}\pars{1 \over r_{\sigma}} ={\root{2} \over 4}\sum_{\sigma = \pm}\sigma\,{\rm Li}_{2}\pars{-r_{-\sigma}} \\[3mm]&={\root{2} \over 4}\bracks{{\rm Li}_{2}\pars{-r_{-}} -{\rm Li}_{2}\pars{-r_{+}}} =\color{#00f}{{\root{2} \over 4}\bracks{{\rm Li}_{2}\pars{\root{2} - 1} -{\rm Li}_{2}\pars{-\root{2} - 1}}}\quad\pars{3} \end{align} We can see that the $\ds{\color{#f00}{\mbox{red integral}}}$ has the same structure that the $\ds{\color{#00f}{\mbox{blue one}}}$: \begin{align}&\color{#f00}{\int_{0}^{1}{\ln\pars{x}\over x^{2} -2\ic x - 1}\,\dd x} ={1 \over \ic\pars{r_{+} - r_{-}}}\sum_{\sigma = \pm}\sigma\int_{0}^{1}{\ln\pars{x} \over x - \ic r_{\sigma}} =-\ic\,{\root{2} \over 4}\bracks{% {\rm Li}_{2}\pars{\ic r_{-}} - {\rm Li}_{2}\pars{\ic r_{+}}} \\[3mm]&=\color{#f00}{-\ic\,{\root{2} \over 4} \bracks{{\rm Li}_{2}\pars{\bracks{1 - \root{2}}\ic} -{\rm Li}_{2}\pars{\bracks{1 + \root{2}}\ic}}}\qquad\qquad\qquad\qquad\quad\qquad\pars{4} \end{align}
With $\pars{3}$ and $\pars{4}$, expression $\pars{1}$ is reduced to $$\begin{array}{|rcl|}\hline &&\\ \quad I & = & \int_{0}^{\infty}{\arctan\pars{x} \over 2 + x^{2}}\,\dd x \\&=&{\root{2} \over 2}\left(\vphantom{\Huge A}% {\rm Li}_{2}\pars{\root{2} - 1} - {\rm Li}_{2}\pars{-\root{2} - 1}\right. \\&&\phantom{{\root{2} \over 2}\pars{}}+\left.\vphantom{\Huge A}\Re\braces{\vphantom{\LARGE A}{\rm Li}_{2}\pars{\bracks{1 + \root{2}}\ic} - {\rm Li}_{2}\pars{\bracks{1 - \root{2}}\ic}}\right) \approx 0.9941\quad\\&&\\ \hline \end{array}$$
$\color{#f0f}{\ds{\tt\mbox{which agrees with a 'numerical checking'}}}$.
What exactly are you asking for? As you say, the answer is: $$\frac{1}{8} \left(-\Phi \left(\frac{1}{2},2,\frac{1}{2}\right)+\sqrt{2} \pi ^2-\sqrt{2} \log (4) \coth ^{-1}\left(\sqrt{2}\right)\right)$$ which seems to indicate that no elementary answer exists.