To solve the integral \( \int \sqrt{1 + \cos x} \, dx \), we can follow these steps:
### Step 1: Use the Double Angle Formula
We start by rewriting \( 1 + \cos x \) using the double angle identity:
\[
1 + \cos x = 2 \cos^2\left(\frac{x}{2}\right)
\]
Thus, we can express the integral as:
\[
\int \sqrt{1 + \cos x} \, dx = \int \sqrt{2 \cos^2\left(\frac{x}{2}\right)} \, dx
\]
### Step 2: Simplify the Square Root
Next, we simplify the square root:
\[
\sqrt{2 \cos^2\left(\frac{x}{2}\right)} = \sqrt{2} \cdot |\cos\left(\frac{x}{2}\right)|
\]
For the purpose of integration, we can assume \( \cos\left(\frac{x}{2}\right) \) is non-negative in the interval we are considering, so we have:
\[
\sqrt{2} \cdot \cos\left(\frac{x}{2}\right)
\]
### Step 3: Set Up the Integral
Now, we can rewrite our integral:
\[
\int \sqrt{1 + \cos x} \, dx = \sqrt{2} \int \cos\left(\frac{x}{2}\right) \, dx
\]
### Step 4: Perform the Integration
We need to integrate \( \cos\left(\frac{x}{2}\right) \). We can use a substitution:
Let \( u = \frac{x}{2} \), then \( dx = 2 \, du \). The integral becomes:
\[
\sqrt{2} \int \cos(u) \cdot 2 \, du = 2\sqrt{2} \int \cos(u) \, du
\]
The integral of \( \cos(u) \) is \( \sin(u) \), so we have:
\[
2\sqrt{2} \sin(u) + C
\]
### Step 5: Substitute Back
Now, substituting back \( u = \frac{x}{2} \):
\[
2\sqrt{2} \sin\left(\frac{x}{2}\right) + C
\]
### Final Answer
Thus, the final result for the integral \( \int \sqrt{1 + \cos x} \, dx \) is:
\[
\int \sqrt{1 + \cos x} \, dx = 2\sqrt{2} \sin\left(\frac{x}{2}\right) + C
\]