Cancelling with absolute values I am trying to understand how cancellation works in integrals when there are absolute value expressions involved. For example:
$$\int\frac{sinx}{\sqrt{1-cos^2x}}dx = \int \frac{sinx}{\lvert sin(x) \rvert}dx =x + C$$
Depending on whether $sin(x)$ is positive or negative, the value of the ratio above should be either $1$ or $-1$ and so, for example, 
$$\int_0^{2\pi} \frac{sin(x)}{\lvert sin(x) \rvert}dx \overset!= 0 \not= 2\pi$$
However, in many integrals I see, especially those involving trigonometric substitutions, I feel like this issue is just being ignored. 
Thank you in advance for your help!
 A: There can be many reasons for why something like that might be ignored. Assuming it isn't a simple mistake, it might just be that, over the domain of integration, the value of the expression in the absolute value is always positive (or negative, for that matter), and so there is no need to break the integral up. An example similar to what you gave would be
$$ \int_0^\pi\frac{\sin x}{\sqrt{1-\cos^2x}}dx=\int_0^\pi\frac{\sin x}{|\sin x|}dx=\int_0^\pi1dx=\pi, $$
where we can ignore the absolute value because $\sin(x)\geq 0$ whenever $x\in(0,\pi)$. With that said, you are completely right that if this does not happen, then we will in general need to split the integral up and integrate over different domains, then sum the result. An example would be
$$\int_0^3||x-1|-|x-2||dx. $$
If we were to attempt at evaluating it immediately, we would nto get anywhere, because the absolute value "partitions" the integral up in such a way that makes it invulnerable to attack, so to speak. Instead, we have to consider the integral over the domains $[0,1]$, $[1,3/2]$, $[3/2,2]$ and $[2,3]$ individually, then sum it up. See it yourself on Desmos!
A: You are right: $\dfrac{\sin x}{\lvert \sin x\rvert}$ is $\pm1$, for each $x$. In fact\begin{align}\int_0^{2\pi}\frac{\sin x}{\lvert \sin x\rvert}\,\mathrm dx&=\int_0^\pi1\,\mathrm dx+\int_\pi^{2\pi}-1\,\mathrm dx\\&=\pi-\pi\\&=0.\end{align}
A: Since $\frac{sinx}{|sinx|}=\pm 1$, the indefinite integral will be $\pm x+C$, so for example $\int_0^x =x$ for $x\le \pi$.  However for $\pi\lt x\le 2\pi$, the integral is $2\pi -x$.
