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)})$

If you are considering antiderivatives as functions on connected domains $D$ that are open in $\mathbb{C}$ -- suitably chosen so that we don't have to worry about multivaluedness of the logarithm -- then you should still be okay. It's still true that the functions $z \mapsto \frac1{2} \ln \left(\frac{1 - \cos(z)}{1 + \cos(z)}\right)$ and $z \mapsto \frac1{2} \ln \left(\frac{\cos(z) - 1}{\cos(z) + 1}\right)$ are antiderivatives of $z \mapsto 1/\sin(z)$. Their difference is the constant $C = \ln(-1)/2$ for whatever branch of the logarithm you are considering. So you still get the same family of functions, up to a complex constant. 
