\( \int_{\frac{-\pi}{2}}^{\frac{\pi}{2}}\displaystyle\frac{\cos x}{1+e^x}\,dx= \)
Answer & explanation
Correct answer: option 2
The correct answer is Option (2) → 1
By the property \( \int_{-a}^{a}f(x)\,dx=\int_{-a}^{a}f(-x)\,dx \), the integral does not change when x is replaced by −x.
\( \displaystyle I=\int_{-\pi/2}^{\pi/2}\frac{\cos x}{1+e^x}\,dx\quad\ldots(1) \)
Replacing x by −x, with \( \cos(-x)=\cos x \) and \( \frac{1}{1+e^{-x}}=\frac{e^x}{e^x+1} \):
\( \displaystyle I=\int_{-\pi/2}^{\pi/2}\frac{e^x\cos x}{1+e^x}\,dx\quad\ldots(2) \)
Adding (1) and (2):
\( \displaystyle 2I=\int_{-\pi/2}^{\pi/2}\frac{(1+e^x)\cos x}{1+e^x}\,dx \)
\( \displaystyle =\int_{-\pi/2}^{\pi/2}\cos x\,dx \)
\( \displaystyle =\left[\sin x\right]_{-\pi/2}^{\pi/2} \)
\( \displaystyle =1-(-1)=2 \)
\( \displaystyle I=1 \)
Tip: For \( \int_{-a}^{a}\frac{g(x)}{1+e^{x}}\,dx \) with g even, the answer is always \( \int_0^{a}g(x)\,dx \), half of \( \int_{-a}^{a}g(x)\,dx \); here \( \int_0^{\pi/2}\cos x\,dx=1 \).