I'm working on the following problem:
Let $f$ be holomorphic on an open set $U$ which is the interior of a disk or a rectangle. Let $\gamma : [0,1] \rightarrow U$ be a $C^1$ curve satisfying $\gamma (0) = \gamma(1)$. Prove that $$ \oint_\gamma f(z)dz = 0$$
My attempt:
Now, since $U$ is either an open disk or open rectangle and $f$ is holomorphic on $U$, $\exists H$ on $U$ s.t. $$ \frac{\partial H}{\partial z} \equiv F$$ on U. Since $\gamma$ is a closed curve, it follows that $$ H(\gamma (1)) - H(\gamma (0)) = 0.$$ Further, since $H$ is holomorphic on U, we also have that \begin{align*} H(\gamma (1)) - H(\gamma (0)) &= \oint_\gamma \frac{\partial H}{\partial z} (z) dx \\ &= \oint_\gamma f(z) dz \\ \end{align*} Thus, $$ \oint_\gamma f(z)dz = 0 $$
My qualm about this problem is that it seems like we are just proving the Cauchy Integral Formula, but now we're allowing $U$ to be an open rectangle. I don't seem to use this fact except in the first step, in concluding that, in either the case of $U$ being an open disk or open rectangle, $f$ being holomorphic guarantees a holomorphic antiderivative on $U$. Is this the only part of the proof where this comes into play?
This is just a restricted version of Cauchy's theorem. And in order to prove it we use the Cauchy-Riemann equations together with Green's theorem, since $\gamma$ is $C^1$ and $U$ is simply connected in both cases. For a general simply connected $U$, this implies the existence of $H$ not the other way around.
However, in these special cases, $U$ is a convex set, in particular star-shaped, and the primitive $H$ can be furnished applying the Poincaré Lemma to $\omega = f(z)dz$, which is closed by Cauchy-Riemann equations. Clearly the existence of a primitive solves the problem.
Therefore, the special choice for $U$ is used to ensure the existence of a primitive without invoking Cauchy's theorem.