Noob question about $\int \frac{1}{\sin(x)}dx$ I manually integrate $\int \frac{1}{\sin(x)}dx$ as $$\int \frac{\sin(x)}{\sin^{2}(x)}dx = -\int \frac{1}{\sin^{2}(x)}d\cos(x) = \int \frac{1}{\cos^{2}(x) - 1}d\cos(x).$$ 
After replacing $u = \cos(x)$, 
$$\int \frac{1}{u^{2} - 1}du = \int \frac{1}{u^{2} - 1}du = \frac {1} {2} \int \left(\frac {1} {u - 1} - \frac {1} {u+1}\right) du = \frac {1} {2} \ln\left(\frac {u-1} {u+1}\right) + C.$$ 
Substitute back to obtain
$$\frac {1} {2} \ln\left(\frac {\cos(x)-1}{\cos(x)+1}\right) + C.$$
The problem is that this solution is incorrect (I guess) because for example http://www.integral-calculator.com/ gives another solution 
$$\frac {1} {2} \ln\left(\frac {1 - \cos(x)}{1 + \cos(x)}\right) + C.$$
And all other online solvers gives equivalent solution to 
$$\frac {1} {2} \ln\left(\frac {1 - \cos(x)}{1 + \cos(x)}\right) + C.$$
The question is there I made a mistake?
Update: some of you may say that in complex space my answer is right but not so fast:
Take wolfram solver: integrate 1/sinx
The we get: $-ln(cot(x) + csc(x)) + C$ It is easy to see that it is equvalent to $$\frac {1} {2} \ln\left(\frac {1 - \cos(x)}{1 + \cos(x)}\right) + C.$$
$-\ln(\cot(x) + \csc(x)) + C = -\ln(\frac {\cos(x)} {\sin(x)} + \frac {1} {\sin(x)})$ 
then 
$-\ln(\frac {\cos(x)} {\sin(x)} + \frac {1} {\sin(x)}) = -\frac {1}{2} \ln(\frac {(1+\cos(x))^{2}} {\sin^{2}x}) = -\frac {1}{2} \ln(\frac{1+\cos(x)+\cos(x)+\cos^{2}(x)} {1-\cos^{2}x}) = -\frac {1}{2} \ln(\frac {(1+\cos(x))(\cos(x)+\cos^{2})(x)} {1-\cos^{2}x}) = -\frac {1}{2} \ln(\frac {1+\cos(x)} {1-\cos(x)}) = \frac {1}{2} \ln(\frac {1-\cos(x)} {1+\cos(x)})$

Where did I make a mistake?
First, you rather have 
$$
 \frac {1} {2} \int \left(\frac {1} {u - 1} - \frac {1} {u+1}\right) du = \frac {1} {2} \ln\left|\frac {u-1} {u+1}\right| + C
$$then observe that
$$
\left|\frac {\cos(x)-1}{\cos(x)+1}\right|=\frac {1-\cos(x)}{1+\cos(x)}
$$ since
$$
1 - \cos(x)\ge 0,\quad 1+ \cos(x)\ge0,
$$ giving that
$$
\ln\left|\frac {\cos(x)-1}{\cos(x)+1}\right|=\ln\left(\frac {1-\cos(x)}{1+\cos(x)}\right).
$$
