Why is $\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:
$$\int_{0}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x $$
Interestingly enough, using the substitution $x=\frac{1}{t}$ we get - $$-\int_{0}^{1} \frac {\ln x}{1+x^2} \mathrm{d}x = \int_{1}^{\infty} \frac {\ln x}{1+x^2} \mathrm{d}x $$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
$$\int_0^{\pi \over 2} \ln(\tan(\theta))\,d\theta$$
$$= \int_0^{\pi \over 2} \ln(\sin(\theta))\,d\theta - \int_0^{\pi \over 2} \ln(\cos(\theta))\,d\theta$$
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$:
$$\int_0^{\infty} {dx \over (1 + x^2)(1 + x^r)}$$
You demonstrated yourself why the result is 0 (by making the change $u = \frac{1}{x}$).

I think you can view this it as the same as this integral: $\displaystyle\int_{-\infty}^{\infty}x dx = \displaystyle\lim_{X\rightarrow +\infty} \int_{-X}^X xdx=0 $.

Note that I am not sure that $\int_{-\infty}^{\infty}x dx$ is actually defined, but this also applies to your integral $\displaystyle\int_0^{\infty}\displaystyle\frac{\ln x}{1+x^2}dx$.