The value of \(\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\displaystyle (\sin|x| + \cos|x|)\,dx\), is equal to:
Answer & explanation
Correct answer: option 4
The correct answer is Option (4) → 4
Let I be the given integral. Both \(\sin|x|\) and \(\cos|x|\) are even functions, since replacing x by −x leaves |x| unchanged. For an even function,
\(\displaystyle \int_{-a}^{a} f(x)\,dx = 2\int_{0}^{a} f(x)\,dx\)
On \(\left[0, \frac{\pi}{2}\right]\), |x| = x, so
\(\displaystyle I = 2\int_{0}^{\pi/2} (\sin x + \cos x)\,dx\)
\(\displaystyle = 2\Big[-\cos x + \sin x\Big]_{0}^{\pi/2}\)
\(= 2\left[(0 + 1) - (-1 + 0)\right] = 4\)
Tip: \(\sin|x|\) is even, not odd. Treating it as odd and dropping it leaves only \(2\int_{0}^{\pi/2}\cos x\,dx = 2\), which is Option (3).