Evaluate$\int_0^\infty \frac{\log(x)^2}{(1+x)^2}dx$ Trying to evaluate the integral
$$\int_0^\infty \frac{\log(x)^2}{(1+x)^2}dx$$
or equivalently $$\int_{-\infty}^\infty e^x\frac{x^2}{(1+e^x)^2}dx$$
The answer should be $\frac{\pi^2}{3}$
Looks like we can use residue theorem, but the integration path does not seem to be easy to choose

We can compute directly.
$$\int_0^{\infty}\frac{\log^2x}{(1+x)^2}dx = \int_{0}^1
\frac{\log^2x}{(1+x)^2}dx  + \int_1^{\infty}\frac{\log^2x}{(1+x)^2}dx. $$
With a change of variable $t=\frac{1}{x}$ in the second integral we have
$$\int_{1}^{\infty} \frac{\log^2x}{(1+x)^2} dx = \int_0^1\frac{\log^2t}{(1+t)^2}dt.$$
Then we have
$$\int_0^\infty\frac{\log^2x}{(1+x)^2} dx = 2 \int_0^1 \frac{\log^2x}{(1+x)^2} dx$$
and we only need to compute the last integral.
However,
$$\int_0^1 \frac{\log^2x}{(1+x)^2} dx = \int_0^1 \frac{\log^2x}{(1+x)} dx
- \int_0^1 \frac{x\log^2x}{(1+x)^2}dx$$
and a integration by parts gives
$$\int_0^1\frac{x\log^2x}{(1+x)^2} dx= -\int_0^1 x\log^2x d\left(\frac{1}{1+x}\right) = \int_0^1 \frac{\log^2x}{(1+x)} dx + 2\int_0^1\frac{\log x}{1+x}dx.$$
As a result, we have
$$\int_0^1\frac{\log^2x}{(1+x)^2} dx = -2 \int_0^1 \frac{\log x}{1+x}dx
= -2\int_0^1 \log x \sum_{n=0}^\infty (-x)^n dx
=2 \sum_{n=0}^\infty (-1)^n \frac{1}{(n+1)^2} = \frac{\pi^2}{6},$$
where the term by term integration can be justified by the Fubini's theorem.
After all, the  result is $\frac{\pi^2}{3}$.
