Integral of $1/\cos^2 x$
Usually, I say to students that
$\int \frac {1}{\cos^2 x}\,dx=\int \sec^2 x=\tan x +c$
based directly on the list of immediate integrals. The other day a student asked me if we can evaluate the integral using a method like integration by substitution or integration by parts. The only 'solution' I found uses the differentiation of quotient working backwards. I.e.
\begin{align*} \int\frac {1}{\cos^2 x}\,dx&=\int\frac {\cos^2 x+\sin^2 x}{\cos^2 x}\,dx=\int\left (\frac{\sin x}{\cos x}\right)'\,dx=\tan x+c \end{align*}
I'm wondering if there is a more elegant solution.
Solution 1:
From the identity
$$\sec^2(x)=\tan^2(x)+1$$ you can attempt the change of variable $u=\tan(x)$ or $x=\arctan(u)$. This turns the integral to
$$\int\frac{u^2+1}{u^2+1}du.$$