# Evaluate $\int^{2}_{0}\frac{\tan^{-1}(x)}{1+4x}\mathrm dx$

Evaluate $$\displaystyle \int^{2}_{0}\frac{\tan^{-1}(x)}{1+4x}\mathrm dx$$

My effort:

\begin{align*} I(a)&=\int^{2}_{0}\frac{\tan^{-1}(ax)}{1+4x}\mathrm dx\\ I'(a) &= \int^{2}_{0}\frac{x}{(1+4x)(1+a^2x^2)}\mathrm dx\\ I'(a) &= \frac{1}{4}\int^{2}_{0}\frac{(1+4x)-1}{(1+4x)(1+a^2x^2)}dx\\ I'(a) &= \frac{1}{4a}\tan^{-1}(2)-\frac{1}{4}\int^{2}_{0}\frac{1}{(1+4x)(1+a^2x^2)}dx \end{align*}

Then how to proceed? Thank you.

• Partial Fraction Decomposition? Commented Mar 23, 2019 at 12:11
• @ mrtaurho i searcing for some easy way to handle that problem but not find it.have any idea please help me thanks Commented Mar 23, 2019 at 12:23
• From where did you get this integral? Is it worth hoping an elementary answer? Commented Mar 23, 2019 at 13:13
• What is $tan^{-1}$? Is it $arctan$ or $cot$? Commented May 22, 2019 at 8:10
• Thank you for awards! There were a creative command, and my proposition is to continue the competition in the new question - to express the integral $\int_0^p \dfrac{\arctan x}{1+qx}\,dx$ in the elementary functions. Commented May 30, 2019 at 18:45

Another way to obtain result.

Are known trigonometric equalities

$$\tan(a+b) = \dfrac{\tan a+\tan b}{1-\tan a\tan b},\tag{Q1}$$ $$\tan\left(a+\frac\pi4\right) = \dfrac{\tan a +1}{1-\tan a},\tag{Q2}$$ $$\sec^2\left(a+\frac\pi4\right) = 2\dfrac{1+\tan^2a}{(1-\tan a)^2}.\tag{Q3}$$

Let $$\,x= \tan (y+\frac\pi4),\quad dx=\sec^2(y+\frac\pi4)\,dy,\,$$ then

\begin{align} &I(1) = \int\limits_0^2 \dfrac{\frac\pi4+\arctan x-\frac\pi4}{1+4x}\,dx = \dfrac\pi4\int\limits_0^2 \dfrac{dx}{1+4x} + \int\limits_{\large-\frac\pi4}^{\large\arctan\frac13} \dfrac {y\sec^2(y+\frac\pi4)\,dy}{1+4\tan(y+\frac\pi4)}\\ & = \dfrac\pi{16}\ln(1+4x)\bigg|_0^2 + \int\limits_{\large-\frac\pi4}^{\large\arctan \frac13}\dfrac{2(1+\tan^2y)y\,dy} {(1-\tan y)^2\left(1+4\frac{\large\tan y+1}{\large1-\tan y}\right)}\\ & = \dfrac{\pi\ln3}8 + \int\limits_{\large-\frac\pi4}^{\large\arctan \frac13} \dfrac{2y\sec^2y\,dy}{(1-\tan y)(5+3\tan y)}\\ & = \dfrac{\pi\ln3}8 + \dfrac14\int\limits_{\large-\frac\pi4}^{\large\arctan \frac13} y\left(\dfrac1{1-\tan y}+\dfrac3{5+3\tan y}\right)\sec^2y\,dy\\ & = \dfrac{\pi\ln3}8 + \dfrac14\int\limits_{\large-\frac\pi4}^{\large\arctan \frac13} y\,d\ln\dfrac{5+3\tan y}{1-\tan y}\\ & = \dfrac{\pi\ln3}8 + \dfrac y4\,\ln\dfrac{5+3\tan y}{1-\tan y} \Bigg|_{\large-\frac\pi4}^{\large\arctan \frac13} - \dfrac14\int\limits_{\large-\frac\pi4}^{\large\arctan \frac13} \ln\dfrac{5+3\tan y}{1-\tan y}\,dy\\ & = \dfrac{\pi\ln3}8 + \dfrac{\dfrac\pi2-\arctan3}2\ \ln3 - \dfrac{\dfrac\pi2-\arctan3+\dfrac\pi4}4\ \ln5 - \dfrac14\int\limits_{\large-\frac\pi4}^{\large\arctan \frac13} \ln\dfrac{1+\dfrac35\tan y}{1-\tan y}\,dy,\\ \end{align} $$I(1) = \dfrac{3\pi - 4\arctan3}{16}\ \ln\dfrac95 - \dfrac14 J(p,y)\Bigg|_{\large y=-\frac\pi4}^{\large\arctan \frac13} \Bigg|_{\large p=-1}^{\large\frac35},\tag1$$

