How to determine if a vector field is the curl of another vector field? I want to see if the Stokes theorem can be applied to a given flux integral of the vector field $F$.  To do so, I need to determine if the vector field $F$ is the curl of some other vector field.  How would I determine this?
I found an algorithm that seems to work out, but perhaps someone can advise me where the divergence free comes into-play to power this algorithm.

Let $\textbf F$ be a Euclidean vector-field such that $\nabla \cdot \textbf{F}=0$. If there exists a vector-field $\textbf A$ such that $F=\nabla \times A,$ then we have the following set of equations. Additionally, I have found that they have the corresponding solutions, where $\oplus $ is the exclusive or symbol:
$$\frac{\partial A_z}{\partial y}-\frac{\partial A_y}{\partial z}=F_x: A_z=\int F_x dy \oplus A_y=-\int F_x dz $$

$$-\left(\frac{\partial A_z}{\partial x}-\frac{\partial A_x}{\partial z}\right)=F_y: A_z=-\int F_ydx \oplus A_x=\int F_y dz$$

$$\frac{\partial A_y}{\partial x}-\frac{\partial A_x}{\partial y}=F_z: A_y=\int F_zdx \oplus A_x=-\int F_zdy$$

These exclusive or $\oplus $ solutions yield two choices for $\textbf A$
You can determine whether a vector field can be written as the curl of another vector field (in $\mathbb{R}^3$) by looking at it's divergence.  Assume a vector field $F$ can be written as the curl of another vector field, call it $G$.  Then $F = \text{curl}~G$.  Take the divergence of $F$, and say $\text{div}~F \not= 0$.  Then, as implied by Clairaut's Theorem, $\text{div}~F = \text{div}(\text{curl}~G) = 0$, which contradicts $\text{div}~F \not= 0$.  So therefore $F$ is not the curl of another vector field if $\text{div}~F \not= 0$.  So if $\text{div}~F = 0$, then the field is the curl of another field.  It also means the vector field is incompressible (solenoidal)! 

S/O to Cameron Williams for making me realize the connection to divergence there.