<s>[INST] Indefinite Integral $\int\frac{1}{1+\tan^{-1}x}\,\text{d}x$ I tried to solve this indefinite integral, $$\int\frac{1}{1+\tan^{-1}x}\,\text{d}x.$$
I tried taking the change of variable $u=\tan^{-1}x$ but failed to reach a solution.
Can anyone help me?
Thanks in advance.
 [/INST] Let $u=\tan^{-1}x$ ,
Then $x=\tan u$
$\therefore\int\dfrac{1}{1+\tan^{-1}x}~dx$
$=\int\dfrac{d(\tan u)}{u+1}$
$=\dfrac{\tan u}{u+1}-\int\tan u~d\left(\dfrac{1}{u+1}\right)$
$=\dfrac{\tan u}{u+1}+\int\dfrac{\tan u}{(u+1)^2}~du$
$=\dfrac{\tan u}{u+1}+\int\sum\limits_{n=0}^\infty\dfrac{8u}{((2n+1)^2\pi^2-4u^2)(u+1)^2}~du$ (use Mittag-Leffler Expansion of tangent)
$=\dfrac{\tan u}{u+1}-\int\sum\limits_{n=0}^\infty\dfrac{8}{((2n+1)\pi-2)^2((2n+1)\pi+2u)}~du+\int\sum\limits_{n=0}^\infty\dfrac{8}{((2n+1)\pi+2)^2((2n+1)\pi-2u)}~du+\int\sum\limits_{n=0}^\infty\dfrac{8((2n+1)^2\pi^2+4)}{((2n+1)^2\pi^2-4)^2(u+1)}~du-\int\sum\limits_{n=0}^\infty\dfrac{8}{((2n+1)^2\pi^2-4)(u+1)^2}~du$
$=\dfrac{\tan u}{u+1}-\sum\limits_{n=0}^\infty\dfrac{4\ln((2n+1)\pi+2u)}{((2n+1)\pi-2)^2}-\sum\limits_{n=0}^\infty\dfrac{4\ln((2n+1)\pi-2u)}{((2n+1)\pi+2)^2}+\sum\limits_{n=0}^\infty\dfrac{8((2n+1)^2\pi^2+4)\ln(u+1)}{((2n+1)^2\pi^2-4)^2}+\sum\limits_{n=0}^\infty\dfrac{8}{((2n+1)^2\pi^2-4)(u+1)}+C$
$=\sec^21\ln(\tan^{-1}x+1)+\dfrac{x+\tan1}{\tan^{-1}x+1}-\sum\limits_{n=0}^\infty\dfrac{4\ln((2n+1)\pi+2\tan^{-1}x)}{((2n+1)\pi-2)^2}-\sum\limits_{n=0}^\infty\dfrac{4\ln((2n+1)\pi-2\tan^{-1}x)}{((2n+1)\pi+2)^2}+C$
Check by Wolfram Alpha https://www.wolframalpha.com/input/?i=sum+ln%28%282n%2B1%29pi%2Ba%29%2F%28%282n%2B1%29pi-2%29%5E2%2Cn%3D0+to+inf and https://www.wolframalpha.com/input/?i=sum+ln%28%282n%2B1%29pi-a%29%2F%28%282n%2B1%29pi%2B2%29%5E2%2Cn%3D0+to+inf, the two infinite series converges.
</s>