<s>[INST] how to calculate $\int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{dx}{1+\cos^2x}$? $$
\int_{\frac{\pi}{4}}^{\frac{3\pi}{4}}{\frac{1}{1+\cos ^2x}\rm{dx}}=\int_{\frac{\pi}{4}}^{\frac{\pi}{2}}{\frac{1}{1+\cos ^2x}\rm{dx}+\int_{\frac{\pi }{2}}^{\frac{3\pi}{4}}{\frac{1}{1+\cos ^2x}\rm{dx}}}
$$
I want to split this integral,$
\int_{\frac{\pi }{4}}^{\frac{3\pi }{4}}{\frac{1}{1+\cos ^2x}\rm{dx}}
$
 but I don't know how to calculate the two integrals after splitting?
 [/INST] A possible, maybe more convenient way is as follows:


*

*First shift the integral using $x=\frac{\pi}{2} + u$:
$$\int_{\frac{\pi}{4}}^{\frac{3\pi}{4}} \frac{dx}{1+\cos^2x}= \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}}\frac{du}{1+\sin^2u}= 2\int_{0}^{\frac{\pi}{4}}\frac{du}{1+\sin^2u}$$

*Now, use $t=\tan u$ and note that $\sin^2u = \frac{t^2}{1+t^2}$:


$$2\int_{0}^{\frac{\pi}{4}}\frac{du}{1+\sin^2u}=2\int_{0}^{1}\frac{dt}{1+2t^2}= \sqrt 2\arctan(\sqrt 2)$$
</s>