We start by simplifying the denominator using the trigonometric identity:
\[
2 - \sin^2 \theta = \cos^2 \theta + 1
\]
So the integral becomes:
\[
\int \frac{\cos \theta}{\cos^2 \theta + 1} \, d\theta
\]
This simplifies further to:
\[
\frac{1}{2} \int \frac{d(\cos \theta)}{\cos^2 \theta + 1}
\]
Using the standard formula for the integral of the secant function, we get:
\[
\frac{1}{2} \ln |\cos \theta|
\]