Why does the vector field $(x,y) = x \mathbf{i} + y\mathbf{j}$ have an exact differential but the vector field $(-y,x)$ does not? There are other ways of asking this question such as why does a vector field that has non zero curl not have an exact differential. In this example  if I have a gradient field like $(x,y)$ and the exact differential I assume can be easily found by integration why is it that the field $(-y,x)$ that produces a nice graph of a swirling vector field with non zero curl not have an exact differential?  What is it geometrically that prohibits this? 
 A: $\newcommand{\dd}{\partial}\newcommand{\Vec}[1]{\mathbf{#1}}$A vector field $F = (F_{1}, F_{2})$ defined in some subset of the plane is gradient if and only if there exists a partially-differentiable function $f$ such that
$$
\frac{\dd f}{\dd x} = F_{1},\qquad
\frac{\dd f}{\dd y} = F_{2}.
$$
If each of these functions is itself continuously-differentiable, then $f$ is twice continuously differentiable, which implies the mixed partial derivatives are equal, i.e.,
$$
\frac{\dd F_{1}}{\dd y}
  = \frac{\dd^{2} f}{\dd y\, \dd x}
  = \frac{\dd^{2} f}{\dd x\, \dd y}
  = \frac{\dd F_{2}}{\dd x}.
$$
For the vector field $F(x, y) = (-y, x)$, however,
$$
\frac{\dd F_{1}}{\dd y} = -1 \neq 1 = \frac{\dd F_{2}}{\dd x}.
$$
Analytically, that's why $F$ is not gradient.
Geometrically, a gradient field cannot have closed flow lines: A short, pleasant, chain rule calculation shows that if $F = \nabla f$, and if $\Vec{x}$ is a non-constant flow line of $F$, then the function
$$
g(t) = f\bigl(\Vec{x}(t)\bigr)
$$
is strictly increasing. In particular, there do not exist $a < b$ such that $\Vec{x}(a) = \Vec{x}(b)$, i.e., the flow line $\Vec{x}$ is not closed.
That said, the Penrose staircase is a striking visual joke answering the question, "What would the graph of a function look like if the gradient had a closed flow line?"
A: General theory for that provides differential forms. A form $\alpha$ is exact if there is a form $\beta$ such that $\alpha=d\beta$. The form $\beta$ is often called a potential of $\alpha$. A form $\alpha$ is closed if $d\alpha=0$. Because of $d^2=0$ a potential is always defined up to a closed form, i.e. $a=d\beta=d(\beta+\gamma)$ where $d\gamma=0$. This is why a potential energy of a body on Earth is defined up to constant, and why we have $+C$ in indefinite integrals.
Obviously every exact form is closed because $d^2=0$. The converse is not always true, this is why not all real functions have an indefinite integral, and why we have so rich complex analysis. But sometimes the converse is true, namely the Poincaré lemma says that in contractible domains every closed form is exact, that is on such domains any form with vanishing differential have a potential. For example,


*

*In $\mathbb R^3$ for 1-forms: if curl is zero, then the field have a potential. Such fields called conservative, the work of the field along a closed path is always zero. 

*In $\mathbb R^3$ for 2-forms: if divergence is zero (solenoidal field: without sources and drains), then the field have potential (called "vector potential").


Note that in oriented Euclidean $\mathbb R^3$ we can identify 1- and 2-forms with vector fields, the isomorphisms provided by so-called "musical isomorphisms" (raising and lowering indices by metric) and the Hodge star. In the general case we haven't such identification.
There are many books on such subjects, I recommend "Mathematical Analysis II" by Zorich, and (just for fun) "Mathematical Methods of Classical Mechanics" by Arnold.
