Evaluate $$\int_{1/e}^{\tan x}\frac{dt}{1+t^2}+\int_{1/e}^{\cot x}\frac{dt}{t(1+t^2)}$$
Using Leibniz rule $$ \frac{d}{dt}\int_{a(t)}^{b{t}}f(x)dx=f(b(t))\frac{d}{dt}b(t)-f(a(t))\frac{d}{dt}a(t) $$ Using that $$ I=I_1+I_2=\int_{1/e}^{\tan x}\frac{dt}{1+t^2}+\int_{1/e}^{\cot x}\frac{dt}{t(1+t^2)} $$ $$ I^{'}_1(x)=\frac{\sec^2x}{1+\tan^2x}=1\implies I_1(x)=x+C_1\\ I_1(0)=C_1=\Big[\tan^{-1}x\Big]_{1/e}^0=-\tan^{-1}(1/e)\implies \boxed{I_1(x)=x-\tan^{-1}(1/e)} $$ $$ I^{'}_2(x)=\frac{-\csc^2x}{\cot x(1+\cot^2x)}=-\tan x\implies I_2(x)=-\log|\sec x|+C_2=\log|\cos x|+C\\ I_2(\pi/4)=-\log\sqrt{2}+C_2=-\frac{1}{2}\log 2+C_2=\int_{1/e}^{1}\Big[\frac{1}{t}-\frac{t}{1+t^2}\Big]dt=\Big[\log t-\frac{1}{2}\log|1+t^2|\Big]_{1/e}^1\\ -\frac{1}{2}\log 2+C_2=-\frac{1}{2}\log 2+1-\frac{1}{2}\log|1+\frac{1}{e^2}|\\ C_2=1-\frac{1}{2}\log|1+\frac{1}{e^2}| $$ If $1$ is the solution taking the derivating of $I(t)$ is supposed to give zero right, so what is going wrong here ?
Note: The solution given in my reference is $1$