Integral of $$$\frac{1}{\tan{\left(x \right)}}$$$

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

Related calculator: Definite and Improper Integral Calculator

Please write without any differentials such as $$$dx$$$, $$$dy$$$ 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 $$$\int \frac{1}{\tan{\left(x \right)}}\, dx$$$.

Solution

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

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

The integral can be rewritten as

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

Let $$$v=u^{2} + 1$$$.

Then $$$dv=\left(u^{2} + 1\right)^{\prime }du = 2 u du$$$ (steps can be seen »), and we have that $$$u du = \frac{dv}{2}$$$.

The integral becomes

$${\color{red}{\int{\frac{1}{u \left(u^{2} + 1\right)} d u}}} = {\color{red}{\int{\frac{1}{2 v \left(v - 1\right)} d v}}}$$

Apply the constant multiple rule $$$\int c f{\left(v \right)}\, dv = c \int f{\left(v \right)}\, dv$$$ with $$$c=\frac{1}{2}$$$ and $$$f{\left(v \right)} = \frac{1}{v \left(v - 1\right)}$$$:

$${\color{red}{\int{\frac{1}{2 v \left(v - 1\right)} d v}}} = {\color{red}{\left(\frac{\int{\frac{1}{v \left(v - 1\right)} d v}}{2}\right)}}$$

Perform partial fraction decomposition (steps can be seen »):

$$\frac{{\color{red}{\int{\frac{1}{v \left(v - 1\right)} d v}}}}{2} = \frac{{\color{red}{\int{\left(\frac{1}{v - 1} - \frac{1}{v}\right)d v}}}}{2}$$

Integrate term by term:

$$\frac{{\color{red}{\int{\left(\frac{1}{v - 1} - \frac{1}{v}\right)d v}}}}{2} = \frac{{\color{red}{\left(- \int{\frac{1}{v} d v} + \int{\frac{1}{v - 1} d v}\right)}}}{2}$$

Let $$$w=v - 1$$$.

Then $$$dw=\left(v - 1\right)^{\prime }dv = 1 dv$$$ (steps can be seen »), and we have that $$$dv = dw$$$.

Therefore,

$$- \frac{\int{\frac{1}{v} d v}}{2} + \frac{{\color{red}{\int{\frac{1}{v - 1} d v}}}}{2} = - \frac{\int{\frac{1}{v} d v}}{2} + \frac{{\color{red}{\int{\frac{1}{w} d w}}}}{2}$$

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

$$- \frac{\int{\frac{1}{v} d v}}{2} + \frac{{\color{red}{\int{\frac{1}{w} d w}}}}{2} = - \frac{\int{\frac{1}{v} d v}}{2} + \frac{{\color{red}{\ln{\left(\left|{w}\right| \right)}}}}{2}$$

Recall that $$$w=v - 1$$$:

$$\frac{\ln{\left(\left|{{\color{red}{w}}}\right| \right)}}{2} - \frac{\int{\frac{1}{v} d v}}{2} = \frac{\ln{\left(\left|{{\color{red}{\left(v - 1\right)}}}\right| \right)}}{2} - \frac{\int{\frac{1}{v} d v}}{2}$$

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

$$\frac{\ln{\left(\left|{v - 1}\right| \right)}}{2} - \frac{{\color{red}{\int{\frac{1}{v} d v}}}}{2} = \frac{\ln{\left(\left|{v - 1}\right| \right)}}{2} - \frac{{\color{red}{\ln{\left(\left|{v}\right| \right)}}}}{2}$$

Recall that $$$v=u^{2} + 1$$$:

$$\frac{\ln{\left(\left|{-1 + {\color{red}{v}}}\right| \right)}}{2} - \frac{\ln{\left(\left|{{\color{red}{v}}}\right| \right)}}{2} = \frac{\ln{\left(\left|{-1 + {\color{red}{\left(u^{2} + 1\right)}}}\right| \right)}}{2} - \frac{\ln{\left(\left|{{\color{red}{\left(u^{2} + 1\right)}}}\right| \right)}}{2}$$

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

$$- \frac{\ln{\left(1 + {\color{red}{u}}^{2} \right)}}{2} + \frac{\ln{\left({\color{red}{u}}^{2} \right)}}{2} = - \frac{\ln{\left(1 + {\color{red}{\tan{\left(x \right)}}}^{2} \right)}}{2} + \frac{\ln{\left({\color{red}{\tan{\left(x \right)}}}^{2} \right)}}{2}$$

Therefore,

$$\int{\frac{1}{\tan{\left(x \right)}} d x} = - \frac{\ln{\left(\tan^{2}{\left(x \right)} + 1 \right)}}{2} + \frac{\ln{\left(\tan^{2}{\left(x \right)} \right)}}{2}$$

Simplify:

$$\int{\frac{1}{\tan{\left(x \right)}} d x} = - \frac{\ln{\left(\tan^{2}{\left(x \right)} + 1 \right)}}{2} + \ln{\left(\tan{\left(x \right)} \right)}$$

Add the constant of integration:

$$\int{\frac{1}{\tan{\left(x \right)}} d x} = - \frac{\ln{\left(\tan^{2}{\left(x \right)} + 1 \right)}}{2} + \ln{\left(\tan{\left(x \right)} \right)}+C$$

Answer

$$$\int \frac{1}{\tan{\left(x \right)}}\, dx = \left(- \frac{\ln\left(\tan^{2}{\left(x \right)} + 1\right)}{2} + \ln\left(\tan{\left(x \right)}\right)\right) + C$$$A


Please try a new game Rotatly