Step 1: See the integral.
We want $\displaystyle I = \int_{-\pi/2}^{\pi/2} \frac{\cos x}{1 + e^x}\,dx$. The $e^x$ on the bottom makes a direct integral hard, so we use a symmetry trick.
Step 2: Recall the king property.
$\displaystyle \int_a^b f(x)\,dx = \int_a^b f(a+b-x)\,dx$. Here $a + b = 0$, so we replace $x$ by $-x$.
Step 3: Apply the swap.
Since $\cos(-x) = \cos x$ and $e^{-x} = \tfrac{1}{e^x}$:
\[ I = \int_{-\pi/2}^{\pi/2} \frac{\cos x}{1 + \frac{1}{e^x}}\,dx = \int_{-\pi/2}^{\pi/2} \frac{e^x\cos x}{1 + e^x}\,dx \]
Step 4: Add the two forms.
Add the original and the new one:
\[ 2I = \int_{-\pi/2}^{\pi/2} \frac{\cos x + e^x\cos x}{1 + e^x}\,dx = \int_{-\pi/2}^{\pi/2} \frac{\cos x(1 + e^x)}{1 + e^x}\,dx \]
Step 5: Cancel and use evenness.
The $(1 + e^x)$ cancels, leaving $2I = \int_{-\pi/2}^{\pi/2} \cos x\,dx$. Since $\cos x$ is even, $2I = 2\int_0^{\pi/2}\cos x\,dx$, so $I = \int_0^{\pi/2}\cos x\,dx$.
Step 6: Finish the integral.
\[ I = [\sin x]_0^{\pi/2} = \sin\frac{\pi}{2} - \sin 0 = 1 - 0 = 1 \]
\[ \boxed{1} \]