3.18. Calculate

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

where $L-$ is the arc of the circle $|z|=1, \arg z \in[0, \pi]$.
Solution. It is clear that $L=\left\{z \in \mathbb{C} \mid z=e^{i \varphi}, \varphi \in[0, \pi]\right\}$, then

$$
\begin{gathered}
\int_{L}\left(z^{2}+2 z \bar{z}\right) d z=\left\{\begin{array}{l}
z=e^{i \varphi}, \varphi \in[0, \pi], \\
d z=i e^{i \varphi} d \varphi, \\
\bar{z}=\overline{e^{i \varphi}}=e^{-i \varphi}
\end{array}\right\}=\int_{0}^{\pi}\left(e^{2 i \varphi}+2 e^{i \varphi} e^{-i \varphi}\right) i e^{i \varphi} d \varphi= \\
=\int_{0}^{\pi}\left(e^{2 i \varphi}+2\right) d e^{i \varphi}=\left.\left(\frac{1}{3} e^{3 i \varphi}+2 e^{i \varphi}\right)\right|_{0} ^{\pi}=-\frac{14}{3} .
\end{gathered}
$$