What differential equation does this function satisfy? Given the equation:
$$\nabla f(x) \times \nabla g(x) = 0$$
for two scalar fields $f$ and $g$. It follows that when this is satisfied $h(f,g)=0$ for some function $h$. The question is to find a smooth function $h$ given functions $f$ and $g$ such $h(s,t)=0$ if and only if there exists a solution to: $s=f(x), t=g(x), \nabla f(x) \times \nabla g(x) = 0$ and otherwise $h(s,t)\neq 0$.
Can we infer a differential equation that is satisfied by $h$? Or any other properties?
If we write $h$ as:
$$h(f,g) = \sum a_{nm} f^n g^m$$
is there a way to find values of $a_{nm}$ knowing the functions $f(x)$ and $g(x)$ ?
My first attempt at trying to write a function which if it converges (which it probably doesn't) seems to have the right properties
$$ \frac{1}{h(u,v)} = \int \frac{1}{\left((u-f(x))^2+(v-g(x))^2 + |\nabla f(x) \times \nabla g(x)|^2\right)^2 } dx^3 $$
Theoretically this has the right properties but I can't simplify it. e.g. whenever the top equation is satisfied the RHS becomes infinite which implies the function h is zero as required.
 A: Here is a way to get the function $h$. The idea is that one can define the smooth map $F \, : \, \mathbb{R}^3 \, \to \, \mathbb{R}^2$ by
\begin{align}
s &= f(x)\\
t &= g(x) 
\end{align} where $x = (x_1, x_2, x_3) \in \mathbb{R}^3 $. The restriction $$\nabla f(x) \times \nabla g(x) = 0$$ for all $x \in \mathbb{R}^3 $ implies that the tangent map $DF(x)$ (the Jacobi 2 x 3 matrix of partial derivatives of $f$ and $g$) is singular, meaning that it is not a submersion, i.e. it is not locally surjective. Let us assume that for $x \in  U \, \subseteq \, \mathbb{R}^3$ in an open domain $U$ the gradient $\nabla f(x) \neq 0$. Then the image $F(U)$ is not an open subset of $\mathbb{R}^2$ but a one dimensional smooth curve because $\text{rank} \, DF(x) = 1$. To construct this curve, take a solution $x = x(\sigma)$, with $\sigma \in \mathbb{R}$, of the system of ODEs
$$\frac{dx}{d\sigma} = \nabla f(x)$$ Then the curve in question is given by 
\begin{align}
s &= f\big(x(\sigma)\big) = s(\sigma)\\
t &= g\big(x(\sigma)\big) = t(\sigma)
\end{align} 
Indeed, when you check the derivative 
\begin{align}
\frac{ds}{d\sigma} &= \nabla f\big(x\big) \cdot \frac{dx}{d\sigma} = |\nabla f(x)| \neq 0\\
\frac{dt}{d\sigma} &= \nabla g\big(x\big) \cdot \frac{dx}{d\sigma} = (\nabla f(x) \, \cdot \, \nabla g(x))
\end{align}
This means that the function $s = s(\sigma)$ can be inverted and written as 
$\sigma = \sigma(s)$. After that, one can substitute $\sigma$ in $t = t(\sigma)$ obtaining the function $t = \phi(s) = t\big(\sigma(s)\big)$. Consequently, one can write $h(s,t)$ as 
$$h(s,t) = k\big( \phi(s) - t \big)$$ for any non-constant smooth $k(r)$ function with $r \in \mathbb{R}$.  
Edit. On the one hand, the system of ODE's
$$\frac{dx}{d\sigma} = \nabla f(x)$$ is not necessarily solvable explicitly. On the other hand, however, this system is not that important, I just took it as a way of systematically obtaining a curve $x = x(\sigma)$ transverse to the level surfaces $C_s = \{x \, : \, f(x) = s\}$ for $s \in \mathbb{R}$ (or a subset of it). You might as well take $$\frac{dx}{d\sigma} = \nabla g(x)$$ or if you work locally, simply take the straight line 
$$x = x(\sigma) = x_0 + \sigma \, \nabla f(x_0)$$ which for $\sigma$ near $0$ is still transverse to the level surfaces $C_s$ near the point $x_0$ (in some cases that line could be transverse to almost all of the level surfaces). Basically, any explicit curve $x=x(\sigma)$ transverse to the level surfaces $f(x) = s$ (or transverse to the more or less the same level surfaces $g(x) = t$) will do the job. Whatever works.  
A: If the cross product is zero, then you have 3 equations looking like $f_xg_y=f_yg_x$, with subscripts denoting partial derivatives.  So one example of a scalar $h$ is $h=f_xg_y-f_yg_x$.  To have a stronger statement, i.e. $h(f,g)=0 \implies \nabla f \times \nabla g =0$ will require a more complex $h$ or a vector-valued $h$.
