Step 1: Choose a substitution to simplify the square root.
Let \(u = 1 + \cos x\). Then \(du = -\sin x \, dx\), so \(\sin x\, dx = -du\).
Step 2: Rewrite the integral in terms of u. \[\int \frac{\sin x}{\sqrt{1+\cos x}}\,dx = \int \frac{-du}{\sqrt{u}} = -\int u^{-1/2}\,du\]
Step 3: Integrate using the power rule. \[-\int u^{-1/2}\,du = -2u^{1/2} + c = -2\sqrt{u} + c\]
Step 4: Substitute back \(u = 1+\cos x\). \[-2\sqrt{1+\cos x} + c\]
Step 5: Simplify using the half-angle identity.
Recall \(1 + \cos x = 2\cos^2\left(\dfrac{x}{2}\right)\), so \(\sqrt{1+\cos x} = \sqrt{2}\left|\cos\dfrac{x}{2}\right|\). Taking the principal (positive) branch of cosine over the relevant interval: \[-2\sqrt{1+\cos x} + c = -2\sqrt{2}\,\cos\frac{x}{2} + c\]
Step 6: Match with the options.
This is option (B). Option (A) results from a sign or identity mix-up using sine instead of cosine in the half-angle substitution. Options (C) and (D) are off by a factor of 4 in the constant (they use \(\tfrac{1}{\sqrt2}\) instead of \(2\sqrt2\)), which would only arise from an incorrect power or coefficient while integrating \(u^{-1/2}\).