TITLE: slightly tricky integral
QUESTION [5 upvotes]: was asked to evaluate  $\displaystyle\int_0^\infty \dfrac{\log(x)}{1+x^2} dx = I$
firstly, I got the solution using the substitution $ t = \dfrac{1}{x} $ and then getting $\displaystyle\int_0^\infty \dfrac{\log(x)}{1+x^2} dx = -\displaystyle\int_0^\infty \dfrac{\log(x)}{1+x^2} dx $ so $I = -I \implies I = 0$ however this substitution was a lucky guess more than anything, so how would I go about it using this way?
let $x = \tan(\theta)$ then this transforms $I $ to $$ \displaystyle \int_0^\frac{\pi}{2} \log(\tan(\theta))\,d\theta = \int_0^\frac{\pi}{2} \log(\sin(\theta))\,d\theta - \int_0^\frac{\pi}{2} \log(\cos(\theta))\,d\theta = $$
$$=\int_0^\frac{\pi}{2} \log(\sin(\theta))\,d\theta - \int_0^\frac{\pi}{2} \log(\sin(\dfrac{\pi}{2} -\theta))\,d\theta$$ 
how would I go from there?

REPLY [3 votes]: Here's a way to do it without trigonometric substitutions.  We do use a simple trigonometric identity: the sum of the arctangents of a positive number and its reciprocal is a right angle.
$$
\begin{align}
\int_{1/A}^A \frac{\log x}{1+x^2} \, dx & = \int_{1/A}^A \underbrace{(\log x)}_{u}\underbrace{\left(\frac{dx}{1+x^2}\right)}_{dv} = uv-\int v\,du \\[10pt]
& = \left[(\log x) (\arctan x) \vphantom{\frac 1 1} \right]_{1/A}^A - \int_{1/A}^A (\arctan x)\left(\frac{dx}{x}\right) \\[10pt]
& = (\log A)\left(\arctan A + \arctan\frac1A\right)-\int_{1/A}^A (\arctan x)\left(\frac{dx}{x}\right) \\[10pt]
& = \frac\pi2\log A - \int_{1/A}^A (\arctan x)\left(\frac{dx}{x}\right) \tag1 \\[10pt]
& = \frac\pi2\log A-\int_{1/A}^A \left( \frac\pi2 - \arctan\frac 1 x \right)\left(\frac{dx}{x}\right) \\[10pt]
& = \frac\pi2\log A + \int_A^{1/A} \left(\frac\pi2 - \arctan u \right)\left(\frac{du}{u}\right) \\[10pt]
& = \frac\pi2\log A-\int_{1/A}^A \left(\frac\pi2 - \arctan u \right)\left(\frac{du}{u}\right) \\[10pt]
& = \frac\pi2\log A-\int_{1/A}^A \left(\frac\pi2 - \arctan x \right)\left(\frac{dx}{x}\right) \\[10pt]
& = -\frac\pi2 \log A + \int_{1/A}^A (\arctan x) \left(\frac{dx}{x}\right) \tag2
\end{align}
$$
So $(1)$ is equal to $(2)$, but their sum is $0$.  Therefore each of them is $0$.  Finally, let $A\to\infty$.