# Integrals $\int\limits _{0}^{\pi/4}\frac{dx}{1+\cos^2x},~~\int\limits_{0}^{\pi/4}\frac{1-\cos^2x}{1+\cos^2x}dx$

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.

HINT:

1. Substitute $u=\tan(x)$ and $\text{d}u=\sec^2(x)\space\text{d}x$: $$\int\frac{1}{1+\cos^2(x)}\space\text{d}x=\int\frac{\sec^2(x)}{1+\sec^2(x)}\space\text{d}x=\int\frac{\sec^2(x)}{2+\tan^2(x)}\space\text{d}x=\int\frac{1}{2+u^2}\space\text{d}u$$

2. Substitute $s=\cot(x)$ and $\text{d}s=-\csc^2(x)\space\text{d}x$: $$\int\frac{1-\cos^2(x)}{1+\cos^2(x)}\space\text{d}x=\int\frac{1-\cos^2(x)}{1+\cos^2(x)}\cdot\frac{-\csc^4(x)}{-\csc^4(x)}\space\text{d}x=$$ $$\int\frac{\csc^2(x)}{1+3\cot^2(x)+2\cot^4(x)}\space\text{d}x=\int\frac{1}{1+s^2}\space\text{d}s-2\int\frac{1}{1+2s^2}\space\text{d}s$$

• $$\text{I}_1=\frac{\arctan\left(\frac{1}{\sqrt{2}}\right)}{\sqrt{2}}\approx0.43521$$
• $$\text{I}_2=\sqrt{2}\arctan\left(\frac{1}{\sqrt{2}}\right)-\frac{\pi}{4}\approx0.0850216$$
Hint. One may write $$I_1=\int\limits _{0}^{\pi/4}\frac{dx}{1+\cos^2x}=\int\limits _{0}^{\pi/4}\frac{dx}{\sin^2 x+2\cos^2x}=\int\limits _{0}^{\pi/4}\frac{dx}{\tan^2x+2}\cdot \frac{dx}{\cos^2x}$$ similarly $$I_2=\int\limits _{0}^{\pi/4}\frac{1-\cos^2 x}{1+\cos^2x}\:dx=\int\limits _{0}^{\pi/4}\frac{\tan^2x}{(\tan^2x+1)\cdot(\tan^2x+2)}\cdot \frac{dx}{\cos^2x}.$$
It is quite trivial that $I_2=2I_1-\frac{\pi}{4}$, hence we may just compute $I_1$ through the substitution $x=\arctan(t)$, leading to:
$$I_1 = \int_{0}^{1}\frac{dt}{t^2+1}\cdot\frac{1}{1+\frac{1}{1+t^2}}=\int_{0}^{1}\frac{dt}{2+t^2}=\color{red}{\frac{1}{\sqrt{2}}\arctan\left(\frac{1}{\sqrt{2}}\right)}$$ pretty easily.