Integral of tan2(x)\tan^{2}{\left(x \right)}

The calculator will find the integral/antiderivative of tan2(x)\tan^{2}{\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 tan2(x)dx\int \tan^{2}{\left(x \right)}\, dx.

Solution

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

Then x=atan(u)x=\operatorname{atan}{\left(u \right)} and dx=(atan(u))du=duu2+1dx=\left(\operatorname{atan}{\left(u \right)}\right)^{\prime }du = \frac{du}{u^{2} + 1} (steps can be seen »).

The integral can be rewritten as

tan2(x)dx=u2u2+1du{\color{red}{\int{\tan^{2}{\left(x \right)} d x}}} = {\color{red}{\int{\frac{u^{2}}{u^{2} + 1} d u}}}

Rewrite and split the fraction:

u2u2+1du=(11u2+1)du{\color{red}{\int{\frac{u^{2}}{u^{2} + 1} d u}}} = {\color{red}{\int{\left(1 - \frac{1}{u^{2} + 1}\right)d u}}}

Integrate term by term:

(11u2+1)du=(1du1u2+1du){\color{red}{\int{\left(1 - \frac{1}{u^{2} + 1}\right)d u}}} = {\color{red}{\left(\int{1 d u} - \int{\frac{1}{u^{2} + 1} d u}\right)}}

Apply the constant rule cdu=cu\int c\, du = c u with c=1c=1:

1u2+1du+1du=1u2+1du+u- \int{\frac{1}{u^{2} + 1} d u} + {\color{red}{\int{1 d u}}} = - \int{\frac{1}{u^{2} + 1} d u} + {\color{red}{u}}

The integral of 1u2+1\frac{1}{u^{2} + 1} is 1u2+1du=atan(u)\int{\frac{1}{u^{2} + 1} d u} = \operatorname{atan}{\left(u \right)}:

u1u2+1du=uatan(u)u - {\color{red}{\int{\frac{1}{u^{2} + 1} d u}}} = u - {\color{red}{\operatorname{atan}{\left(u \right)}}}

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

atan(u)+u=atan(tan(x))+tan(x)- \operatorname{atan}{\left({\color{red}{u}} \right)} + {\color{red}{u}} = - \operatorname{atan}{\left({\color{red}{\tan{\left(x \right)}}} \right)} + {\color{red}{\tan{\left(x \right)}}}

Therefore,

tan2(x)dx=tan(x)atan(tan(x))\int{\tan^{2}{\left(x \right)} d x} = \tan{\left(x \right)} - \operatorname{atan}{\left(\tan{\left(x \right)} \right)}

Simplify:

tan2(x)dx=x+tan(x)\int{\tan^{2}{\left(x \right)} d x} = - x + \tan{\left(x \right)}

Add the constant of integration:

tan2(x)dx=x+tan(x)+C\int{\tan^{2}{\left(x \right)} d x} = - x + \tan{\left(x \right)}+C

Answer

tan2(x)dx=(x+tan(x))+C\int \tan^{2}{\left(x \right)}\, dx = \left(- x + \tan{\left(x \right)}\right) + CA