Steepest descent on a graph surface (source code)

= Steepest descent on a graph surface
{title2=$v=-\frac{U}{|p|\sqrt{1+|p|^2}}(p,|p|^2),\quad p=\nabla f$}

On the <graph of a function> $z=f(x,y)$, assume $f$ is <differentiable>, its planar <gradient> $p$ is nonzero, and speed $U>0$ is measured by the three-dimensional <Euclidean norm>. The upward <unit normal vector> is $n=(-p,1)/\sqrt{1+|p|^2}$. Projecting the downward vertical vector $-e_z$ onto the tangent plane gives $-(p,|p|^2)/(1+|p|^2)$. By the <Cauchy-Schwarz inequality>, normalizing this projected vector produces the tangent direction with greatest height decrease at the prescribed speed, giving the displayed <velocity>. Its vertical component is $-U|p|/\sqrt{1+|p|^2}$, and its horizontal direction is parallel to $-\nabla f$. Consequently its planar paths agree with negative <gradient flow> up to a change of time, although the speeds differ. Where $p=0$, every tangent direction has zero first-order height change and this normalized formula is undefined.