Steepest Ascent Method
The steepest ascent method finds a local maximum of f(x,y) by repeatedly moving in the direction of the gradient.
Gradient
The gradient of f(x,y) is
f(x,y) increases fastest in the direction of ∇f and decreases fastest in the opposite direction.
Procedure
Given a starting point (x0,y0)
- Evaluate the gradient ∇f(xi,yi)
- Search along the gradient direction for the hi that maximizes
- Set g′(hi)=0 and solve for hi
- Update
Worked Example
Maximize
Solution Reveal Hide
with initial guess x0=−1, y0=1. The partial derivatives are
∂x∂f=2y+2−2x,∂y∂f=2x−4yIteration 1
∂x∂f(−1,1)=6,∂y∂f(−1,1)=−6g(h0)=f(−1+6h0, 1−6h0)=−180h02+72h0−7g′(h0)=−360h0+72=0⟹h0=0.2x1=−1+6(0.2)=0.2,y1=1−6(0.2)=−0.2Iteration 2
∂x∂f(0.2,−0.2)=1.2,∂y∂f(0.2,−0.2)=1.2g(h1)=f(0.2+1.2h1, −0.2+1.2h1)=−1.44h12+2.88h1+0.2g′(h1)=−2.88h1+2.88=0⟹h1=1x2=0.2+1.2(1)=1.4,y2=−0.2+1.2(1)=1Iteration 3
∂x∂f(1.4,1)=1.2,∂y∂f(1.4,1)=−1.2g(h2)=f(1.4+1.2h2, 1−1.2h2)=−7.2h22+2.88h2+1.64g′(h2)=−14.4h2+2.88=0⟹h2=0.2x3=1.4+1.2(0.2)=1.64,y3=1−1.2(0.2)=0.76
The iterations continue toward the maximum at (2,1), where f(2,1)=2.
Wolfram Mathematica notebooks
A companion notebook for this note. Open it in Mathematica and evaluate the cells to reproduce the worked example.
The summary notebook defines every function used in this module, with
documentation and no examples, as a starting point for your own
problems.
Written by November 3, 2026 · 1 min read ·
Available offline