where $$J(p,y) = \int\,\ln(1+p\tan y)\,dy,\tag2$$ $$|p|\le 1,\quad |\tan y| \le1,\tag3$$

\begin{align} &J(p,y) = \dfrac i2 \left(\operatorname{Li}_2\left(\dfrac{1+p\tan y}{1-ip}\right) - \operatorname{Li}_2\left(\dfrac{1+p\tan y}{1+ip}\right)\right)\\ & + \dfrac i2\left(\ln\dfrac{1-i\tan y}{-1+ip}-\ln\dfrac{1+i\tan y}{-1-ip}\right) \ln(1+p\tan y) + \mathrm{constant} \end{align} (see also Wolfram Alpha),

$$\ \operatorname {Li}_2(z) = \sum\limits_{j=1}^\infty\dfrac{z^j}{j^2}\tag{Q4}$$

is the polylogarithm.

Is known that

$$\ln a = \ln|a| + i\arg a.\tag{Q5}$$

Taking in account conditions $$(3),$$ one can get \begin{align} &\dfrac i2\left(\ln\dfrac{1-i\tan y}{-1+ip} - \ln\dfrac{1+i\tan y}{-1-ip}\right) = \dfrac i2\left(\ln\dfrac{1-i\tan y}{1+i\tan y} + \ln\dfrac{1+ip}{1-ip}\right)\\ & = \dfrac i2\left(-2iy + 2i\arctan p\right) = y - \arctan p. \end{align}

Therefore, under the conditions $$(3)$$ can be used expression in the form of $$J(p,y) = \dfrac i2 \left(\operatorname{Li}_2\left(\dfrac{1+p\tan y}{1-ip}\right) - \operatorname{Li}_2\left(\dfrac{1+p\tan y}{1+ip}\right)\right) + \left(y-\arctan p\right)\ \ln(1+p\tan y).\tag4$$

From $$(1),(4),(Q1)$$ should $$I(1) = \dfrac{3\pi - 4\arctan3}{16}\ \ln\dfrac95 - \dfrac14 F(p,t)\Bigg|_{t=-1}\phantom{|\hspace{-38mu}}^{\large\frac13} \Bigg|_{p=-1}\phantom{|\hspace{-38mu}}^{\large\frac35},\tag5$$

where $$F(p,t) = \dfrac i2 \left(\operatorname{Li}_2\left(\dfrac{1+pt}{1-ip}\right) - \operatorname{Li}_2\left(\dfrac{1+pt}{1+ip}\right)\right) + \arctan\dfrac{t-p}{1+pt}\ \ln(1+pt).\tag6$$

Finally, $$\color{brown}{\boxed{\phantom{\bigg|\!}I_1\approx0.27442\,80145\,78530\ }}$$ (see also Wolfram Alpha calculations of constant and the final checking).

Numeric calculations give the same result.

Hint

Try$${x\over (1+4x)(1+a^2x^2)}={{-{4\over a^2+16}\over 1+4x}}+{{a^2x+4\over a^2+16}\over 1+a^2x^2}={1\over a^2+16}\left({{-{4}\over 1+4x}}+{{a^2x+4}\over 1+a^2x^2}\right)$$

• Yep, but integrating $I'(a)$ back with respect to $a$ looks hopeless. Commented May 22, 2019 at 16:45

