Conditions on a $1$-form in $\mathbb{R}^3$ for there to exist a function such that the form is closed. What are the conditions on a $1$-form in $\mathbb{R}^3$ for there to exist a function such that the form is closed? More precisely, given a point, $p$, what are conditions on the coefficients of a $1$-form $\omega$ so that there is a non-zero function, $\lambda$, such that $d(\lambda \omega)=0$ in some neighborhood of $p$. I can derive equations from the definitions, but is there an equation that doesn't rely on $\lambda$?
With work, this is equivalent to solving $f_i \dfrac{\partial \lambda}{\partial x^j}-f_j \dfrac{\partial \lambda}{\partial x^i}=\lambda (\dfrac{\partial f^j}{\partial x^i}-\dfrac{\partial f^i}{\partial x^j})$ for $i,j\in \{1, 2, 3\}$.
 A: A smooth function $\lambda$ such that $d(\lambda \omega) =0$ is called an integrating factor for $\omega$.  If $\omega$ is a nonvanishing $1$-form, then $\omega$ has a nonvanishing integrating factor in a neighborhood of each point if and only if $\omega\wedge d\omega=0$.  
The necessity of this condition follows from the Poincaré lemma: If $d(\lambda\omega)=0$ and $\lambda$ doesn't vanish, then locally $\lambda\omega = du$ for some smooth function $u$, and substituting $\omega = \lambda^{-1}du$ leads to $\omega\wedge d\omega = 0$.
To prove sufficiency, assume $\omega\wedge d\omega = 0$.  Then Cartan's lemma shows that in a neighborhood of $p$ there is a smooth $1$-form $\beta$ such that $d\omega = \omega\wedge \beta$.  (This is easy to prove if you set $\omega^1=\omega$ and choose smooth $1$-forms $\omega^2,\dots, \omega^n$ near $p$ so that $(\omega^1,\dots,\omega^n)$ form a local coframe, and express $d\omega$ in terms of this coframe.) The Frobenius theorem then shows that locally there are smooth coordinates $(u^1,\dots,u^n)$ near $p$ such that $\omega = f\,du^1$ for some nonvanishing smooth function $f$, and we can take $\lambda = 1/f$ as an integrating factor. 
Note that the condition $\omega\wedge d\omega = 0$ is always true on a $2$-manifold, because every $3$-form is zero. Thus every smooth nonvanishing $1$-form on a $2$-manifold has an integrating factor in a neighborhood of each point. 
If $\omega$ vanishes somewhere, things get more complicated.  In that case, $\omega\wedge d\omega=0$ is necessary for the existence of a local integrating factor, but not sufficient.  A counterexample is provided by the form $\omega = y\,dx$ on $\mathbb R^2$. I don't know if there is a simple sufficient condition in this case.
