Integral of tan(x)\tan{\left(x \right)}

The calculator will find the integral/antiderivative of tan(x)\tan{\left(x \right)}, with steps shown.

Related calculator: Definite and Improper Integral Calculator

Please write without any differentials such as dxdx, dydy etc.
Leave empty for autodetection.

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please contact us.

Your Input

Find tan(x)dx\int \tan{\left(x \right)}\, dx.

Solution

Rewrite the tangent as tan(x)=sin(x)cos(x)\tan\left(x\right)=\frac{\sin\left(x\right)}{\cos\left(x\right)}:

tan(x)dx=sin(x)cos(x)dx{\color{red}{\int{\tan{\left(x \right)} d x}}} = {\color{red}{\int{\frac{\sin{\left(x \right)}}{\cos{\left(x \right)}} d x}}}

Let u=cos(x)u=\cos{\left(x \right)}.

Then du=(cos(x))dx=sin(x)dxdu=\left(\cos{\left(x \right)}\right)^{\prime }dx = - \sin{\left(x \right)} dx (steps can be seen »), and we have that sin(x)dx=du\sin{\left(x \right)} dx = - du.

Therefore,

sin(x)cos(x)dx=(1u)du{\color{red}{\int{\frac{\sin{\left(x \right)}}{\cos{\left(x \right)}} d x}}} = {\color{red}{\int{\left(- \frac{1}{u}\right)d u}}}

Apply the constant multiple rule cf(u)du=cf(u)du\int c f{\left(u \right)}\, du = c \int f{\left(u \right)}\, du with c=1c=-1 and f(u)=1uf{\left(u \right)} = \frac{1}{u}:

(1u)du=(1udu){\color{red}{\int{\left(- \frac{1}{u}\right)d u}}} = {\color{red}{\left(- \int{\frac{1}{u} d u}\right)}}

The integral of 1u\frac{1}{u} is 1udu=ln(u)\int{\frac{1}{u} d u} = \ln{\left(\left|{u}\right| \right)}:

1udu=ln(u)- {\color{red}{\int{\frac{1}{u} d u}}} = - {\color{red}{\ln{\left(\left|{u}\right| \right)}}}

Recall that u=cos(x)u=\cos{\left(x \right)}:

ln(u)=ln(cos(x))- \ln{\left(\left|{{\color{red}{u}}}\right| \right)} = - \ln{\left(\left|{{\color{red}{\cos{\left(x \right)}}}}\right| \right)}

Therefore,

tan(x)dx=ln(cos(x))\int{\tan{\left(x \right)} d x} = - \ln{\left(\left|{\cos{\left(x \right)}}\right| \right)}

Add the constant of integration:

tan(x)dx=ln(cos(x))+C\int{\tan{\left(x \right)} d x} = - \ln{\left(\left|{\cos{\left(x \right)}}\right| \right)}+C

Answer

tan(x)dx=ln(cos(x))+C\int \tan{\left(x \right)}\, dx = - \ln\left(\left|{\cos{\left(x \right)}}\right|\right) + CA