Step 1: Understanding the Concept:
For a linear differential equation of the form $\frac{dy}{dx} + P(x)y = Q(x)$, the integrating factor (I.F.) is defined as $e^{\int P(x) dx}$.
Step 2: Detailed Explanation:
1. Rearrange the given equation into the standard linear form:
\[ 2 \frac{dy}{dx} = y + \cos x \]
\[ 2 \frac{dy}{dx} - y = \cos x \]
Divide by 2:
\[ \frac{dy}{dx} - \frac{1}{2}y = \frac{1}{2}\cos x \]
2. Identify $P(x)$:
Comparing with $\frac{dy}{dx} + P(x)y = Q(x)$, we have $P(x) = -\frac{1}{2}$.
3. Calculate the I.F.:
\[ \text{I.F.} = e^{\int P(x) dx} = e^{\int -1/2 dx} \]
\[ \text{I.F.} = e^{-x/2} \]
Step 3: Final Answer:
The integrating factor is $e^{-x/2}$.