Integrate $\dfrac{\tan{3x}}{\cos{3x}}\mathrm{d}x$ $$\int\dfrac{\tan3x}{\cos3x}$$
Doesn't this simplify to $\int\sin{3x}\mathrm{d}x$? $\tan$ is $\sin/\cos$ so the $\cos$ cancels?.. That can't be it though, the answer is $\dfrac{1}{3}\sec{3x}+C$
What's the first step here then?
 A: $$\dfrac{\tan3x}{\cos3x}=\dfrac{\sin3x}{(\cos3x)^2}=-\dfrac{(\cos3x)'}{3(\cos3x)^2}$$
A: $$\int\frac{\tan(3x)}{\cos(3x)}dx \equiv \int\frac{\sin(3x)}{\cos(3x)} \cdot \frac{1}{\cos(3x)} dx$$
Now let $u=\cos(3x) \implies \frac{du}{dx}=-3\sin(3x) \iff -\frac{1}{3}du=\sin(3x) dx$.
So we end up with $\int -\frac{1}{3}u^{-2}du$, which you can then integrate.
A: You're are right:
$$\int\dfrac{\tan{3x}}{\cos{3x}}\mathrm{d}x = \int\dfrac{\sin{3x}}{\cos^2{3x}}\mathrm{d}x$$
Hint:

 $\dfrac{\mathrm{d}}{\mathrm{d}x}\cos{x} = -\sin{x}$

Solution:

 $$-\dfrac{1}{3}\int\dfrac{1}{\cos^2{3x}}\mathrm{d}\cos{3x} = -\dfrac{1}{3}\int\dfrac{1}{u^2}\mathrm{d}u = \dfrac{1}{3}\dfrac{1}{u} + C = \left|\dfrac{1}{\cos{x}} = \sec{x}\right| = \dfrac{1}{3}\sec{3x} + C$$

A: Perhaps another method is to realise that the original integral can be rewritten as:
$$\int\sec(3x)tan(3x)dx \qquad\qquad (1)$$
We can factor $\frac{1}{3}$ out of the integral in (1) to get:
$$\frac{1}{3}\int3sec(3x)tan(3x)dx$$
This is a standard integral. If you differentiate $\,$ $sec(3x)$ $\,$ you get $\,$ $3sec(3x)tan(3x)$, so if we integrate $\,$ $3sec(3x)tan(3x)$ $\,$ we get back to where we started: $sec(3x) + c$. Using this knowledge should lead directly to the given answer.
