Daniel's approach probably works equally well; here's another approach:
\frac{1}{1+\cos^{2}x}=\frac{1}{\cos^{2}x}\frac{1}{1+\frac{1}{\cos^{2}x}}=(\frac{d}{dx}tan(x))\frac{1}{2+\tan^{2}x}
Thus, setting u=tan(x), we have \frac{du}{dx}dx=du, that is:
\int\frac{dx}{1+\cos^{2}x}=\int\frac{du}{2+u^{2}}