How do I solve this trig integral? How do I solve this trig integral?
$$I=\int \frac{1+\cos x}{\sin x}\:dx$$
Is there any trig identity that I can use?
 A: Multiply top and bottom by $1-\cos x$ to get $\int \frac{\sin x}{1-\cos x} \; dx.$
Then $u=\cos x$ does the job.
A: $1 + \cos x = 2 \cos^2(x/2)$
$\sin x = 2\sin(x/2)\cos(x/2)$
Substitute these to get $\int \cot(x/2) dx $ . 
Substitute $\sin(x/2) = t, \,$ so $\;\cos(x/2)dx =2dt $ and proceed. 
A: The method provided by @B.Goddard is really simple and succinct. Here is another method if you know the standard integrals of trigonometric functions $\implies$
Just split the fraction inside the integral sign as

$$\int \frac {1+\cos(x)}{\sin(x)} dx = \int \left({\frac {1}{\sin(x)} + {\frac {\cos(x)}{\sin (x)}}}\right)  dx$$
$$=\int \csc(x) + \int \cot(x) dx $$
$$=-\ln\Big|\csc(x) + \cot(x)\Big| + \ln\Big|\sin(x)\Big| + C$$

To avoid confusion, I will do the next steps in a little bit detail :

$$=-\left(\ln\Big|\csc(x)+\cot(x)\Big|-\ln\Big|\sin(x)\Big|\right) + C$$
$$=-\ln  \left|{\frac {\csc(x) + \cot(x)}{\sin(x)}}\right| + C$$
$$=-\ln \left|{\frac {\csc(x)}{\sin(x)}} + {\frac {\cot(x)}{\sin(x)}}\right| + C$$
$$=-\ln\left|{\frac{1}{\sin^{2}(x)}} + \frac {\cos(x)}{\sin^2(x)}\right| + C$$
$$=-\ln\left|\frac{1+\cos(x)}{\sin^2(x)}\right|+C$$
$$=\ln\left|\frac {\sin^2(x)}{1+\cos(x)}\right| + C$$
$$=\ln\left|\frac {1-\cos^2(x)}{1+\cos(x)}\right|+C$$
$$=\ln\left|\frac {\big(1-\cos(x)\big)\big(1+\cos(x)\big)} { \big(1+\cos(x)\big)}\right| + C$$
$$=\ln\Big|1-\cos(x)\Big|+ C$$

Hope this makes sense to you... :)
Just take care of the negative signs(pun intended).....
EDIT : Although the method seems long and tedious, it just employs the standard integrals of trig functions and the logarithm manipulation required to simplify everything does not take much time and is easy$\Big($at least for me :-) $\Big)$. I have taken the annoying negative sign out so as to make simplification easier to see and understand, but not factoring out a $-1$ still works fine.
