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

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.

-

## marked as duplicate by Jonas Meyer, Jean-Claude Arbaut, Weapon of Choice, Tomás, Rick DeckerAug 22 at 19:37

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$.

-

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 '13 at 22:02

You are nearly correct in the answer pointing out Morera's theorem the only thing missing is that it must be true for ALL integral in the region on either a rectangular or triangle closed contour, and it can be any old region (non empty connected open set)not necessary simply-connected which Cauchy's theorem would hold. Morera's theorem DOES imply the existence of a primitive on R hence f is analytic by the fact that all derivatives of an analytic function exist.

-
No, it is not Morera's theorem. That would tell you that the function is analytic, but analytic functions do not always have primitives. –  Jonas Meyer Aug 22 at 18:13