What am I doing wrong ? $\int \csc(x) \cot^2 (x) dx$ $$
\int \csc(x)\cot^2(x) dx= \int \csc(x) (\csc^2 (x) - 1) dx = \int (\csc^3(x) - \csc(x))dx
$$

Integrating by parts:

let u = $\csc(x)$, then du = $-\csc(x)\cot(x)dx$. 

let dv = $\csc^2 (x)dx$, then v = $-\cot(x)$.

The above integral becomes

$$\int \csc(x)\cot^2(x) dx=-\csc(x)\cot(x) - \int \csc(x)\cot^2 (x)dx - \int \csc(x) dx.$$

Using $\cot^2 (x) = \csc^2 (x) - 1$ identity:

$$\int \csc(x)\cot^2(x) dx= -\csc(x)\cot(x) - \int \csc^3(x)dx + \int \csc(x) dx - \int \csc(x) dx\\
=-\frac{1}{2} \csc(x)\cot(x) - \frac{1}{2}\ln |\csc(x) + \cot(x)| + \ln |\csc(x) + \cot(x)|\\
=-\frac{1}{2} \csc(x)\cot(x) + \frac{1}{2}\ln |\csc(x) + \cot(x)| + C$$
just the last, as your try, you need to find $\int \csc^3(x)dx$, and $$\int \csc^3(x)dx \neq -\frac{1}{2}\csc x\cot x$$
so the last part is wrong.
just the last, as your try, you need to find $\int \csc^3(x)dx$, and $$\int \csc^3(x)dx \neq -\frac{1}{2}\csc x\cot x$$
so the last part is wrong.