I've posted a similar question Confusion in finding derivative of $\sqrt{\frac{1-\cos(2x)}{1 + \cos(2x)}}$.
Consider the following integral: $$\int\sqrt{1 - x^2}\ dx.$$ Putting $x = \sin(\theta):$ $$=\int\sqrt{1 - \sin^2\theta}\ \cos\theta\ d\theta$$ $$=\int\sqrt{\cos^2\theta}\ \cos\theta\ d\theta\tag{1}$$ $$=\int\ \cos\theta\cos\theta\ d\theta\tag{2}$$ $$=\int\cos^2\theta\ d\theta$$ $$...$$ $$...$$ $$...$$
From step $(1)$ to $(2)$, I don't understand why we take $\sqrt{f^2(x)} = f(x)$ instead of $\sqrt{f^2(x)} =|f(x)|.$ I've seen many such examples like the above, where we ignore the negative values (mainly in substitutions in integration, differentiation, and inverse trigonometric functions).