<s>[INST] Integrate $\sqrt{4 - x^2}\cdot\operatorname{sgn}(x-1)$ I'm trying to learn calculus through self study and I happened upon the following exercise:
$$ \int_{0}^{2} \sqrt{4 - x^2}\cdot\operatorname{sgn}(x-1) \,dx $$
Seeing the sgn I thought: well this is easy and concluded that since $ \int_{0}^{2} \operatorname{sgn}(x-1) \,dx = 0$, the answer should be zero. But of course then I remembered that $ \int  f(x)g(x) \,dx \neq \int f(x) \,dx \int g(x) \,dx$ and got lost.
I know how to solve $ \int_{0}^{2} \sqrt{4 - x^2}dx$, since that geometrically corresponds to a quarter circle of radius $2$ it's just $\pi$, but how do I approach the product of these things?
 [/INST] To expand on @José Carlos Santos' answer, you can compute $\int \sqrt{4-x^2}\; dx$ by trigonometric substitution: let $x=2\sin(t)$ with $-\frac{\pi}{2}\le t\le \frac{\pi}{2}$ . Then $\sqrt{4-x^2}=2\cos(t)$ and $dx=2\cos(t)\; dt$ so
$$\int \sqrt{4-x^2}\; dx = \int 4\cos^2(t)\; dt = 2 \int 1+\cos(2t)\; dt 
= 
2\left(t + \frac{\sin(2t)}{2} \right)+ C$$
Substituting back, we get
$$\int \sqrt{4-x^2}\; dx = 2 \arcsin\left(\frac x 2\right) + \frac{x\sqrt{4-x^2}}{2} + C$$
Therefore,
$$\int_{0}^{2} \sqrt{4 - x^2}\cdot\operatorname{sgn}(x-1) \,dx
=
-\int_0^1\sqrt{4-x^2}\,\mathrm dx+\int_1^2\sqrt{4-x^2}\,\mathrm dx
=
-\left(2\arcsin(1/2)+\frac{\sqrt{3}}{2}
\right) 
+
\left(2\arcsin(1)-2\arcsin(1/2)-\frac{\sqrt{3}}{2}
\right)
=\frac{\pi}{3}-\sqrt{3}$$
</s>