How to evaluate $\int_0^1 \frac{\ln(x+1)}{x^2+1} dx$ This problem appears at the end of Trig substitution section of Calculus by Larson. I tried using trig substitution but it was a bootless attempt
$$\int_0^1  \frac{\ln(x+1)}{x^2+1} dx$$

First make the substitution $x=\tan t$ to find
$$I=\int_0^1 dx\,\frac{\ln(x+1)}{x^2+1}=\int_0^{\pi/4} dt\,\ln(1+\tan t).$$
Now a substitution $u=\frac{\pi}{4}-t$ gives that
$$I=\int_0^{\pi/4} du\,\ln\left(\frac{2\cos u}{\cos u+\sin u}\right).$$
If you add these, you get
$$2I=\int_0^{\pi/4} dt\,\ln\left(\frac{\sin t+\cos t}{\cos t}\cdot\frac{2\cos t}{\cos t+\sin t}\right)=\frac{\pi}{4}\ln 2.$$
