Advanced Mathematics

Optimisation in Many Variables

Finding the highest and lowest points of a function of several variables: where the gradient is zero, sorted by the Hessian.

Needs a step first: 11

At a smooth minimum or maximum every partial derivative is zero, so the candidates are the solutions of ∇f=0⃗\nabla f = \vec 0. The matrix of second derivatives, the Hessian, then tells them apart: positive curvature in every direction is a minimum, negative in every direction a maximum, and mixed signs a saddle, which goes up one way and down another. In many dimensions saddles are far more common than minima. Training a model is minimising a loss in millions of variables, which is why gradient descent and convexity come next.

Where it shows up: Gradient descent, Lagrange multipliers and every model's training loop are ways of solving ∇f=0⃗\nabla f = \vec 0 when it can't be done by hand.

How to hold it: In your head

See critical points as where the gradient vanishes, and read the Hessian's eigenvalues as curvature: all positive a minimum, all negative a maximum, mixed a saddle.

What knowing it looks like

  • Find all critical points of a two-variable function by solving ∇f=0⃗\nabla f = \vec 0.
  • Classify each as a minimum, maximum or saddle from the Hessian's determinant and trace, or its eigenvalues.
  • Sketch the contour lines near a saddle point.

Test yourself

Find and classify all critical points of f(x,y)=x3−3x+y2f(x, y) = x^3 - 3x + y^2, and give the value of ff at each.
Show the worked answer
∇f=(3x2−3, 2y)=0⃗\nabla f = (3x^2 - 3,\ 2y) = \vec 0 gives x=±1x = \pm1, y=0y = 0. The Hessian is (6x002)\begin{pmatrix} 6x & 0 \\ 0 & 2 \end{pmatrix}. At (1,0)(1, 0) it is diag(6,2)\mathrm{diag}(6, 2), both positive: a local minimum with f=−2f = -2. At (−1,0)(-1, 0) it is diag(−6,2)\mathrm{diag}(-6, 2), mixed signs: a saddle with f=2f = 2. There is no global minimum, since f→−∞f \to -\infty as x→−∞x \to -\infty.

Needs a step first: 11

Learn it with an AI

Copy this prompt into any AI assistant. It will take you through step by step at your level and finish with the test above.

Be my maths tutor. I'm learning "Optimisation in Many Variables" (Undergraduate I tier): Finding the highest and lowest points of a function of several variables: where the gradient is zero, sorted by the Hessian.
I already know: Partial Derivatives and the Gradient, Rates of Change and Extremes.
Teach it Socratically: first ask what I already know; then explain the core idea with one concrete example and why it's true; then give me three problems, one at a time, easy to hard. Wait for my answer, check every step, and point out mistakes without giving the answer away.
Finish by testing me with this: Find and classify all critical points of $f(x, y) = x^3 - 3x + y^2$, and give the value of $f$ at each.
Use LaTeX for formulas. When you say where it's used later (machine learning, quantum mechanics), be specific.

On the way to

Recommended