Integral of $$$- \sin{\left(x \right)} \cos{\left(x \right)} + \frac{\cot{\left(x \right)}}{\sin{\left(x \right)}}$$$
Related calculator: Definite and Improper Integral Calculator
Your Input
Find $$$\int \left(- \sin{\left(x \right)} \cos{\left(x \right)} + \frac{\cot{\left(x \right)}}{\sin{\left(x \right)}}\right)\, dx$$$.
Solution
Integrate term by term:
$${\color{red}{\int{\left(- \sin{\left(x \right)} \cos{\left(x \right)} + \frac{\cot{\left(x \right)}}{\sin{\left(x \right)}}\right)d x}}} = {\color{red}{\left(\int{\frac{\cot{\left(x \right)}}{\sin{\left(x \right)}} d x} - \int{\sin{\left(x \right)} \cos{\left(x \right)} d x}\right)}}$$
Rewrite the integrand:
$$- \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} + {\color{red}{\int{\frac{\cot{\left(x \right)}}{\sin{\left(x \right)}} d x}}} = - \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} + {\color{red}{\int{\cot{\left(x \right)} \csc{\left(x \right)} d x}}}$$
Let $$$u=\csc{\left(x \right)}$$$.
Then $$$du=\left(\csc{\left(x \right)}\right)^{\prime }dx = - \cot{\left(x \right)} \csc{\left(x \right)} dx$$$ (steps can be seen »), and we have that $$$\cot{\left(x \right)} \csc{\left(x \right)} dx = - du$$$.
So,
$$- \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} + {\color{red}{\int{\cot{\left(x \right)} \csc{\left(x \right)} d x}}} = - \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} + {\color{red}{\int{\left(-1\right)d u}}}$$
Apply the constant multiple rule $$$\int c f{\left(u \right)}\, du = c \int f{\left(u \right)}\, du$$$ with $$$c=-1$$$ and $$$f{\left(u \right)} = 1$$$:
$$- \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} + {\color{red}{\int{\left(-1\right)d u}}} = - \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} + {\color{red}{\left(- \int{1 d u}\right)}}$$
Apply the constant rule $$$\int c\, du = c u$$$ with $$$c=1$$$:
$$- \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} - {\color{red}{\int{1 d u}}} = - \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} - {\color{red}{u}}$$
Recall that $$$u=\csc{\left(x \right)}$$$:
$$- \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} - {\color{red}{u}} = - \int{\sin{\left(x \right)} \cos{\left(x \right)} d x} - {\color{red}{\csc{\left(x \right)}}}$$
Let $$$u=\sin{\left(x \right)}$$$.
Then $$$du=\left(\sin{\left(x \right)}\right)^{\prime }dx = \cos{\left(x \right)} dx$$$ (steps can be seen »), and we have that $$$\cos{\left(x \right)} dx = du$$$.
So,
$$- \csc{\left(x \right)} - {\color{red}{\int{\sin{\left(x \right)} \cos{\left(x \right)} d x}}} = - \csc{\left(x \right)} - {\color{red}{\int{u d u}}}$$
Apply the power rule $$$\int u^{n}\, du = \frac{u^{n + 1}}{n + 1}$$$ $$$\left(n \neq -1 \right)$$$ with $$$n=1$$$:
$$- \csc{\left(x \right)} - {\color{red}{\int{u d u}}}=- \csc{\left(x \right)} - {\color{red}{\frac{u^{1 + 1}}{1 + 1}}}=- \csc{\left(x \right)} - {\color{red}{\left(\frac{u^{2}}{2}\right)}}$$
Recall that $$$u=\sin{\left(x \right)}$$$:
$$- \csc{\left(x \right)} - \frac{{\color{red}{u}}^{2}}{2} = - \csc{\left(x \right)} - \frac{{\color{red}{\sin{\left(x \right)}}}^{2}}{2}$$
Therefore,
$$\int{\left(- \sin{\left(x \right)} \cos{\left(x \right)} + \frac{\cot{\left(x \right)}}{\sin{\left(x \right)}}\right)d x} = - \frac{\sin^{2}{\left(x \right)}}{2} - \csc{\left(x \right)}$$
Add the constant of integration:
$$\int{\left(- \sin{\left(x \right)} \cos{\left(x \right)} + \frac{\cot{\left(x \right)}}{\sin{\left(x \right)}}\right)d x} = - \frac{\sin^{2}{\left(x \right)}}{2} - \csc{\left(x \right)}+C$$
Answer
$$$\int \left(- \sin{\left(x \right)} \cos{\left(x \right)} + \frac{\cot{\left(x \right)}}{\sin{\left(x \right)}}\right)\, dx = \left(- \frac{\sin^{2}{\left(x \right)}}{2} - \csc{\left(x \right)}\right) + C$$$A