Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Recipe

Compute a directional derivative and confirm steepest ascent

Use when: you have a differentiable f, a point x, and a unit direction u, and want D_uf(x) -- or you want to confirm which direction increases f fastest at x

Goal: the directional derivative D_uf(x) for the given direction, plus confirmation that no direction beats \nabla f(x)/\|\nabla f(x)\| for steepest increase

Taught in The gradient and directional derivatives in several variables, revisited

  1. 1

    List every partial derivative of f, then evaluate each one at the given point and collect the results into \nabla f(x).

    Example

    For f(x,y)=x^2-xy+y^2: f_x=2x-y, f_y=-x+2y, so \nabla f(x,y)=(2x-y,\,-x+2y) and \nabla f(1,1)=(1,1).

    Why: the gradient is exactly this vector of partials, and every later step in this recipe works directly from it.

  2. 2

    Confirm u has length exactly 1 -- if it doesn't, divide it by its own length first. Then compute the dot product \nabla f(x)\cdot u.

    Example

    u=\left(\tfrac1{\sqrt2},\tfrac1{\sqrt2}\right): D_uf(1,1)=(1,1)\cdot\left(\tfrac1{\sqrt2},\tfrac1{\sqrt2}\right)=\tfrac1{\sqrt2}+\tfrac1{\sqrt2}=\sqrt2\approx1.414.

    Why: this is the definition, D_uf(x)=\nabla f(x)\cdot u, and the dot product only reports the correct rate of change when u has length exactly 1.

  3. 3

    Compute D_vf(x) for some other candidate unit direction v and check that it comes out smaller than the value from Step 2.

    Example

    v=(1,0): D_vf(1,1)=(1,1)\cdot(1,0)=1, which is smaller than D_uf(1,1)=\sqrt2\approx1.414 from Step 2.

    Why: by Cauchy-Schwarz, D_vf(x)=\nabla f(x)\cdot v\le\|\nabla f(x)\|\,\|v\|=\|\nabla f(x)\| for any unit v, with equality exactly when v points along \nabla f(x) -- so no direction can ever beat the gradient's own.