When I tried to simplify result, I found more elegant way to compute this integral. We now that $$\Im Log z= \phi=\arctan(\Im z/\Re z)$$ Due to this I can rewrite the integral in more simple way $$\int^{2}_{0}\frac{\tan^{-1}(x)}{1+4x}\mathrm dx=\Im \int^{2}_{0}\frac{\log(1+ix)}{1+4x}\mathrm dx$$ It can be rewrite through logarith and dilogarithm by linear changing variable https://en.wikipedia.org/wiki/Spence%27s_function $$I=\frac{\Im}{4} \left(-\text{Li}_2\left(\frac{16}{17}+\frac{4 i}{17}\right)+\text{Li}_2\left(\frac{8}{17}+\frac{36 i}{17}\right)+\log \left(\frac{9}{17}-\frac{36 i}{17}\right) \log (1+2 i)\right)$$

I am not a specialist in the polylogarithm, probably the imaginary parts of polilogarithm can be simplified.

The result for with additional parameter $$\frac{\Im}{4} \left(\text{Li}_2\left(\frac{4 i-8 a}{a+4 i}\right)-\text{Li}_2\left(\frac{4 i}{a+4 i}\right)+\log \left(\frac{9 a}{a+4 i}\right) \log (1+2 i a)\right)$$

Firstly, do the integration by parts and and decompose a denominator \begin{align*} & \int_0^2 \frac{\tan^{-1} (a x)}{1+4x} dx \\ = &\ \dfrac{\log 3 \tan^{-1} (2a)}{2}-\frac{a}{4}\int_0^2 \frac{\log(1+4x)}{1+a^2x^2} dx\\ = &\ \dfrac{\log 3 \tan^{-1} (2a)}{2}-\frac{a}{8}\int_0^2 \log(1+4x)(\frac{1}{1+iax}+\frac{1}{1-iax}) dx \end{align*} The obtained integrals can be rewrote through the dilogarithm $$\text{Li}_2$$ functions. The result have the following form

\begin{align*} I(a)&= \dfrac{\log 3 \tan^{-1} (2a)}{2}+\frac{i}{8}\left(\text{Li}_2\left(\frac{a}{a-4 i}\right)-\text{Li}_2\left(\frac{9 a}{a-4 i}\right)-\text{Li}_2\left(\frac{a}{a+4 i}\right) \\ + \text{Li}_2\left(\frac{9 a}{a+4 i}\right)-\log (9) \log \left(\frac{8 a+4 i}{-a+4 i}\right)+ \log (9) \log \left(\frac{-8 a+4 i}{a+4 i}\right)\right) \end{align*} I think this answer can be simplified, but I do not want to do it.

• More suitable looks the common form of $\int_0^b \dfrac{\arctan x\,dx}{1+ax}$ Commented May 27, 2019 at 10:43

To calculate by series or to try to get a "closed form" ?

I think the best is to use here the following formula:

$$\int\frac{\ln(x+z)}{x-a}\,dx = \text{Li}_2\left(\frac{x+z}{a+z}\right) - \ln(x+z)~\text{Li}_1\left(\frac{x+z}{a+z}\right) + C$$

It’s $$~\displaystyle\tan x = \Im\ln(1+ix) = \frac{\pi}{2} + \Im\ln(x-i)~$$ and we can set $$~\displaystyle(a,z):=(-\frac{1}{4},-i)~$$ .

Then we get:

$$\displaystyle \int\limits_0^2\frac{\arctan x}{1+4x}\,dx = \frac{\pi}{2}\int\limits_0^2\frac{dx}{1+4x} + \frac{1}{4}\Im\int\limits_0^2\frac{\ln(x-i)}{x-\left(-\frac{1}{4}\right)}\,dx$$

$$\displaystyle =\frac{\pi}{4}\ln 3 + \frac{1}{4}\Im\left(\text{Li}_2\left(\frac{8+i36}{17}\right) - \ln(2-i)~\text{Li}_1\left(\frac{8+i36}{17}\right) \right)$$

$$\displaystyle\hspace{1.8cm} - \frac{1}{4}\Im\left( \text{Li}_2\left(\frac{16+i4}{17}\right) - \ln(-i)~\text{Li}_1\left(\frac{16+i4}{17}\right) \right)$$

Separation of real part and imaginary part:

$$\displaystyle \ln(2-i) = \frac{\ln 5}{2} - i\arctan\frac{1}{2} \enspace , \enspace\enspace \ln(-i) = -i\frac{\pi}{2}$$

