Question:

The value of \[ \int_0^{\frac{\pi}{2}} | \sin x - \cos x | dx \] is:

Show Hint

When dealing with absolute value functions, split the integral at the points where the expression inside the absolute value changes sign.
Updated On: Apr 22, 2026
  • 0
  • \( 2(\sqrt{2} - 1) \)
  • \( \sqrt{2} - 1 \)
  • \( 2(\sqrt{2} - 1) \)
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Step 1: Break the absolute value function.
The absolute value function \( | \sin x - \cos x | \) can be written as: \[ | \sin x - \cos x | = \begin{cases} \sin x - \cos x & \text{if } \sin x \geq \cos x \cos x - \sin x & \text{if } \sin x<\cos x \end{cases} \] To determine when \( \sin x = \cos x \), we solve \( \sin x = \cos x \), which gives: \[ x = \frac{\pi}{4} \] Thus, we will split the integral at \( x = \frac{\pi}{4} \).

Step 2: Set up the integrals.

The integral becomes: \[ I = \int_0^{\frac{\pi}{4}} (\cos x - \sin x) dx + \int_{\frac{\pi}{4}}^{\frac{\pi}{2}} (\sin x - \cos x) dx \]

Step 3: Evaluate each integral.

The first integral: \[ \int_0^{\frac{\pi}{4}} (\cos x - \sin x) dx = \sin x + \cos x \Big|_0^{\frac{\pi}{4}} = \sqrt{2} - 1 \] The second integral: \[ \int_{\frac{\pi}{4}}^{\frac{\pi}{2}} (\sin x - \cos x) dx = -\cos x - \sin x \Big|_{\frac{\pi}{4}}^{\frac{\pi}{2}} = \sqrt{2} - 1 \]

Step 4: Combine the results.

Adding both integrals together: \[ I = (\sqrt{2} - 1) + (\sqrt{2} - 1) = 2(\sqrt{2} - 1) \]

Step 5: Conclusion.

Thus, the value of the integral is: \[ \boxed{2(\sqrt{2} - 1)} \] This matches option (B), which is the correct answer.
Was this answer helpful?
0
0