irrotational vector field may be written as grad of a scalar field How do you prove that a vector field $\mathbf E$ that is irrotational ($\nabla \times \mathbf E =\mathbf0 $) may be written as $-\nabla \phi$ for a scalar field $\phi$? I have been trying to use the identity about the expansion of $\nabla(\mathbf {A\cdot B})$ but can't thing of a suitable second vector field. I'm sure I remember it being something like $\phi \mathbf A$ for some scalar field $\phi$ and fixed vector $\mathbf A$. I have also tried having the second vector as $\nabla \mathbf A$ but that doesn't seem to work either. Maybe it must be some function of $\mathbf E$? I can't find this proof anywhere! 
EDIT: everything here is in simply connected space
 A: Let's $\mathbf E=(E_x,E_y,E_z)$. For every closed curve $l$ by http://en.wikipedia.org/wiki/Stokes%27_theorem we have
$$
\int_l E_xdx+E_ydy+E_zdz=\iint_S\nabla \times \mathbf E\cdot d\mathbf S=0,
$$
where $S$ is any surface bounded by $l$. Therefore $E_xdx+E_ydy+E_zdz$ is complete differential for some function $\phi$. So 
$$
\mathbf E =-\nabla (-\phi).
$$
A: Concider $X$ to be $\mathbb{R}^3$ with a line $\{x=y=0\}$ removed. Then $(-y/(x^2+y^2),x/(x^2+y^2), 0)$ has curl zero but is not a gradient of anything, because the integral from this field over a circle winding around the removed line is nonzero. 
You can prove your statement by defining $\phi$ to be a curve integral from the field $E$, the curve starting in a fixed point and ending in any given point $x$. However, what you need is, the curve integral should depend only on the initial and final point of a curve. For irrotational field, this holds if any closed curve is the boundary of a disc, or if it can be at least "contracted" in the underlying space (use Stokes). In other words, the space needs to be simply connected.
What is a bit interesting and fascinating on this kind of problems is, that all inputs -- curl is zero, grad is zero -- are very "local" and "smooth properties", but the existence of $\phi$ depends on something as coarse as "topology" (which doesn't see the "smooth" structure)..
