Solution (source code)

= Solution

Parametrize a <streamline> by $\mathbf r(s)$ with $d\mathbf r/ds=\mathbf u(\mathbf r(s))$. The <chain rule> gives
$$
\frac d{ds}H(\mathbf r(s))=\nabla H\cdot\frac{d\mathbf r}{ds}=\mathbf u\cdot\nabla H=0.
$$
Therefore \b[$H$ is constant along every streamline]. A different regular parametrization merely multiplies this derivative by a scalar and gives the same conclusion. For time-dependent flow, the claim concerns streamlines at a fixed time, rather than <Lagrangian trajectories>.