First, simplify the given integral. Start by using the trigonometric identity:
\[
1 + \cos x = 2 \cos^2 \left( \frac{x}{2} \right)
\]
Thus, the integral becomes:
\[
I = \int \frac{x + \sin x}{2 \cos^2 \left( \frac{x}{2} \right)} \, dx
\]
Now, split the terms in the numerator:
\[
I = \frac{1}{2} \int \frac{x}{\cos^2 \left( \frac{x}{2} \right)} \, dx + \frac{1}{2} \int \frac{\sin x}{\cos^2 \left( \frac{x}{2} \right)} \, dx
\]
The second term can be simplified using the identity \( \sin x = 2 \sin \left( \frac{x}{2} \right) \cos \left( \frac{x}{2} \right) \). After further simplifications, integrate the expression.