I have a complex integral $$\int_{|z|=r}x \, dz$$ for the positive portion of the circle. I know that this integral seems easy enough but I am having trouble with it, and I'm fairly certain my answer is incorrect.
I wanted to use a parameter such that $x=r\cos\theta$, so we then have $dz=dx+i\,dy=dx$ since there is no reason to have have the $i\,dy$ since the imaginary part is equal to $0$. So now I have the double integral
$$\int^r_0\int^\pi_0 r \cos\theta \, dx$$
which equals $0$ since integration the $\cos\theta$ gives $\sin\theta$ and evaluated from $0$ to $\pi$ makes the integral evaluate to $0$. Am i misinterpreting part of the question? Way off base?
The book suggests to also solve the problem by realizing $x=\frac{1}{2}\left(z+\frac{r^2}{z}\right)$ along the circle. For this portion of the problem I assume that I would integrate the above by $z$ as if it were a normal calculus problem, but I have problems with what to put as upper and lower limits.
Thanks in advance!
\begin{align} & \int_{z=|r|,\ \operatorname{Im}z\ge0} x \, dz = \int_0^\pi (r\cos\theta)(ire^{i\theta}\,d\theta) = \int_0^\pi (r\cos\theta) ir (\cos\theta+i\sin\theta)\,d\theta \\[10pt] = {} & r^2 i \int_0^\pi \cos^2\theta\,d\theta - r^2 \int_0^\pi \cos\theta\sin\theta\,d\theta \\[10pt] = {} & r^2 i \frac \pi 2 + 0. \end{align}