# Evaluate $\int \frac{\mathrm dx}{1+\cos^2 x}$

$$\int \frac{1}{1+\cos ^2x} \,\mathrm dx$$

I have to integrate the expression above: I tried with substitutions $\cos x=t$ and $1+(\cos x)^2=t$, but those didn't work, and I couldn't find any useful way to use bisection and duplication formulas.

Any ideas?

$$\int\frac{\mathrm dx}{1+\cos ^2x}=\int\frac{\sec^2x\,\mathrm dx}{\sec^2x+1}=\int\frac{\sec^2x\,\mathrm dx}{2+\tan^2x}$$
And then $$\tan x=t\iff \sec^2x\,\mathrm dx=\mathrm dt$$
Maybe my soliution will be helful too.$$\int \frac{dx}{1+cos^2x} = \int \frac{dx}{cos^2x(\frac{1}{cos^2x}+1)} = [\frac{1}{cos^2x}dx=d(tgx)]= \int \frac{d(tgx)}{1+tg^2x+1} = \int \frac{d(tgx)}{tg^2x+2} = \frac{1}{\sqrt2}arctg(\frac{tgx}{\sqrt2})+C$$ Also we here remember trigonometry formula $\frac{1}{cos^2x}=1+tg^2x$.