Determine conditions on $X$ and $Y$ that make span$(X,Y)$ an involutive distribution. How does this affect the maximal integral submanifolds

differential-geometrydifferential-topologygeneral-topology

I've been thinking about the following problem:

Equip $\mathbb{R}^3$ with coordinates $(x,y,z)$ and define two vector fields $X$ and $Y$ by
$$X=\frac{\partial}{\partial x}+f(x,y)\frac{\partial}{\partial z},\hspace{.5 in}\text{and}\hspace{.5 in}Y=\frac{\partial}{\partial y}+g(x,y)\frac{\partial}{\partial z}.$$
Define the distribution $\Delta\subset T\mathbb{R}^3$ by
$$\Delta =\text{span}(X,Y).$$
Determine conditions on the functions $f(x,y)$ and $g(x,y)$ that imply $\Delta$ is involutive. What do your conditions imply about the maximal connected integral submanifolds of $\Delta$?

I've mostly worked out this question, however I'm stuck on the last question: to find how my conditions affect the maximal connected integral submanifolds of $\Delta$.

Here's my solution so far.

"Solution"

Note that
\begin{align*}
[X,Y]&=X(1)\frac{\partial}{\partial y}+X(g)\frac{\partial}{\partial z}-Y(1)\frac{\partial}{\partial x}-Y(f)\frac{\partial}{\partial z}\\
&=\left(\frac{\partial g}{\partial x}+f \frac{\partial g}{\partial z}\right)\frac{\partial}{\partial z}-\left(\frac{\partial f}{\partial y}+g\frac{\partial f}{\partial z}\right)\frac{\partial}{\partial z}\\
&=\left(\frac{\partial g}{\partial x}-\frac{\partial f}{\partial y}\right)\frac{\partial}{\partial z},
\end{align*}
where we have used that $f$ and $g$ are independent of $z$. Now $\Delta$ is involutive if and only if $[X,Y]\in\text{span}(X,Y)$, so we require the determinant of
$$\begin{pmatrix} 1 & 0 & f\\ 0 & 1 & g\\ 0 & 0 & \frac{\partial g}{\partial x}-\frac{\partial f}{\partial y} \end{pmatrix}$$
to vanish identically, i.e. we require
$$\frac{\partial g}{\partial x}=\frac{\partial f}{\partial y}.$$

My problem is that any curve following $X$ would be of the form $\alpha(t)=(t+x_0,y_0,F(t))$, where $F$ is some antiderivative of $f(t+x_0,y_0)$, and similiarly for $Y$. Since in this form $f$ is constant in the $y$-direction I don't see how the condition above will come into play. Is my thinking incorrect? Is one of my calculations wrong? Any help would be greatly appreciated. Thanks.

You found the condition for the commutator of $X$ and $Y$ to be in the span of $X$ and $Y$. This condition does not exhibit itself when you only move along either $X$ or $Y$. But your questions asks about the integral submanifold, not just integral curves of $X$ and $Y$ separately.
When you move first along $X$ for some time $t$ and then along $Y$ for some time $s$, you may not end up at the same position as if you reverse the order. The commutator $[X,Y]$ measures the extent to which the two positions differ when $t$ and $s$ are very small. If the commutator is in the span of $X$ and $Y$, it means that the direction of the offset is in the plane spanned by $X$ and $Y$. Otherwise, you would have left the distribution $\Delta$.