Why is ∫∞0lnx1+x2dx=0\int_{0}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x =0?

We had our final exam yesterday and one of the questions was to find out the value of:

Interestingly enough, using the substitution $x=\frac{1}{t}$ we get – and therefore $\int_{0}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x = 0$

I was curious to know about the theory behind this interesting (surprising even!) example.

Thank you.

When I see an $1 + x^2$ in the denominator it’s tempting to let $\theta = \arctan(x)$ and $d\theta = {1 \over 1 + x^2} dx$. When you do that here the integral becomes
The two terms cancel because $\cos(\theta) = \sin({\pi \over 2} - \theta)$.
Also, if you do enough of these, you learn that doing the change of variables from $x$ to ${1 \over x}$ converts a ${dx \over 1 + x^2}$ into $-{dx \over 1 + x^2}$, so it becomes one of the “tricks of the trade” for integrals with $1 + x^2$ in the denominator. An example: show this trick can be used to show that the following integral is independent of $r$: