We are asked to find the area enclosed by the curves \( y = \sin x + \cos x \) and \( y = | \cos x - \sin x | \) over the interval \( \left[ 0, \frac{\pi}{2} \right] \).
Step 1: Analyze the functions
- The curve \( y = \sin x + \cos x \) is a smooth continuous curve.
- The curve \( y = | \cos x - \sin x | \) involves the absolute value function, so we need to split it into two cases based on the value of \( \cos x - \sin x \).
For \( x \in [0, \frac{\pi}{2}] \), we know:
- \( \cos x - \sin x \geq 0 \) for \( x \in [0, \frac{\pi}{4}] \)
- \( \cos x - \sin x \leq 0 \) for \( x \in [\frac{\pi}{4}, \frac{\pi}{2}] \)
Thus, the function \( y = | \cos x - \sin x | \) becomes:
- \( y = \cos x - \sin x \) for \( x \in [0, \frac{\pi}{4}] \)
- \( y = \sin x - \cos x \) for \( x \in [\frac{\pi}{4}, \frac{\pi}{2}] \)
Step 2: Set up the integrals
The area enclosed by the curves is the sum of two areas:
1. The area between \( y = \sin x + \cos x \) and \( y = \cos x - \sin x \) over the interval \( [0, \frac{\pi}{4}] \).
2. The area between \( y = \sin x + \cos x \) and \( y = \sin x - \cos x \) over the interval \( [\frac{\pi}{4}, \frac{\pi}{2}] \).
Area for \( x \in [0, \frac{\pi}{4}] \):
\[
A_1 = \int_0^{\frac{\pi}{4}} \left[ (\sin x + \cos x) - (\cos x - \sin x) \right] dx = \int_0^{\frac{\pi}{4}} 2\sin x \, dx
\]
Integrating:
\[
A_1 = 2 \left[ -\cos x \right]_0^{\frac{\pi}{4}} = 2 \left( -\cos \frac{\pi}{4} + \cos 0 \right) = 2 \left( -\frac{\sqrt{2}}{2} + 1 \right)
\]
\[
A_1 = 2 \left( 1 - \frac{\sqrt{2}}{2} \right) = 2\left( \sqrt{2} - 1 \right)
\]
Area for \( x \in [\frac{\pi}{4}, \frac{\pi}{2}] \):
\[
A_2 = \int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \left[ (\sin x + \cos x) - (\sin x - \cos x) \right] dx = \int_{\frac{\pi}{4}}^{\frac{\pi}{2}} 2\cos x \, dx
\]
Integrating:
\[
A_2 = 2 \left[ \sin x \right]_{\frac{\pi}{4}}^{\frac{\pi}{2}} = 2 \left( \sin \frac{\pi}{2} - \sin \frac{\pi}{4} \right) = 2 \left( 1 - \frac{\sqrt{2}}{2} \right)
\]
\[
A_2 = 2 \left( \sqrt{2} - 1 \right)
\]
Step 3: Total area
The total area enclosed by the curves is:
\[
A = A_1 + A_2 = 2\left( \sqrt{2} - 1 \right) + 2\left( \sqrt{2} - 1 \right) = 2\sqrt{2}(\sqrt{2} - 1)
\]
Thus, the correct answer is Option B.