Integral of tan(x)

∫tan⁡(x) dx\int \tan\left(x\right)\,dx = −ln⁡∣cos⁡(x)∣+C- \ln\left|\cos{\left(x \right)}\right| + C

Answer

Indefinite integral
−ln⁡∣cos⁡(x)∣+C- \ln\left|\cos{\left(x \right)}\right| + C

Checked numerically before it is shown

Step-by-step solution

  1. Rewrite the integrand

    tan⁡(x)=sin⁡(x)cos⁡(x)\tan{\left(x \right)} = \frac{\sin{\left(x \right)}}{\cos{\left(x \right)}}
  2. Substitution

    Substitute u=cos⁡(x)u = \cos{\left(x \right)}, so du=−sin⁡(x) dxdu = - \sin{\left(x \right)}\,dx.

  3. Change the variable

    Rewrite the integral in the new variable:

    ∫sin⁡(x)cos⁡(x) dx=∫−1u du\int \frac{\sin{\left(x \right)}}{\cos{\left(x \right)}}\,dx = \int - \frac{1}{u}\,du
  4. Constant multiple rule

    Take the constant factor out of the integral:

    ∫−1u du=−∫1u du\int - \frac{1}{u}\,du = -\int \frac{1}{u}\,du
  5. Reciprocal rule

    The integral of 1/u is the natural logarithm:

    ∫1u du=ln⁡∣u∣\int \frac{1}{u}\,du = \ln\left|u\right|
  6. Substitute back

    Substitute back u=cos⁡(x)u = \cos{\left(x \right)}.

  7. Constant of integration

    Add the constant of integration:

    ∫tan⁡(x) dx=−ln⁡∣cos⁡(x)∣+C\int \tan{\left(x \right)}\,dx = - \ln\left|\cos{\left(x \right)}\right| + C

Change the problem in the solver Integral calculator

Related solved examples