If C denotes the counterclockwise unit circle, then the value of the contour integral $$\frac{1}{2\pi j} \oint_c Re\{ z\} \, dz \quad \text{is _____ }?$$
Method $1$:
$$Re\{ z\} = \frac{z + \bar{z}}{2} \quad \dots (1)$$
$$\implies \frac{1}{2\pi j} \oint_c Re\{ z\} \, dz = \frac{1}{2\pi j} \oint_c \frac{z + \bar{z}}{2} \, dz$$
$$=\frac{1}{2\pi j} \oint_c \frac{z }{2} \, dz + \frac{1}{2\pi j} \oint_c \frac{\bar{z}}{2} \, dz \quad \dots (2)$$
Now using Cauchy-Integral theorem, we get:
$$\frac{1}{2\pi j} \oint_c \frac{z }{2} \, dz=0 \quad \dots (3)$$
as $f(z)=z$ is differentiable at every point inside C ($|z|=1$)
and $\bar{z}=\frac{1}{z}$ for C( $|z|=1$),
so, $eq(2)$ can be rewritten as:
$$\frac{1}{2\pi j} \oint_c \frac{z }{2} \, dz + \frac{1}{2\pi j} \oint_c \frac{\bar{z}}{2} \, dz = 0 + \frac{1}{2}\frac{1}{2\pi j} \oint_c \frac{1}{z} \, dz$$
$$\frac{1}{2} .1=\frac{1}{2}$$
Method $2$:
Let $z=re^{j \theta}$
$$\implies \frac{1}{2\pi j} \oint_c Re\{ z\} \, dz = \frac{1}{2\pi j} \oint_c r cos (\theta) \, d(re^{j \theta}) \quad \dots (4)$$
Now, for C : $r=1 $ and $ \theta \to 0 $ to $2\pi $
$$=\frac{1}{2\pi j} \int_0^{2\pi} cos (\theta) e^{j \theta}j \, d\theta$$
$$=\frac{1}{2\pi } \int_0^{2\pi} cos (\theta) e^{j \theta} \, d\theta \quad \dots (5)$$
Now,
$$\int e^{ax}cos(bx) dx = \frac{e^{ax}}{a^2 +b^2}\{ a cos(bx) + b sin (bx)\} +C \quad \dots (6)$$
$$\implies \int_0^{2\pi} cos (\theta) e^{j \theta} \, d\theta = [\frac{e^{jx}}{j^2 +1^2}\{ j cos(x) + sin (x)\}]_0^{2\pi}$$
Here, denominator is coming to $0$ , so we can't use the formula described in $eq(6)$;
Hence how to evaluate $eq(5)$ ?
Any help or suggestions please...
As has been noted, method 2 should be$$\frac{1}{2\pi j}\oint_cr\cos\theta d(re^{j\theta})=\frac{1}{2\pi}\int_0^{2\pi}r^2\cos\theta e^{j\theta}d\theta=\frac{r^2}{2\pi}\int_0^{2\pi}\cos^2\theta d\theta=\frac12r^2=\frac12$$(although I'd rather insert $r=1$ at the start), as $\int_0^{2\pi}\cos\theta\sin\theta d\theta=0$.