$$\displaystyle \text{Li}_1\left(\frac{8+i36}{17}\right) = -\frac{1}{2}\ln\frac{81}{17} + i\arctan 4 \enspace , \enspace\enspace \text{Li}_1\left(\frac{16+i4}{17}\right) = \frac{1}{2}\ln 17 + i\arctan 4$$

Note: $$\enspace$$ For calculations with $$~x>0~$$ we can use $$\displaystyle ~~\arctan x = \frac{\pi}{2} - \arctan\frac{1}{x}~$$ .

$$\displaystyle A:=\Im\text{Li}_2\left(\frac{16+i4}{17}\right) = \Im\text{Li}_2\left(\frac{\sqrt{272}}{17}e^{i\arctan\frac{1}{4}}\right)=\sum\limits_{k=1}^\infty\frac{\sin\left(k\arctan\frac{1}{4}\right)}{k^2}\left(\frac{\sqrt{272}}{17}\right)^k$$

Using $$~\displaystyle \text{Li}_2(z) = -\text{Li}_2\left(\frac{1}{z}\right) -\frac{\pi^2}{6}-\frac{1}{2}\ln^2(-z)~$$ we get:

$$\displaystyle \Im\text{Li}_2\left(\frac{8+i36}{17}\right) = \Im\text{Li}_2\left(\frac{\sqrt{1360}}{17}e^{i\arctan\frac{9}{2}}\right) = B - \left(\ln\frac{\sqrt{1360}}{17}\right)\left(-\pi + \arctan\frac{9}{2}\right)$$

with $$\enspace \displaystyle B := \sum\limits_{k=1}^\infty\frac{\sin\left(k\arctan\frac{9}{2}\right)}{k^2}\left(\frac{17}{\sqrt{1360}}\right)^k$$

$$\displaystyle R := \pi\ln\frac{36}{17} + \left(\ln\frac{85}{81}\right)\left(\arctan\frac{1}{4}\right) + \left(\ln\frac{80}{81}\right)\left(\arctan\frac{2}{9}\right)$$

$$A\approx 0.54772569304105608037669001217295320069571309$$

$$B\approx 0.46231444614312936610749685795341278946044980$$

$$R\approx 2.36624661042409606268346795278249163083184498$$

$$\displaystyle \int\limits_0^2\frac{\arctan x}{1+4x}\,dx = \frac{R}{8} + \frac{B-A}{4} \approx 0.2744280145785303292681352055429263510451648$$

$$\def\B{\mathrm{B}}$$Here we find the value of the integral as an explicitly real sum with good convergence properties, equation (1) below.

