How to evaluate $\int_{-\infty}^{\infty}\frac{x\arctan\frac1x\ \log(1+x^2)}{1+x^2}dx$ While browsing similar questions on this site I came up with the following integral because I thought I could evaluate it.
$$I=\int_{-\infty}^{\infty}\frac{x\arctan x\ \log(1+x^2)}{1+x^2}dx$$
I've been able to simplify it a bit. We first notice that
$$I=\int_0^{\infty}\frac{\arctan x\ \log(1+x^2)}{1+x^2}2xdx$$
The substitution $u=x^2+1$ gives
$$I=\int_1^{\infty}\arctan\sqrt{u-1}\ \log u\ \frac{du}u$$
Then $w=\log u$ gives
$$I=\int_{0}^{\infty}\arctan\sqrt{e^w-1}\ dw$$
Which I do not know how to proceed with.
Another approach I tried was this. Starting with the original integral,
$x=\tan u$: $$I=2\int_0^{\pi/2}u\tan u\log\sec^2u\ du$$
Which I also do not know how to do. Please help me proceed or give me a value of the integral (and show how you got it).
If no closed form exists (AKA you have an answer in terms of a series or special function), I'm fine with that.
cheers!
Edit: In the comments it is discussed that the integral is not integrable over the positive reals, but the following related integral is:
$$J=\int_0^{\infty}\frac{\log(1+x^2)\arctan\frac1x}{1+x^2}xdx$$
So. How do we find the value for $J$?
 A: Integration by parts reduces the original problem to the evaluation of 
$$ \int_{0}^{+\infty}\frac{\log^2(1+x^2)}{1+x^2}\,dx $$
which is pretty straightforward: since
$$ \int_{0}^{+\infty}(1+x^2)^{s-1}\,dx =\frac{\Gamma\left(\frac{1}{2}\right)\Gamma\left(\frac{1}{2}-s\right)}{\Gamma(1-s)}$$
by applying $\frac{d^2}{ds^2}$ to both sides, then considering $\lim_{s\to 0^+}$, we get:
$$ \int_{0}^{+\infty}\frac{\log^2(1+x^2)}{1+x^2}\,dx =\frac{\pi^3}{6}+2\pi\log^2(2).$$
You may find another example of this technique at page 81 of my notes.
A: Let $g(x)$ be $2x\ln(1 + x^{2})$
Let $f(x)$ be $\arctan(x)$
$2I = \int g(x)f(x)f'(x)dx$
Note that:

*

*$f'(x) = \frac{1}{1+x^{2}}$

*Let $u = f(x)$. Then, $F(x) = \int f(x)f'(x)dx = \int u du = \frac{1}{2}f(x)^{2}$

*Let $v = 1 + x^{2}$. Then, $G(x) = \int \ln(v)dv = v[\ln(v) - 1] = (1 + x^{2})[\ln(1 + x^{2}) - 1] $
$\color{red}{2I = f(x)G(x) - \int f'(x)G(x)dx}$
$ = f(x)G(x) - \int (1 + x^{2})[\ln(1 + x^{2}) - 1] \frac{1}{1+x^{2}} dx$
$ = f(x)G(x) - \int \ln(1+x^{2}) - 1 dx$
$ = f(x)G(x) + x - \int \ln(1+x^{2}) dx$
Let $a(x) = x$ and $b(x) = \ln(1+x^{2})$
$ \int 1 \cdot \ln(1+x^{2}) dx $
$ = \int b(x) a'(x) dx  = a(x)b(x) - \int a(x)b'(x) dx$
$ \int a(x)b'(x) dx = \int x \frac{2x}{1 + x^{2}} dx $
$ = 2\int \frac{x^{2}}{1 + x^{2}} dx $
$ = 2(x - \arctan(x)) $
A: \begin{align*}
I(a,b)&=\int_{0}^{+\infty}\frac{x\ln\left(1+b^{2}x^{2}\right)\arctan\left(bx\right)}{a^{4}+x^{4}}\,\mathrm{d}x\\
&=\Im\left[\int_{0}^{+\infty}\frac{z\ln^2(1+ibx)}{a^{4}+x^{4}}\,\mathrm{d}x\right]
\end{align*}
Now the residue theorem give
$$\color{red}{\frac{\pi}{2a^{2}}\ln\left(1+\sqrt{2}ab+a^{2}b^{2}\right)\arctan\left(\frac{ab}{\sqrt{2}+ab}\right)\,}$$
How about below integral?
$$\int_{0}^{+\infty}\frac{x\ln\left(1+b^{2}x^{2}\right)\arctan\left(cx\right)}{a^{4}+x^{4}}\,\mathrm{d}x$$
A: We may also try attacking the third integral in line $(3)$ in my first answer,
$$L = \int_0^1 \frac{\log^2(1+x)+\log^2(1-x)}{\sqrt{1-x^2}} \, dx$$
by exploiting the generating function of $\dfrac{H_{2k-1}}k$, with $H_k$ the $k^{\rm th}$ harmonic number. Using the Cauchy product, we find
$$-\log(1\pm x) = \sum_{n=1}^\infty \frac{(\pm x)^n}n \\ \implies \log^2(1\pm x) = \sum_{n=2}^\infty \sum_{m=1}^{n-1} \frac{x^n}{m(n-m)} = \sum_{n=2}^\infty \frac{2 H_{n-1}}n (\pm x)^n \\ \implies \log^2(1+x) + \log^2(1-x) = \sum_{n=2}^\infty \frac{2H_{n-1}}{n} \left(1+(-1)^n\right) (\pm x)^n = \sum_{n=1}^\infty \frac{H_{2n-1}}{n} x^{2n}$$
Multiply by $\frac1{\sqrt{1-x^2}}$ and integrate to recover an Euler sum:
$$\begin{align*}
L &= \sum_{n=1}^\infty \frac{H_{2n-1}}{n} \int_0^1 \frac{x^{2n}}{\sqrt{1-x^2}} \, dx \\[1ex]
&= \frac12 \sum_{n=1}^\infty \frac{H_{2n-1}}{n} \int_0^1 x^{n-\frac12} (1-x)^{-\frac12} \, dx \\[1ex]
&= \frac12 \sum_{n=1}^\infty \frac{H_{2n-1}}{n} \operatorname{B}\left(n+\frac12,\frac12\right) \\[1ex]
&= \frac12 \sum_{n=1}^\infty \frac{H_{2n-1}}{n\cdot4^n} \binom{2n}n
\end{align*}$$
where in the second line, we substitute $x\mapsto\sqrt x$. Now we can use
$$\sum_{n=1}^\infty \frac{H_n}{n\cdot4^n} \binom{2n}n = \frac{\pi^2}3$$
(see the proof following equation $(20)$) together with
$$H_{2n-1} = \frac12 \left(H_n + H_{n-\frac12}\right) + \log(2)$$
to determine $\displaystyle L=\frac{\pi^3}3+\pi\log^2(2)$.
