# How do you find the antiderivative of int tanx dx?

Oct 10, 2016

$\ln \left\mid \sec \right\mid x + C \text{ }$ or $\text{ } - \ln \left\mid \cos \right\mid x + C$

#### Explanation:

Rewrite $\tan x$ using its form in $\sin x$ and $\cos x$:

$\int \tan x \mathrm{dx} = \int \sin \frac{x}{\cos} x \mathrm{dx}$

Now, we can use the substitution $u = \cos x$. This implies that $\mathrm{du} = - \sin x \mathrm{dx}$.

$\int \sin \frac{x}{\cos} x = - \int \frac{- \sin x}{\cos} x \mathrm{dx} = - \int \frac{\mathrm{du}}{u}$

This is a common and valuable integral to recognize:

$- \int \frac{\mathrm{du}}{u} = - \ln \left\mid u \right\mid + C$

Back-substituting with $u = \cos x$:

$- \ln \left\mid u \right\mid + C = - \ln \left\mid \cos \right\mid x + C$

Note that this can be rewritten using logarithm rules, with the negative on the outside being brought into the logarithm as a $- 1$ power.

$- \ln \left\mid \cos \right\mid x + C = \ln \left\mid {\left(\cos x\right)}^{-} 1 \right\mid + C = \ln \left\mid \sec \right\mid x + C$