I'm trying to solve $\int \cot^3 x\,dx$ by substitution but I can't get it right. Here's what I did:
$$\int \cot^3x\,dx = \int(\csc^2x - 1)\cdot\cot x \,dx$$ $$-\int\cot x\,dx + \int \cot x \cdot \csc^2x \, dx$$
Let $u = \csc x\, du = -\csc x \cdot\cot x\,dx$
$$-\csc^2 x - \int u \,du = -\csc^2 x - \frac{u^2}{2} = -\csc^2 x - \frac{\csc^2x}{2}.$$
My problem is that the result in the solution manual is different, namely:
$$-\frac{\cot^2x}{2} - \ln\left|\sin(x)\right| + C$$
What's wrong with my solution?
The correct result is that $\int \cot (x) \,dx = \ln \left|\sin (x)\right|$. You have evaluated the other integral i.e. $\int \cot (x) \csc^2(x) \, dx$ correctly.
For $\int \cot(x) \, dx$ simply note that it is of the form $\int \cot(x) \,dx =\int\frac{d(\sin(x))}{\sin(x)}$ which is simply $\ln\left|\sin(x)\right|$