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

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)$$


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) $$