Evaluation by methods of complex analysis $\int_{0}^{1} \frac{\ln(x+1)}{x^2+1} \mathrm{dx}$ How would we evaluate the below integral by methods of complex analysis?
$$\int_{0}^{1} \frac{\ln(x+1)}{x^2+1} \mathrm{dx}$$
I asked the question a while ago, but at that time I didn't specify this requirement.
Now, I'm only interested in a complex way. Thanks !!!
Sis.

We have
$$
\int_0^1 \frac{\ln(1+x)}{x^2+1}dx=
\left[\begin{array}{l}
t=\frac{1}{x} \\
dt=-\frac{1}{x^2}dx
\end{array}\right]=\int_1^\infty \frac{\ln(t+1)-\ln{t}}{1+t^2}dt=
\left[\begin{array}{l}
u=t-1 \\
du=dt
\end{array}\right] =
\int_0^\infty \frac{\ln(u+2)-\ln(u+1)}{1+(u+1)^2}du.
$$
I am quite confident that this integral can be handled with a keyhole contour in much a similar way as this integral. If you want me to do more details, just comment, and I will update when I have the time.

EDIT: Continued the argument. Please notify me about misprints or other errors.
I will show how to compute
$$\int_0^\infty \frac{\ln(x+2)}{1+(x+1)^2}dx$$
(the other one is solved analogously).

We now consider the integral
$$\int_C \frac{\log^2(z+2)}{1+(z+1)^2}dz,$$
where $C$ is the keyhole contour above. Note the choice of logarithm! It is imperative that we take $0<\arg{z}<2\pi$ for the logarithms (or $2\pi n<\arg{z}<2\pi (n+1)$ for some $n\in\mathbb{Z}$).
The integrand has poles at $z=-1\pm i$, and by Cauchy's integral formula, we get
$$
\int_C \frac{\log^2(z+2)}{1+(z+1)^2}dz=
\int_C \frac{\log^2(z+2)}{(z+1+i)(z+1-i)}dz=
2\pi i\left(\frac{\log^2(1-i)}{-2i}+
\frac{\log^2(1+i)}{2i}\right)=
\pi(\log^2(1+i)-\log^2(1-i))=
\pi\left(\left(\ln\sqrt{2}+\frac{i\pi}{4}\right)^2-\left(\ln\sqrt{2}+\frac{7i\pi}{4}\right)^2\right)=
\frac{6\pi^3-3i\pi^2\ln{2}}{2}
.$$
The integral along $\gamma$ goes to zero as the inner radius goes to zero, and the integral along $\Gamma$ goes to zeros as $R\rightarrow\infty$ (this can be shown using the ML-inequality).
Therefore, in the limit we only get contributions from the straight parts, so
$$
\int_0^R\frac{\log^2(x+i\varepsilon+1)}{(1+x+i\varepsilon)^2+1}dx+
\int_R^0\frac{\log^2(x-i\varepsilon+1)}{(1+x-i\varepsilon)^2+1}dx\rightarrow \frac{6\pi^3-3i\pi^2\ln{2}}{2}.
$$
But we also have
$$
\int_0^R\frac{\log^2(x+i\varepsilon+2)}{(1+x+i\varepsilon)^2+1}dx+
\int_R^0\frac{\log^2(x-i\varepsilon+2)}{(1+x-i\varepsilon)^2+1}dx\rightarrow
\int_0^\infty\frac{\ln^2(x+2)-\left(\ln(x+2)+2i\pi\right)^2}{(1+x)^2+1}dx=
\int_0^\infty\frac{4\pi^2-4i\pi\ln(x+2)}{(1+x)^2+1}dx,
$$
so
$$\int_0^\infty\frac{4\pi^2-4i\pi\ln(x+2)}{(1+x)^2+1}dx=\frac{6\pi^3-3i\pi^2\ln{2}}{2}.$$
By considering the imaginary part, we get that
$$\int_0^\infty \frac{\ln(x+2)}{(x+1)^2+1}dx=\frac{3\pi\ln{2}}{8}.$$
It is possible to compute
$$\int_0^\infty \frac{\ln(x+1)}{(x+1)^2+1}dx$$
analogously, and then take the difference in order to find the value of the original integral.
