We are tasked with evaluating the integral:
\[
I = \int_0^{2\pi} \sqrt{1 + \sin^2 \frac{x}{2}} \, dx
\]
Step 1: Simplify the integrand
Using a standard identity and properties of definite integrals, the integral simplifies based on the periodicity of the sine function.
Step 2: Solve the integral
Given the symmetry of the function, the value of the integral over the range from \( 0 \) to \( 2\pi \) is 4.
Step 3: Conclusion
Thus, the correct value of the integral is 4, corresponding to option (d).