Here's an alternative solution: $$\eqalign{
\int\csc x\,\mathrm dx &= \int\left(\csc x\dfrac{\csc x-\cot x}{\csc x-\cot x}\right)\mathrm dx \\
&=\int\left(\dfrac{\csc^2 x-\cot x\csc x}{\csc x-\cot x}\right)\mathrm dx.
}$$
Now use the [itex]u[/itex]-substitution [itex]u=\csc x-\cot x[/itex] and you'll get: $$\int\dfrac{1}{u}\mathrm du=\ln|u|+{\cal C}=\ln|\csc x-\cot x|+{\cal C}.$$