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

I used $\cos x=\frac{1-v^2}{1+v^2}$ and $dx=\frac{2dv}{1+v^2}$
and got $$2\int \frac{dv}{v^4-v^2+1}=2\int \frac{dv}{(v^2-\frac{1}{2})^2+(\frac{\sqrt{3}}{2})^2}=\frac{4}{\sqrt{3}}arctan(\frac{2v^2-1}{\sqrt{3}})+c$$
How to continue? 

An alternative method:
Multiplying through by $sec^2(x)$:
$$\int \frac{dx}{1+\cos^2x} = \int \frac{sec^2x}{1+sec^2x}dx$$ 
Defining $u = tanx$, $du = sec^2x$ $dx$, and using the identity $1+tan^2x = sec^2x$:
$$\int \frac{sec^2x}{1+sec^2x}dx = \int \frac{1}{u^2+2}du$$ 
The integral is now of the form of a very well-known $\arctan$ integral
