Artificial intelligent assistant

For the positively oriented circle, $\oint_{|z|=1}\frac{2\Re(z)}{z+1}dz=......$ > For the positively oriented circle, $\oint_{|z|=1}\frac{2\Re(z)}{z+1}dz=......$ > > (a) $0$ > > (b) $\pi i$ > > (c) $2\pi i$ > > (d) $4\pi i$ $$\oint_{|z|=1}\frac{2\Re(z)}{z+1}dz$$ $$=\oint_{|z|=1}\frac{z^2+1}{z(z+1)}dz$$ ($\because$ $z$ is in the unit circle, $\overline{z}=\frac{1}{z})$ $$=2\pi if(0)=\pi i$$ But in the book, answer is $0$. Where did I go wrong? Please help me.

By letting $z=e^{i\theta}$ we have $dz= i e^{i\theta}d\theta$ and the wanted integral equals

$$ \int_{-\pi}^{\pi}\frac{\text{Re}(e^{i\theta})}{1+e^{i\theta}}ie^{i\theta}\,d\theta =i\int_{-\pi}^{\pi}\frac{\cos\theta(e^{i\theta}+1)}{2+2\cos\theta}\,d\theta=i\color{blue}{\int_{-\pi}^{\pi}\frac{\cos\theta}{2}\,d\theta}-\color{red}{\int_{-\pi}^{\pi}\frac{\sin\theta\cos\theta}{2(1+\cos\theta)}\,d\theta}$$ where the blue integral equals $0$ by the periodicity of $\cos$ and red integral is, strictly speaking, undefined like $\int_{-1}^{1}\frac{dx}{x}$, but its principal value equals zero since the integrand function is odd.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 359ebe1532de5f4c2314955ef378f923