Example 2. Compute the integral

$$
\int_{C}\left(z^{2}+z \bar{z}\right) d z
$$

where $C-$ is the arc of the circle $\{z \mid=1(0 \leqslant \arg z \leqslant \pi)$.
Solution. Let $z=e^{i \varphi}$, then $d z=i e^{i \varphi} d \varphi$ and

$$
\begin{aligned}
\int_{C}\left(z^{2}+z \bar{z}\right) d z & =\int_{0}^{\pi} i e^{i \varphi}\left(e^{i 2 \varphi}+1\right) d \varphi= \\
& =i \int_{0}^{\pi}\left(e^{i 3 \varphi}+e^{i \varphi}\right) d \varphi=\left.\left(\frac{1}{3} e^{i 3 \varphi}+e^{i \varphi}\right)\right|_{0} ^{\pi}=-\frac{8}{3}
\end{aligned}
$$