Integral of $$$- x \cot{\left(x \right)} + x$$$

The calculator will find the integral/antiderivative of $$$- x \cot{\left(x \right)} + x$$$, 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 \left(- x \cot{\left(x \right)} + x\right)\, dx$$$.

Solution

Integrate term by term:

$${\color{red}{\int{\left(- x \cot{\left(x \right)} + x\right)d x}}} = {\color{red}{\left(\int{x d x} - \int{x \cot{\left(x \right)} d x}\right)}}$$

Apply the power rule $$$\int x^{n}\, dx = \frac{x^{n + 1}}{n + 1}$$$ $$$\left(n \neq -1 \right)$$$ with $$$n=1$$$:

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

For the integral $$$\int{x \cot{\left(x \right)} d x}$$$, use integration by parts $$$\int \operatorname{u} \operatorname{dv} = \operatorname{u}\operatorname{v} - \int \operatorname{v} \operatorname{du}$$$.

Let $$$\operatorname{u}=x$$$ and $$$\operatorname{dv}=\cot{\left(x \right)} dx$$$.

Then $$$\operatorname{du}=\left(x\right)^{\prime }dx=1 dx$$$ (steps can be seen ») and $$$\operatorname{v}=\int{\cot{\left(x \right)} d x}=\ln{\left(\sin{\left(x \right)} \right)}$$$ (steps can be seen »).

Thus,

$$\frac{x^{2}}{2} - {\color{red}{\int{x \cot{\left(x \right)} d x}}}=\frac{x^{2}}{2} - {\color{red}{\left(x \cdot \ln{\left(\sin{\left(x \right)} \right)}-\int{\ln{\left(\sin{\left(x \right)} \right)} \cdot 1 d x}\right)}}=\frac{x^{2}}{2} - {\color{red}{\left(x \ln{\left(\sin{\left(x \right)} \right)} - \int{\ln{\left(\sin{\left(x \right)} \right)} d x}\right)}}$$

This integral does not have a closed form:

$$\frac{x^{2}}{2} - x \ln{\left(\sin{\left(x \right)} \right)} + {\color{red}{\int{\ln{\left(\sin{\left(x \right)} \right)} d x}}} = \frac{x^{2}}{2} - x \ln{\left(\sin{\left(x \right)} \right)} + {\color{red}{\left(\frac{i x^{2}}{2} - x \ln{\left(1 - e^{2 i x} \right)} + x \ln{\left(\sin{\left(x \right)} \right)} + \frac{i \operatorname{Li}_{2}\left(e^{2 i x}\right)}{2}\right)}}$$

Therefore,

$$\int{\left(- x \cot{\left(x \right)} + x\right)d x} = \frac{x^{2}}{2} + \frac{i x^{2}}{2} - x \ln{\left(1 - e^{2 i x} \right)} + \frac{i \operatorname{Li}_{2}\left(e^{2 i x}\right)}{2}$$

Simplify:

$$\int{\left(- x \cot{\left(x \right)} + x\right)d x} = \frac{x^{2} \left(1 + i\right)}{2} - x \ln{\left(1 - e^{2 i x} \right)} + \frac{i \operatorname{Li}_{2}\left(e^{2 i x}\right)}{2}$$

Add the constant of integration:

$$\int{\left(- x \cot{\left(x \right)} + x\right)d x} = \frac{x^{2} \left(1 + i\right)}{2} - x \ln{\left(1 - e^{2 i x} \right)} + \frac{i \operatorname{Li}_{2}\left(e^{2 i x}\right)}{2}+C$$

Answer

$$$\int \left(- x \cot{\left(x \right)} + x\right)\, dx = \left(\frac{x^{2} \left(1 + i\right)}{2} - x \ln\left(1 - e^{2 i x}\right) + \frac{i \operatorname{Li}_{2}\left(e^{2 i x}\right)}{2}\right) + C$$$A


Please try a new game Rotatly