Subjects calculus

Piecewise Integral

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Search Solutions

Piecewise Integral


1. **Problem statement:** Calculate the integral $$\int_0^{2\pi} f(x) \, dx$$ where $$f(x) = \begin{cases} \sin x & \text{for } x \leq \pi \\ -2 \sin x & \text{for } x > \pi \end{cases}$$. 2. **Approach:** Since $$f(x)$$ is piecewise defined, split the integral at $$x=\pi$$: $$\int_0^{2\pi} f(x) \, dx = \int_0^{\pi} \sin x \, dx + \int_{\pi}^{2\pi} -2 \sin x \, dx$$. 3. **Recall integral formula:** $$\int \sin x \, dx = -\cos x + C$$. 4. **Calculate first integral:** $$\int_0^{\pi} \sin x \, dx = [-\cos x]_0^{\pi} = (-\cos \pi) - (-\cos 0) = (-(-1)) - (-1) = 1 + 1 = 2$$. 5. **Calculate second integral:** $$\int_{\pi}^{2\pi} -2 \sin x \, dx = -2 \int_{\pi}^{2\pi} \sin x \, dx = -2 [-\cos x]_{\pi}^{2\pi} = -2 [(-\cos 2\pi) - (-\cos \pi)] = -2 [(-1) - (-(-1))] = -2 [-1 - 1] = -2 (-2) = 4$$. 6. **Sum results:** $$\int_0^{2\pi} f(x) \, dx = 2 + 4 = 6$$. 7. **Answer:** The value of the integral is $$6$$.