Stream function derivation and derivative problem??? I am having a problem with understanding the stream function and its derivation. I understand the following:
Continuity equation has to hold for a stream line, thus:
\begin{equation}
u \,dy - v \,dx = 0
\end{equation}
Now I assume that u is a function of x, and v is a function of y, both describing velocity. 
Now if we integrate this expression, we can arrive at a constant, which as to my understanding is the stream function:
\begin{equation}
\int u \,dy - v \,dx = \psi
\end{equation}
Now my confusion starts: I see the following expression around:
\begin{equation}
u = \frac{\delta \psi}{\delta \,y}
\end{equation}
how can the derivation of a constant not lead to zero??? And next, how is that expression found anyways? Here my attempt:
\begin{equation}
\int u(x) \, dy = \psi + \int v(y) \, dx
\end{equation}
taking the derivative with respect to y:
\begin{equation}
u(x) = \frac{\delta \psi}{\delta \,y} + \frac{\delta }{\delta y} v(y) x
\end{equation}
So I am left still with an extra term... What is going on? Thanks!
 A: What is going on here is simple and somewhat obfuscated by the notation. The equation
$$u(x,y) dx + v(x,y) dy = 0$$
can be understood through the corresponding planar autonomous system
$$u(x,y) \frac{dx}{dt} + v(x,y) \frac{dy}{dt} = 0.$$
This equation says that the trajectories of the autonomous system are perpendicular to the vector field $\begin{bmatrix} u(x,y) \\ v(x,y) \end{bmatrix}$. If $\frac{\partial u}{\partial y} = \frac{\partial v}{\partial x}$, then it turns out that $\begin{bmatrix} u(x,y) \\ v(x,y) \end{bmatrix}$ is the gradient of a function. This function is called the stream function; let's call it $\psi$. Because the trajectories of the autonomous system are perpendicular to $\nabla \psi$, $\psi$ is constant along the trajectories of the autonomous system. That is, $\psi(x(t),y(t))=\psi(x(0),y(0))$ for all $t$.
The statement "$\begin{bmatrix} u(x,y) \\ v(x,y) \end{bmatrix}$ is the gradient of $\psi$" amounts to saying that $\frac{\partial \psi}{\partial x} = u$ and $\frac{\partial \psi}{\partial y} = v$. There is no contradiction in these being nonzero, because a small perturbation only in the $x$ or $y$ direction in general will not keep us on the trajectory of the system (i.e. on the level set of $\psi$). Only $\frac{d \psi}{dt}$ should be expected to be zero.
