Integration of $\frac{\tan(x)}{\cos(x)}$ Is there a simple way of integrating $\frac{\tan(x)}{\cos(x)}$?
Thanks
 A: Note that $$\dfrac{\tan x}{\cos x} = \dfrac{\sin x}{\cos x} \cdot \dfrac 1{\cos x} = \dfrac {\sin x}{\cos^2 x}$$
Now, what would make a good substitution in the following integral:?
$$\int \left(\frac{\sin(x)}{\cos^2(x)}\right)\,dx$$
Try $u = \cos x \implies du = -\sin x dx$
$$\int \left(\frac{\sin(x)}{\cos^2(x)}\right)\,dx = -\int \dfrac{du}{u^2} = -\int  u^{-2} \,du = \dfrac{1}{u} + C = \dfrac 1{\cos x} + c$$
A: Since $\tan{x}=\frac{\sin{x}}{\cos{x}}$, we have
$$
\int \frac{\tan{x}}{\cos{x}} dx=
\int \frac{\sin{x}}{\cos^2{x}} dx=
\begin{bmatrix}
u=-\cos{x} \\
du=\sin{x}\,dx
\end{bmatrix}=
\int \frac{du}{u^2}=
-\frac{1}{u}+C=\frac{1}{\cos{x}}+C.
$$
A: This is $\tan(x) \sec(x)$ which is the well-known table derivative of $\sec(x)$.
A: Since $\tan\theta = \sin \theta / \cos\theta$ we are really calculating the following integral:
$$\int \frac{\tan \theta}{\cos\theta}d\theta=\int \frac{\sin\theta}{\cos^2\theta} d\theta$$
Now, let $f(x)=-\frac{1}{x^2}$ and $g(x)= \cos x$, so that since $g'(\theta)=-\sin\theta$ then  in truth we have:
$$\int \frac{\tan \theta}{\cos\theta}d\theta = \int f(g(\theta))g'(\theta)d\theta$$
And by the chain rule $f(g(\theta))g'(\theta) = (F(g(\theta))'$ where $F'=f$, in other words, $F$ is a primitive of $f$. This implies directly that $F(g(\theta))$ is a primitive of $f(g(\theta))g'(\theta)$. Now it's simple to see that since we defined $f$ as we did we have:
$$F(x)=\frac{1}{x}$$
So that $F(g(\theta))= 1/\cos \theta$ and so we have:
$$\int \frac{\tan \theta}{\cos \theta}d\theta = \frac{1}{\cos \theta}+C$$
Now you can check directly that taking the derivative of what's on the right gives back where you started.
