Obviously, knowing the trigonometric identities as already covered is the far superior and simpler method. Here is a more 'generalised' approach. I hope it serves some value.
Here I will address the integral:
\begin{equation}
I = \int \sqrt{1 + \sin\left(\frac{x}{2}\right)}\:dx
\end{equation}
First let $u = \frac{x}{2}$:
\begin{equation}
I = \int \sqrt{1 + \sin(u)} \cdot 2\:du = 2\int \sqrt{1 + \sin(u)}\:du
\end{equation}
We now employ the Weierstrauss Substitution $t = \tan\left(\frac{u}{2}\right)$:
\begin{align}
I &= 2 \int \sqrt{1 + \frac{2t}{1 + t^2}} \cdot \frac{2}{1 + t^2}\:dt = 4 \int \frac{t + 1 }{\left(t^2 + 1 \right)^{\frac{3}{2}}} \:dt = 4\left[ \int \frac{t}{\left(t^2 + 1\right)^{\frac{3}{2}}}\:dt+ \int \frac{1}{\left(t^2 + 1\right)^{\frac{3}{2}}}\:dt \right] \nonumber ]\\
&= 4\left[ -\frac{1}{\sqrt{t^2 + 1}} + J\right]
\end{align}
For the remaining integral $J$ let $t = \tan(s)$:
\begin{align}
J &= \int \frac{1}{\left(\tan^2(s) + 1\right)^{\frac{3}{2}}} \cdot \sec^2(s)\:ds = \int \cos(s) \:ds = sin(s) + C = \sin\left(\arctan(t)\right) + C
\end{align}
Where $C$ is the constant of integration.
Thus,
\begin{equation}
I = 4\left[ -\frac{1}{\sqrt{t^2 + 1}} + J\right] = 4\left[ -\frac{1}{\sqrt{t^2 + 1}} + \sin\left(\arctan(t)\right)\right] + C
\end{equation}
Now $t = \tan\left(\frac{u}{2} \right) = \tan\left(\frac{x}{4}\right)$
Thus,
\begin{align}
I &= 4\left[ -\frac{1}{\sqrt{t^2 + 1}} + \sin\left(\arctan(t)\right) \right] + C = 4\left[ -\frac{1}{\sqrt{\tan^2\left(\frac{x}{4}\right) + 1}} + \sin\left(\arctan\left(\tan\left(\frac{x}{4}\right)\right)\right) \right] + C \\
&= 4\left[ -\cos\left(\frac{x}{4} \right) + \sin\left(\frac{x}{4} \right) \right] = 4\cdot \sqrt{2}\sin\left(\frac{x}{4} = \frac{\pi}{4} \right) + C
\end{align}