# Primitive of Tangent Function

## Theorem

$\displaystyle \int \tan x \rd x = -\ln \left \vert {\cos x} \right \vert + C$

where $\cos x \ne 0$.

### Corollary

$\displaystyle \int \tan x \ \mathrm d x = \ln \left \vert {\sec x} \right \vert + C$

where $\sec x$ is defined.

## Proof

 $\displaystyle \int \tan x \rd x$ $=$ $\displaystyle \int \frac {\sin x} {\cos x} \rd x$ Definition of Tangent Function $\displaystyle$ $=$ $\displaystyle -\int \frac {-\sin x} {\cos x} \rd x$ Multiply by $1 = \dfrac {-1}{-1}$ $\displaystyle$ $=$ $\displaystyle -\int \frac {\left({\cos x}\right)'} {\cos x} \rd x$ Derivative of Cosine Function $\displaystyle$ $=$ $\displaystyle -\ln \left \vert {\cos x} \right \vert + C$ Primitive of Function under its Derivative

$\blacksquare$