Evaluate the definite integrals:
$$I_1=\int\limits _{0}^{\pi/4}\frac{dx}{1+\cos^2x},~~I_2=\int\limits_{0}^{\pi/4}\frac{1-\cos^2x}{1+\cos^2x}dx.$$
Thanks for the help.
Attempt. The classic substitution $\tan(\frac{x}{2})=t$ yields $$dx=\frac{2dt}{1+t^2},~\cos x=\frac{1-t^2}{1+t^2}$$ and seems to be making the integral more complicated.