# Does integral of a complex function over any closed curve being zero imply the function has a primitive?

It is easy to see that if the function $f(z)$ has a primitive (i.e. antiderivative) then $$\int_{\Gamma} f(z)dz=0$$ for any closed curve $\Gamma$. Is the converse true, that is if the integral is $0$ for any closed curve $\Gamma$ then does it imply that $f(z)$ has a primitive ? Please provide a proof or a counterexample.

-

If $f$ is continuous and its domain is connected, the answer is yes. This is known as Morera's Theorem.

-
I think connectedness of domains can be disposed of as long as we require that every closed curve to be contained in one single component, but what about continuity? I can't think right now of a counterexample to Morera's Theorem: a function whose integral on any closed curve is zero in some domain but has no primitive...? –  DonAntonio Sep 10 '12 at 12:13
@DonAntonio $f(z)=0$ if $z\ne0$, $f(0)=1$. I know it is a trivial counterexample, but it is still a counterexample. –  Julián Aguirre Sep 10 '12 at 13:20
This is not Morera's theorem, which gives a criterion for determining that a function is analytic. Here we need a criterion for determining that the function has an antiderivative on the domain, which is stronger. –  Jonas Meyer Jun 25 at 22:02
Fix any point $a$ in your domain. Given $z$ in your domain, let $\gamma_z$ be any curve in your domain that starts at $a$ and ends at $z$. Define $F(z)=\int_{\gamma_z}f(w)\,dw$.
Your hypothesis implies that $F(z)$ does not depend on the choice of $\gamma_z$. You can prove that $F' = f$.