79. $\int\left(\sin \frac{x}{2}+\cos \frac{x}{2}\right)^{2} d x$.

Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.

79. $\int\left(\sin \frac{x}{2}+\cos \frac{x}{2}\right)^{2} d x$.
Solution. We have

$$
\begin{gathered}
\int\left(\sin \frac{x}{2}+\cos \frac{x}{2}\right)^{2} d x=\int\left(\sin ^{2} \frac{x}{2}+2 \sin \frac{x}{2} \cos \frac{x}{2}+\cos ^{2} \frac{x}{2}\right) d x= \\
=\int(1+\sin x) d x=\int d x+\int \sin x d x=x-\cos x+C
\end{gathered}
$$

Here we applied the formulas $(a+b)^{2}=a^{2}+2 a b+b^{2} ; \sin ^{2} \alpha+\cos ^{2} \alpha=1$; $2 \sin \alpha \cos \alpha=\sin 2 \alpha$.