Substitution goes wrong while evaluating $\int _0^1\frac{\ln \left(1+x^2\right)}{1+x^2}\:dx$ Im aware this integral has been evaluated here before, i started with
$$\int _0^{\infty}\frac{\ln \left(1+x^2\right)}{1+x^2}\:dx=2\int _0^1\frac{\ln \left(1+x^2\right)}{1+x^2}\:dx+2G$$
Solving the integral on the left is very easy, then solving for the other one gets its value but the main point of my question comes from the substitution $ x=\frac{1-t}{1+t}$
$$I=\int _0^1\frac{\ln \left(1+x^2\right)}{1+x^2}\:dx=\int _0^1\frac{\ln \left(1+t^2\right)}{1+t^2}\:dt+\ln \left(2\right)\int _0^1\frac{1}{1+t^2}\:dt-2\int _0^1\frac{\ln \left(1+t\right)}{1+t^2}\:dt$$
And $I$ cancels out, can anyone tell me whats happening here?

Letting $x=\tan \theta$ yields
$$
\begin{aligned}
\int_0^1 \frac{\ln \left(1+x^2\right)}{1+x^2} d x &=\int_0^{\frac{\pi}{4}} \ln \left(\sec ^2 \theta\right) d \theta \\
&=-2 \int_0^{\frac{\pi}{4}} \ln (\cos \theta) d \theta \\
&=-2\left(-\frac{\pi}{4} \ln 2+\frac{1}{2} G\right) \\
&=\frac{\pi}{2} \ln 2-G
\end{aligned}
$$
By my post, $$\int_0^1 \frac{\ln \left(1+x^2\right)}{1+x^2} d x =\frac{\pi}{2}\ln2-G$$
where $G$ is the Catalan’s constant.
