Concept:
This definite integral can be resolved using King's Property of definite integrals, which states that:
\[
\int_{a}^{b} f(x) \, dx = \int_{a}^{b} f(a + b - x) \, dx
\]
Step 1: Write down the primary integral expression.
Let our initial given integral be represented as equation (1):
\[
I = \int_{-\pi/2}^{\pi/2} \frac{\cos^2 x}{2^x + 1} \, dx \quad \text{--- (1)}
\]
Step 2: Apply King's Property to generate a companion equation.
Here, lower bound \( a = -\frac{\pi}{2} \) and upper bound \( b = \frac{\pi}{2} \). The variable substitute parameter is:
\[
a + b - x = -\frac{\pi}{2} + \frac{\pi}{2} - x = -x
\]
Replacing \( x \) with \( -x \) inside the integrand:
\[
I = \int_{-\pi/2}^{\pi/2} \frac{\cos^2(-x)}{2^{-x} + 1} \, dx
\]
We know that \( \cos(-x) = \cos x \), so \( \cos^2(-x) = \cos^2 x \). Also rewrite the exponential index:
\[
2^{-x} = \frac{1}{2^x}
\]
Substituting these simplifications back into the definite integral:
\[
I = \int_{-\pi/2}^{\pi/2} \frac{\cos^2 x}{\frac{1}{2^x} + 1} \, dx = \int_{-\pi/2}^{\pi/2} \frac{\cos^2 x}{\frac{1 + 2^x}{2^x}} \, dx = \int_{-\pi/2}^{\pi/2} \frac{2^x \cos^2 x}{2^x + 1} \, dx \quad \text{--- (2)}
\]
Step 3: Add equations (1) and (2) together.
Since both equations have matching limits of integration, we can merge their integrands:
\[
2I = \int_{-\pi/2}^{\pi/2} \frac{\cos^2 x}{2^x + 1} \, dx + \int_{-\pi/2}^{\pi/2} \frac{2^x \cos^2 x}{2^x + 1} \, dx
\]
\[
2I = \int_{-\pi/2}^{\pi/2} \frac{\cos^2 x (1 + 2^x)}{2^x + 1} \, dx
\]
The matching factor \( (2^x + 1) \) cancels out cleanly from the numerator and denominator:
\[
2I = \int_{-\pi/2}^{\pi/2} \cos^2 x \, dx
\]
Step 4: Integrate the simplified function using even/odd properties.
Since \( \cos^2 x \) is an even function (\( f(-x) = f(x) \)), we can change the integration baseline using the property \( \int_{-a}^{a} f(x)dx = 2\int_{0}^{a} f(x)dx \):
\[
2I = 2 \int_{0}^{\pi/2} \cos^2 x \, dx \quad \Rightarrow \quad I = \int_{0}^{\pi/2} \cos^2 x \, dx
\]
Using the trigonometric identity \( \cos^2 x = \frac{1 + \cos 2x}{2} \):
\[
I = \int_{0}^{\pi/2} \left( \frac{1 + \cos 2x}{2} \right) dx = \frac{1}{2} \left[ x + \frac{\sin 2x}{2} \right]_{0}^{\pi/2}
\]
Step 5: Compute boundaries to isolate the final numeric answer.
Evaluate at the upper limit \( \frac{\pi}{2} \) and lower limit 0:
\[
I = \frac{1}{2} \left[ \left( \frac{\pi}{2} + \frac{\sin(\pi)}{2} \right) - \left( 0 + \frac{\sin(0)}{2} \right) \right]
\]
Since \( \sin(\pi) = 0 \) and \( \sin(0) = 0 \):
\[
I = \frac{1}{2} \left[ \frac{\pi}{2} \right] = \frac{\pi}{4}
\]