# How to integrate $\int_0^\infty\frac{\log(1+x^2)}{1+x^2}dx$? [duplicate]

I tried substitution $x=\tan u$, then $$\int_0^\infty\frac{\log(1+x^2)}{1+x^2}dx=\int_0^{\pi/2}\log(\sec^2(u))du=2\int_0^{\pi/2}\log(\sec(u))du$$

I was then trying to exploit periodicity of secant, but nothing's coming out.

Edit: Now that I see the duplicate, I don't follow the step in Mr. 007's answer that uses $$I=\int_0^{\pi/2}\ln(\sin(\theta))d\theta=\int_0^{\pi/2}\ln(\sin(2\theta))d\theta?$$

-

## marked as duplicate by Claude Leibovici, Yiorgos S. Smyrlis, J. W. Perry, Daryl, Davide GiraudoFeb 2 at 10:16

This answer is in response to the OP's specific question about the identity $I=\int_0^{\pi/2}\ln(\sin(\theta))d\theta=\int_0^{\pi/2}\ln(\sin(2\theta))d\theta$.
Substitute $\phi=2\theta$ in the integral $\int_0^{\pi/2}\ln{(\sin{(2\theta)})}d\theta$. Then $\theta=\frac{\phi}{2}$ and $d\theta=\frac{1}{2}d\phi$, and the interval of integration goes from $0\leq\theta\leq\frac{\pi}{2}$ to $0\leq\phi=2\theta\leq\pi$. Thus,
$$\int_0^{\pi/2}\ln{(\sin{(2\theta)})}d\theta=\int_0^{\pi}\ln{(\sin{\phi})}\cdot\frac{1}{2}d\phi\\ =\frac12\int_0^{\pi}\ln{(\sin{\phi})}\,d\phi\\ =\frac12\cdot2\int_0^{\pi/2}\ln{(\sin{\phi})}\,d\phi,\,\text{(since the sine function is symmetric about }\pi/2)\\ =\int_0^{\pi/2}\ln{(\sin{\phi})}\,d\phi.$$
Finally, change the dummy variable of integration in the last line from $\phi$ to $\theta$ to get the desired identity.