Step 1: Understanding the Question:
We cannot integrate \( \sin^2\frac{x}{2} \) directly, because the sine is squared. The standard way is to lower the power with a double-angle identity.
Step 2: Key Formula:
The identity is \( \cos 2\theta = 1 - 2\sin^2\theta \). It can be rearranged as \( \sin^2\theta = \frac{1-\cos 2\theta}{2} \).
Here \( \theta = \frac{x}{2} \), so \( 2\theta = x \).
Step 3: Rewrite the integrand:
\[ \sin^2\frac{x}{2} = \frac{1-\cos x}{2} \]
\[ \int \sin^2\frac{x}{2}\,dx = \frac{1}{2}\int (1-\cos x)\,dx \]
Step 4: Integrate:
We know \( \int 1\,dx = x \) and \( \int \cos x\,dx = \sin x \).
\[ \int \sin^2\frac{x}{2}\,dx = \frac{1}{2}\left(x - \sin x\right) + k = \frac{1}{2}x - \frac{1}{2}\sin x + k \]
This is option (A).
Step 5: Why the other options are wrong:
Option (B): its derivative is \( \frac{1}{2} + \frac{1}{2}\sin x \). The sign is wrong, and \( \cos x \) should not appear in the answer, because \( \int\cos x\,dx = \sin x \).
Option (C): its derivative is \( \frac{1}{2}\cos x \), which is not \( \sin^2\frac{x}{2} \).
Option (D): its derivative is \( -\frac{1}{2}\cos x \), also not equal to \( \sin^2\frac{x}{2} \). Both (C) and (D) miss the term \( \frac{x}{2} \) that comes from the constant 1 in \( 1-\cos x \).
Final Answer:
Using \( \sin^2\frac{x}{2}=\frac{1-\cos x}{2} \), the integral is \( \frac{1}{2}x-\frac{1}{2}\sin x+k \). This is option (A).
\[ \boxed{\frac{1}{2}x-\frac{1}{2}\sin x+k} \]