I encountered a problem asking me to calculating the contour integral as shown in the picture.
I am asked to compute the energy using the following equation. $$E=-\frac{J}{2} n^{2} \operatorname{Re} \oint_{\mathcal{C}} \mathrm{d} z \frac{\arg z}{z}$$ I think I just need to compute the bigger loop integral minus the smaller loop integral.
So I let $z_{1}=Re^{i\omega t}$, $z_{2}=r_{0}e^{i\omega t}$, then $\oint\mathrm{d} z \frac{\arg z}{z}$ can be converted to $\oint i\omega^{2}t dt$, which yield the result $2\pi^{2}i$, and taking the real part I simply get nothing, which does not lead to the result.
Anyone know where did this go wrong?

We can parameterize the contour as follows:
\begin{align*} \gamma_{1}(t) = t \quad &t \in \left[r_{0},R\right]\\ \gamma_{2}(\theta) = Re^{i\theta} \quad & \theta\in(0,2\pi)\\ \gamma_{3}(t) = -t \quad& t\in \left[-R,-r_{0}\right]\\ \gamma_{4}(\theta) = r_{0}e^{-i\theta} \quad &\theta \in (-2\pi, 0) \end{align*} Hence
\begin{align*} \oint_{\gamma_{1}+...+\gamma_{4}} \frac{\arg{z}}{z} dz =& \int_{r_{0}}^{R} \frac{\arg(\gamma_{1}(t))}{\gamma_{1}(t)}\gamma_{1}'(t) dt + \int_{0}^{2\pi} \frac{\arg(\gamma_{2}(\theta))}{\gamma_{2}(\theta)}\gamma_{2}'(\theta) d\theta+ \int_{-R}^{-r_{0}} \frac{\arg(\gamma_{3}(t))}{\gamma_{3}(t)}\gamma_{3}'(t) dt + \int_{-2\pi}^{0} \frac{\arg(\gamma_{4}(\theta))}{\gamma_{4}(\theta)}\gamma_{4}'(\theta) d\theta\\ =& \int_{r_{0}}^{R} \frac{0}{t} dt + i\int_{0}^{2\pi} \theta d\theta + \int_{-R}^{-r_{0}} \frac{2\pi}{t} dt + i\int_{-2\pi}^{0} \theta d\theta \\ =& i\int_{0}^{2\pi} \theta d\theta - \int_{r_{0}}^{R} \frac{2\pi}{t} dt - i\int_{0}^{2\pi} \theta d\theta \\ =&- 2\pi \int_{r_{0}}^{R}\frac{1}{t}dt\\ =& 2\pi \ln\left(\frac{r_{0}}{R}\right) \end{align*}