Let $$x=1+t$$ so $$I = \frac{1}{5} \int_{-1}^1 \frac{\arctan(1+t)}{1+\frac{4}{5}t}dt.$$ But $$\frac{1}{1+\frac 4 5 t} = \sum_{k=0}^\infty a_k t^k \quad\textrm{and}\quad \arctan(1+t) = \sum_{k=0}^\infty b_k t^k,$$ where $$a_k = (-4/5)^k,\, b_0 = \frac \pi 4, \textrm{ and } b_k = (-1)^{k+1}\frac{\sin(k\pi/4)}{k2^{k/2}} \textrm{ for }k\geq 1.$$ Thus, \begin{align*} I &= \frac{1}{5} \int_{-1}^1 \sum_{k=0}^\infty c_k t^k dt = \frac{2}{5}\sum_{k=0}^\infty \frac{c_{2k}}{2k+1}, \end{align*} where $$c_k = \sum_{j=0}^k a_{k-j} b_j$$ is the Cauchy product of $$a_k$$ and $$b_k$$. This can be rewritten as \begin{align*} I &= \frac \pi 8 \log 3 - \frac 2 5 \sum_{k=1}^\infty \sum_{j=1}^{2k} \frac 1 {2k+1} \left(\frac 4 5\right)^{2k-j} \frac{\sin(j\pi/4)}{j 2^{j/2}} \\ &= \frac \pi 8 \log 3 - \frac 2 5 \sum_{j=1}^\infty \sum_{k=\lceil j/2\rceil}^{\infty} \frac 1 {2k+1} \left(\frac 4 5\right)^{2k-j} \frac{\sin(j\pi/4)}{j 2^{j/2}} \\ &= \frac \pi 8 \log 3 - \frac 1 4 \sum_{j=1}^\infty \underbrace{\left(\frac 5 4\right)^{j} \frac{\sin(j\pi/4)}{j 2^{j/2}} \B({16}/{25};{1}/{2}+\lceil{j}/{2}\rceil,0)}_{d_j}, \end{align*} where $$\B(x;a,b) = \int_0^x t^{a-1}(1-t)^{b-1}dt$$ is the incomplete beta function. We then write the sum in the following way, $$\sum_{j=1}^\infty d_j = \sum_{n=0}^\infty (d_{4n+1}+d_{4n+2}+d_{4n+3}+d_{4n+4}).$$ Note that $$d_{4n+4}=0$$. By exploiting the properties of the incomplete beta function $$d_{4n+1}+d_{4n+2}+d_{4n+3}$$ may be combined. In particular we use that $$\B(x;a+1,b) = \B(x;a,b) - \frac{x^a(1-x)^b}{a}.$$ After some manipulation we find \begin{align*} I &= \frac \pi 8 \log 3 + \frac{1}{128}\Phi(-1/4,2,3/4) \\ & \quad - \frac{5}{1024}\sum_{n=0}^\infty (-1)^n \left(\frac{25}{32}\right)^{2n} \frac{776n^2+790n+181}{(2n+1)(4n+1)(4n+3)} \\ &\hspace{15ex}\times\B(16/25;2n+3/2,0),\tag{1} \end{align*} where $$\Phi(z,s,\alpha) = \sum_{n=0}^\infty {z^n}/{(n+\alpha)^s}$$ is the Lerch transcendant. (Note that $$\Phi(-1/4,2,3/4)\approx 1.703446578$$.) We define $$I_N$$ to be given by (1) with the replacement $$\sum_{n=0}^\infty\rightarrow\sum_{n=0}^N$$ and show some of the partial sums to ten decimal places below. $$\begin{array}{l|l} N & I_N \\ \hline 0 & 0.2687920302 \\ 1 & 0.2749812408 \\ 2 & 0.2743541958 \\ 3 & 0.2744394932 \\ 4 & 0.2744260568 \\ 5 & 0.2744283699 \\ 6 & 0.2744279472 \\ 7 & 0.2744280278 \\ 8 & 0.2744280119 \\ 9 & 0.2744280151 \\ 10 & 0.2744280145 \\ 11 & 0.2744280146 \\ 12 & 0.2744280146 \\ \end{array}$$

• Wolfram Alpha can not calculate this sum in the closed form. Besides, this series diverges from $n=80.$ Commented May 28, 2019 at 21:35
• @YuriNegometyanov: I appreciate the close reading. See the claim at the top of the post. The series does not diverge. It is straightforward to show that $\mathrm{B}(16/25;2n+3/2,0)\le (2^7/5)(4/5)^{4n}/(36n+27)$. Commented May 28, 2019 at 22:05

Yes,this integral seems hopeless from the point of view that we could get some simple closed form solution.

As a practical person who has to solve problems in real life where it is necessary to calculate not with great precision I use often the following approach (applied to given issue):

I'm trying to replace the integrand in the integral with a simpler expression so that the latter would differ as little as possible from the value of the original expression.

In this case I will replace $$\arctan x$$ with

$$\frac{\arctan 2}{26}x(23-5x)$$

The maximum deviation of this expression from $$\arctan x$$ in $$[0,2]$$ is less than $$0.03$$

Now, replacing $$\arctan x$$ in the integral with the expression I evaluate the integral and get

$$\frac{\arctan 2}{832}(308-97\ln 3)$$ The absolute error of this result is about $$0.007$$

This is even better result than expected.

Now, noting that $$\arctan 2$$ and $$\ln 3$$ are both very close to $$1$$ I simplify the result to $$\frac{211}{832}$$

The absolute error of this last is still satisfactory from a practical point of view (about $$0.021$$)

In similar manner it is possible quickly estimate many difficult integrals (often easier than numerical integration procedures)