Another complex analysis question I am going to have an analysis exam soon and I found the following question in a past paper:
Evaluate the integral counterclockwise
$$\int |z| \overline{z} \, dz$$
where y is the closed curve consisting of the upper semicircle
$$|z| = R,\quad R>0$$
and the segment
$$ \{z = x + iy \text{ complex} : -R < x < R, y = 0 \}$$
Could someone please tell me how to solve this? I can't seem to get my head around as to how I should start.
 A: Start with the definition of path integrals:
$$
\int_\gamma f(z) \, dz = \int_a^b f(\gamma(t))\gamma'(t) \,dt
$$
For the upper semicircle, we have the following parametrization:
$$
\gamma_1(t) = R e^{i t} \quad t \in [0, \pi]
$$
We have $\gamma'(t) = iRe^{it}$. Also notice that on the circle $|z| = R$ and $\overline{z} = R e^{-it}$. Plug into the definition to get:
$$
\int_{\gamma_1} f(z) \,dz = \int_0^\pi iR^3 \,dt = i \pi R^3
$$
Can you do the same for the second segment and sum up the results?
A: $$ \int |z| \bar z \, dz $$
Integrating along the segment from $-R$ to $R$ on the real line, we just have
$$
\left(\int_{-R}^0 + \int_0^R\right) |z|\bar z \, dz = \int_{-R}^0 -z^2\,dz + \int_0^R z^2\,dz.
$$
By symmetry, these cancel each other out.
Now look at the semicircle:
$$
\int |z| \bar z \, dz = R\int \bar z\,dz = R \int_0^\pi R(\cos\theta-i\sin\theta)\, d(R(\cos\theta+i\sin\theta))
$$
$$
= R^3 \int_0^\pi (\cos\theta-i\sin\theta) (-\sin\theta+i\cos\theta)\,d\theta
$$
$$
= R^3 \int_0^\pi i\,d\theta = R^3 i \pi.
$$
A: $$\int_{[-R,R]}|z|\overline z\,dz=\int\limits_{-R}^R|x|(x-iy)\,dx\stackrel{y=0}=\int\limits_{-R}^0-x\cdot x\,dx+\int\limits_0^R x\cdot x\,dx=\left.\left.-\frac{1}{2}\left[x^2\right|_{-R}^0+x^2\right|_0^R\right]=$$
$$=-\frac{1}{2}\left(-R^2+R^2\right)=0$$
$$\int\limits_{|z|=R}|z|\overline z\,dz=R\int\limits_0^\pi Re^{-it}(Rie^{it}dt)=\ldots$$
