Sitemap
Anirudh Singh

Anirudh Singh

A Complex three dimensional being embedded in four dimensional spacetime

Lagrange Multipliers

Lagrange Multipliers for Dummies

3 min readJan 30, 2025

--

Imagine you are hiking in the mountains and want to reach the highest possible point while staying on a specific trail. You can’t just go straight up (the highest point overall); you are constrained to the path of the trail.

Get Anirudh Singh’s stories in your inbox

Join Medium for free to get updates from this writer.

The Lagrange multiplier method helps us solve this kind of problem in mathematics. It is a technique used to find the maximum or minimum of a function when there is a constraint.

  1. Without Constraints: If you were free to go anywhere on the mountain, you would just find the peak.
  2. With Constraints: Since you must stay on the trail, the highest point you can reach is where the slope of the mountain and the direction of the trail are aligned (or proportional).

Mathematically

  • Suppose you want to maximize a function f(x,y) (like elevation on a mountain).
  • You must stay on a constraint g(x,y)=0 (like a hiking trail).
Press enter or click to view image in full size

The Lagrange multiplier method finds points where the gradient (slope) of f(x,y) is parallel to the gradient of g(x,y). This ensures that you’re at the highest or lowest possible value without leaving the trail.

Definition

The Lagrange multiplier method is used to find the extrema (maximum or minimum) of a function subject to constraints.

Problem Setup

Suppose we want to maximize or minimize a function

subject to a constraint

Condition for Extrema

The extrema occur where the gradients of f and g are parallel, meaning there exists a scalar λ (called the Lagrange multiplier) such that:

additionally, the constraint equation must be satisfied:

The method finds points where f is optimal under constraints by ensuring f and g have aligned gradients. The Lagrange multipliers λ indicate how much the constraint affects the optimal value.

References:

--

--

Written by Anirudh Singh

A Complex three dimensional being embedded in four dimensional spacetime