Harmonic function on an annulus

Let $g=u_x-iu_y$ and $\gamma(t)=l\cdot e^{it}$ for $t\in[0,2\pi]$ and $r<l<R$. Clearly $g$ is holomorphic on $R$. Now set $$C=\frac{1}{2\pi i}\int_\gamma g(z) dz$$ This can be seen to be a real number. Now note that if $\tilde{\gamma}$ is a closed path in $R$ with winding number $m$ around $0$, then $$\frac{1}{2\pi i}\int_\tilde{\gamma} \left(g(z)-\frac{C}{z}\right)\,dz=\frac{m}{2\pi i}\int_\gamma g(z) dz - \frac{C}{2\pi i}\int_\tilde{\gamma} \frac{dz}{z}=mC-mC=0 $$ where the first equality follows from Cauchy's theorem since $m\gamma-\tilde{\gamma}$ is nullhomotopic in $R$ and $g$ holomorphic. Hence the function $$f(z)=\int_{z_0}^z\left(g(z)-\frac{C}{z}\right)\, dz+u(z_0)$$ is well-defined and holomorphic on $R$, where $z_0\in R$ fixed and we integrate over an arbitrary path from $z_0$ to $z$ within $R$.

Now the Cauchy-Riemann equations imply $$u(z)=\mathrm{Re} f(z)+C\log|z|$$


Here is a paper with more general resoult yet similar reasoning.