Lagrange multipliers

Lagrange multipliers are a mathematical tool for optimizing functions subject to constraints. They allow solving problems like:

"Find the maximum/minimum of f(x), given g(x)=c."

The method augments the original problem into a new system:

L(x,λ)=f(x)−λ(g(x)−c).

We solve dL=0 for points (x,λ). I.e.,

∂f∂xidxi−λ∂g∂xidxi−(g(x)−c)dλ=0(∂f∂xi−λ∂g∂xi)dxi−(g(x)−c)dλ=0

Geometric Interpretation
At the solution point:

Indeed, relaxing the constraint to c+δ moves the optimum a little, say by d, so Δf≈∇f⋅d, Δg≈∇g⋅d=δ, and using ∇f=λ∇g:

Δf≈λ∇g⋅d=λΔg=λδ.

Pasted image 20250628091359.png

Possible motivation for Lagrange definition of L

Step 1: The Problem, Visualized

Imagine you are a hiker trying to find the highest point on a mountain, but you are forced to stay on a specific trail.

At a constrained optimum, the gradient of the objective function (∇f) must be parallel to the gradient of the constraint function (∇g).

If two vectors are parallel, one must be a scalar multiple of the other. We'll call that scalar λ (lambda).

∇f(x)=λ∇g(x)

Step 3: The Stroke of Genius – Creating L

So, at this point, Lagrange knows he has to solve a system of two conditions for a simple 2D problem:

  1. ∇f(x,y)=λ∇g(x,y) (The geometric tangency condition)
  2. g(x,y)=c (The original constraint)

The first condition can be rewritten as ∇f(x,y)−λ∇g(x,y)=0. In terms of components, this is:

And the constraint is:

Lagrange's genius was to see that this entire system of equations is exactly what you get if you define a single function and find its unconstrained critical points.

He asked: "What function, if I take its partial derivatives with respect to x, y, and even λ, would give me this exact system of equations?"

This leads directly to the definition of the Lagrangian:

L(x,y,λ)=f(x,y)−λ(g(x,y)−c)

2. Coming from Mercury perihelion problem:

Lagrange Multipliers: Constraint Enforcement

When you have constraints like:

  1. gabuaub=−1 (normalization of 4-velocity),
  2. ∇a(ρua)=0 (mass conservation),
    you can impose them in two ways:
  3. Restrict the space of fields to only those satisfying the constraints (as you mentioned).
  4. Use Lagrange multipliers to dynamically enforce the constraints via the action principle.

We write a Modified Action with Multipliers:

Enew=E+∫Mλ1(gabu⊙au⊙b+1)volg+∫Mλ2∇a(ρ⊙u⊙a)volg+…

where:

Example: Normalization Constraint
For the 4-velocity normalization:

δEnewδλ=0⟹gabuaub=−1. δEnewδua=original terms+2λgabub.

This modifies the dust equations to dynamically preserve the constraint.