TITLE: How do I go about solving the integral of csc x?
QUESTION [5 upvotes]: So here is a solution provided by another user a couple of years ago and I've seen this solution before but I'm not clear on how or why? 
What would make me think or tip me off that I should multiply it the way that is shown? 
Also it looks like there is a u-sub but I don't understand how it gets to the 1/u phase.
It would be greatly appreciated if you could help me understand the solution better.
Thanks in advance!

REPLY [6 votes]: Claude Leibovici's answer gives the easiest way to integrate this.
Another method that's longer than the one you refer to, but is maybe easier to motivate, is to write
$\displaystyle\int\csc x\;dx=\int\frac{1}{\sin x}\;dx=\int\frac{\sin x}{\sin^2x}\;dx=\int\frac{\sin x}{1-\cos^2 x}\;dx$.  
Now let $u=\cos x, \;du=-\sin xdx$ to get
$\displaystyle\int\frac{1}{u^2-1}\;du$, and then use partial fractions.