Step 1: Turn 1 + sin x into a perfect square:
Write \(1 = \sin^2\frac{x}{2} + \cos^2\frac{x}{2}\) and \(\sin x = 2\sin\frac{x}{2}\cos\frac{x}{2}\). Adding them:
\[ 1+\sin x = \left(\sin\frac{x}{2} + \cos\frac{x}{2}\right)^2 \]
So \(\sqrt{1+\sin x} = \sin\frac{x}{2} + \cos\frac{x}{2}\), taking the positive branch (the form used for this standard integral).
Step 2: Integrate term by term:
\(\int \sin\frac{x}{2}\,dx = -2\cos\frac{x}{2}\) and \(\int \cos\frac{x}{2}\,dx = 2\sin\frac{x}{2}\). So
\[ \int \sqrt{1+\sin x}\,dx = 2\left(\sin\frac{x}{2} - \cos\frac{x}{2}\right) + c \]
Step 3: Convert to a single sine:
Use \(\sin A - \cos A = \sqrt{2}\sin\left(A - \frac{\pi}{4}\right)\), which follows from \(\sin A\cos\frac{\pi}{4} - \cos A\sin\frac{\pi}{4} = \frac{\sin A - \cos A}{\sqrt{2}}\). With \(A = \frac{x}{2}\):
\[ 2\left(\sin\frac{x}{2} - \cos\frac{x}{2}\right) = 2\sqrt{2}\sin\left(\frac{x}{2} - \frac{\pi}{4}\right) \]
Step 4: Why the other options are wrong:
Option (B) has \(+\frac{\pi}{4}\), which equals \(2(\sin\frac{x}{2} + \cos\frac{x}{2})\). Its derivative is \(\cos\frac{x}{2} - \sin\frac{x}{2}\), not \(\sin\frac{x}{2} + \cos\frac{x}{2}\). Options (C) and (D) carry only \(\sqrt{2}\) as the coefficient. Differentiating \(\sqrt{2}\sin\left(\frac{x}{2}-\frac{\pi}{4}\right)\) gives half of the required integrand, so they are too small by a factor of 2.
Final Answer:
The integral equals \(2\sqrt{2}\sin\left(\frac{x}{2} - \frac{\pi}{4}\right) + c\), which is option (A).
\[ \boxed{2\sqrt{2}\sin\left(\frac{x}{2}-\frac{\pi}{4}\right)+c} \]