A few assumptions need to be made before the stream function can be determined. First, the flow is assumed to be steady and compressible. Next, the flow is only in the x and y plan (no z-direction flow). Finally, the velocity field needs to satisfy the
continuity equation,

For the given velocity field, the continuity equation becomes,
(a) + (-a) = 0
which satisfies the continuity equation.
Recall, the stream function, ψ, is a single function that satisfies both functions,

Substituting the horizontal velocity, u, and integrating gives,
ψ = axy + by + h(x)
where h(x) is any function of x (not y). Now, use this function with the vertical velocity, v, to give
-ay + cx = -[ ay + 0 + h'(x) ]
where h'(x) is simply d[h(x)]/dx. The "ay" terms cancel giving,
h'(x) = -cx |