Evaluating $\int_0^\infty \frac{\log (1+x)}{1+x^2}dx$ Can this integral be solved with contour integral or by some application of residue theorem?
$$\int_0^\infty \frac{\log (1+x)}{1+x^2}dx = \frac{\pi}{4}\log 2 + \text{Catalan constant}$$
It has two poles at $\pm i$ and  branch point of $-1$ while the integral is to be evaluated from $0\to \infty$. How to get $\text{Catalan Constant}$? Please give some hints.

Letting $x=\tan \theta$ yields
$$\begin{aligned}\int_{0}^{\infty} \frac{\ln (1+x)}{1+x^{2}}dx&=\int_{0}^{\frac{\pi}{2}}[\ln (\cos \theta+\sin \theta) d \theta-\ln (\cos \theta)] d \theta \\&= \underbrace{\int_{0}^{\frac{\pi}{4}}2\ln (\cos \theta+\sin \theta)}_{L} d \theta-\underbrace{\int_{0}^{\frac{\pi}{2}} \ln (\cos \theta) d \theta}_{-\frac{\pi}{2} \ln 2}\end{aligned}$$
For the integral $L$, $$
\begin{aligned}
L &=\int_{0}^{\frac{\pi}{4}} \ln (1+\sin 2 \theta) d \theta \\
&=\frac{1}{2} \int_{0}^{\frac{\pi}{2}} \ln (1+\sin \theta) d \theta\\
&=\frac{1}{2} \int_{0}^{\frac{\pi}{2}} \ln (1+\cos \theta) d \theta \\
&=\frac{1}{2} \int_{0}^{\frac{\pi}{2}} \ln \left(2 \cos ^{2} \frac{\theta}{2}\right) d \theta\\&= \frac{\pi}{4} \ln 2+2 \int_{0}^{\frac{\pi}{4}} \ln (\cos \theta) d \theta\\&= \frac{\pi}{4} \ln 2+2\left(\frac{G}{2}-\frac{\pi}{4} \ln 2\right)\\&= -\frac{\pi}{4} \ln 2+G
\end{aligned}
$$
where the last integral comes from my post and $G$ is the Catalan’s constant.
Now we can conclude that $$
\boxed{\int_{0}^{\infty} \frac{\ln (1+x)}{1+x^{2}}dx= \frac{\pi}{4} \ln 2+G}
$$
