# Using the method of replacing show that ∫tan(x)=dx=In|sec(x)|+constant See correction

To evaluate this integral, it is best to remember that `tanx=sinx/cosx` , which suggests the substitution `u=cosx` .  This means that `du=-sinxdx` , so the integral becomes:

`int tanxdx`

`=int sinx/cosx dx`

`=-int 1/udu`   now integrate using logarithm rule

`=-ln|u|+C`  where C is a constant of integration

`=-ln|cosx|+C`   now switch negative 1 to exponent

`=ln|cosx|^{-1}+C`   use trig definition of `secx` .

`=ln|secx|+C`

The integral evaluates to `ln|secx|+C` .

Approved by eNotes Editorial Team