Type a command or search the notes. Tab cycles completions. Up and down recall history when blank. Escape dismisses, then leaves the prompt.
MATH
[1251]

Constrained extrema

Lagrange multipliers and distance optimisation on curves and surfaces.

This page optimises a function on a curve given by an equation g(x,y)=0g(x,y)=0, without parameterising the curve. The feasible points form a level curve of gg, so the gradient-normal theorem makes ∇g\nabla g normal to it. At a constrained extremum, ∇f\nabla f must point along the same normal.

The resulting Lagrange multiplier method replaces the boundary parameterisation whenever g=0g=0 is the natural description of a boundary. The page ends with distance problems.

[DEFINITION]

Level set

For F:D→RF:D\to\mathbb{R}, with D⊆RnD\subseteq\mathbb{R}^n and c∈Rc\in\mathbb{R}, the level set of FF at level cc is

{x∈D:F(x)=c}.\{\mathbf{x}\in D:F(\mathbf{x})=c\}.
[THEOREM]

Gradient normal to a level set

Let F:D→RF:D\to\mathbb{R} be C1C^1 on an open neighbourhood of x0\mathbf{x}_0 and let

S={x∈D:F(x)=c}.S=\{\mathbf{x}\in D:F(\mathbf{x})=c\}.

If x0∈S\mathbf{x}_0\in S and ∇F(x0)≠0\nabla F(\mathbf{x}_0)\ne\mathbf{0}, then ∇F(x0)\nabla F(\mathbf{x}_0) is normal to SS at x0\mathbf{x}_0.

The multiplier condition

[DEFINITION]

Constrained extremum

Let ff be an objective function and let

C={(x,y):g(x,y)=0}C=\{(x,y):g(x,y)=0\}

be its feasible set. A constrained maximum or minimum of ff is a maximum or minimum of ff when the comparison is restricted to points in CC.

The constraint limits the directions in which we may move. A point can fail to be an unconstrained stationary point and still be a constrained extremum, because the directions in which ff would increase or decrease are not feasible.

[THEOREM]

Lagrange multipliers

Suppose C={(x,y):g(x,y)=0}C=\{(x,y):g(x,y)=0\} is a nonempty closed and bounded curve and ff and gg have continuous first partial derivatives on an open set containing CC. Then ff attains a maximum and a minimum on CC. At each constrained extremum where

∇g(x,y)≠0,\nabla g(x,y)\ne\mathbf{0},

there is a scalar λ∈R\lambda\in\mathbb{R} such that

∇f(x,y)=λ∇g(x,y){\nabla f(x,y)=\lambda\nabla g(x,y)}

together with

g(x,y)=0.{g(x,y)=0}.

The equation says that the gradients are parallel, not that they have equal length: λ\lambda records a scale and possibly a reversal of direction.

The regularity condition ∇g≠0\nabla g\ne\mathbf{0} is essential. A feasible point where ∇g=0\nabla g=\mathbf{0} is a singular constraint point, where the multiplier condition is not guaranteed, so it must be checked separately along with any corners or endpoints introduced by an inequality constraint. Compactness and continuity still guarantee that the extrema exist.

[PROOF]

At a regular point of CC, at least one of gx,gyg_x,g_y is nonzero, so the constraint is locally a smooth curve. A tangent vector v\mathbf{v} to that curve satisfies

∇g⋅v=0\nabla g\cdot\mathbf{v}=0

because gg is constant along the constraint. At a constrained extremum, the first-order change of ff must also vanish for every feasible tangent vector:

∇f⋅v=0.\nabla f\cdot\mathbf{v}=0.

In the plane, both gradients are therefore normal to the same tangent line. Since ∇g≠0\nabla g\ne\mathbf{0}, the two normals are parallel, so ∇f=λ∇g\nabla f=\lambda\nabla g for some scalar λ\lambda. The existence of maximum and minimum values follows by applying the extreme-value theorem to the closed and bounded constraint curve.

[METHOD]

Optimise subject to one equality constraint

To optimise ff subject to g=0g=0:

  1. check where ∇g=0\nabla g=\mathbf{0} on the constraint and retain any such singular feasible points for separate analysis;
  2. compute ∇f\nabla f and ∇g\nabla g;
  3. solve ∇f=λ∇g,g=0;\nabla f=\lambda\nabla g, \qquad g=0;
  4. evaluate ff at every solution;
  5. compare the values to identify the constrained maximum and minimum.

The system has three unknowns xx, yy and λ\lambda in the two-variable case. Symmetry and factorisation often reduce the algebra. Solving the multiplier equations produces candidates; it does not replace checking singular points or comparing objective values.

[EXAMPLE]

Re-solving the disk problem with multipliers

Optimise

f(x,y)=x2+4xy+y2f(x,y)=x^2+4xy+y^2

subject to

g(x,y)=x2+y2−1=0.g(x,y)=x^2+y^2-1=0.

The gradients are

∇f=(2x+4y4x+2y),∇g=(2x2y).\nabla f = \begin{pmatrix} 2x+4y\\ 4x+2y \end{pmatrix}, \qquad \nabla g = \begin{pmatrix} 2x\\ 2y \end{pmatrix}.

The multiplier equations are

2x+4y=2λx,4x+2y=2λy,x2+y2=1.2x+4y=2\lambda x, \qquad 4x+2y=2\lambda y, \qquad x^2+y^2=1.

After dividing the first two equations by 22,

(1−λ)x+2y=0,2x+(1−λ)y=0.(1-\lambda)x+2y=0, \qquad 2x+(1-\lambda)y=0.

The unit-circle constraint rules out (x,y)=(0,0)(x,y)=(0,0), so the coefficient matrix must have determinant zero:

(1−λ)2−4=0.(1-\lambda)^2-4=0.

Thus λ=3\lambda=3 or λ=−1\lambda=-1.

If λ=3\lambda=3, then y=xy=x. The constraint gives 2x2=12x^2=1, so the two same-sign points

(12,12),(−12,−12)\left(\frac1{\sqrt2},\frac1{\sqrt2}\right), \qquad \left(-\frac1{\sqrt2},-\frac1{\sqrt2}\right)

give f=3f=3.

If λ=−1\lambda=-1, then y=−xy=-x. The two opposite-sign points

(12,−12),(−12,12)\left(\frac1{\sqrt2},-\frac1{\sqrt2}\right), \qquad \left(-\frac1{\sqrt2},\frac1{\sqrt2}\right)

give f=−1f=-1. This reproduces the boundary part of the closed-disk example, found there by parameterisation.

Distance optimisation

[METHOD]

Minimise a distance through its square

For a fixed point p\mathbf{p}, minimise the squared distance

D(x)=∥x−p∥2D(\mathbf{x})=\|\mathbf{x}-\mathbf{p}\|^2

instead of the distance ∥x−p∥\|\mathbf{x}-\mathbf{p}\|. Since the square-root function is increasing on non-negative values, the points that minimise or maximise the two objectives are the same.

The squared expression avoids a square root and usually gives a polynomial objective. If the constraint has a visible normal direction, the shortest segment can sometimes be found geometrically before writing the multiplier system.

[EXAMPLE]

The closest point on a plane

Find the point on

2x−y+z=32x-y+z=3

closest to

p=(−1,1,2).\mathbf{p}=(-1,1,2).

The plane has normal vector

n=(2,−1,1).\mathbf{n}=(2,-1,1).

The shortest segment from p\mathbf{p} to the plane is perpendicular to the plane, so the desired point has the form

x=p+tn=(−1,1,2)+t(2,−1,1).\mathbf{x} =\mathbf{p}+t\mathbf{n} =(-1,1,2)+t(2,-1,1).

Substituting into the plane equation gives

2(−1+2t)−(1−t)+(2+t)=3,2(-1+2t)-(1-t)+(2+t)=3,

so −1+6t=3-1+6t=3 and t=2/3t=2/3. Therefore

x=(13,13,83).{ \mathbf{x} =\left(\frac13,\frac13,\frac83\right) }.

This nearest point is the orthogonal projection of p\mathbf{p} onto the plane. The same point results from minimising

(x+1)2+(y−1)2+(z−2)2(x+1)^2+(y-1)^2+(z-2)^2

subject to 2x−y+z=32x-y+z=3, but the normal direction makes the geometric solution shorter.

[EXAMPLE]

Closest and furthest points on a quartic curve

Find the points on

x4+7x2y2+y4=1x^4+7x^2y^2+y^4=1

that are closest to and furthest from the origin. Minimise and maximise

d2=x2+y2.d^2=x^2+y^2.

Both expressions depend only on x2x^2 and y2y^2. Set

u=x2,v=y2,u,v≥0.u=x^2, \qquad v=y^2, \qquad u,v\ge0.

The problem becomes optimising s=u+vs=u+v subject to

u2+7uv+v2=1.u^2+7uv+v^2=1.

At an interior constrained extremum in the first quadrant,

(11)=μ(2u+7v7u+2v).\begin{pmatrix} 1\\ 1 \end{pmatrix} =\mu \begin{pmatrix} 2u+7v\\ 7u+2v \end{pmatrix}.

The two components on the right must be equal, so

2u+7v=7u+2v,u=v.2u+7v=7u+2v, \qquad u=v.

Substituting into the constraint gives

9u2=1,u=v=13,9u^2=1, \qquad u=v=\frac13,

and hence d2=u+v=2/3d^2=u+v=2/3.

The boundary cases in the first quadrant are u=0u=0 or v=0v=0. The constraint then gives the other variable as 11, so d2=1d^2=1. The feasible set in (u,v)(u,v) is closed and bounded and these interior and boundary cases exhaust its extrema. Restoring the signs independently, the closest points are

(±13,±13){ \left(\pm\frac1{\sqrt3},\pm\frac1{\sqrt3}\right) }

with distance 2/3\sqrt{2/3}, while the furthest points are

(±1,0), (0,±1){(\pm1,0),\ (0,\pm1)}

with distance 11.

[EXAMPLE]

The closest point on a parabola

Let

x0=(0,a),a>0,\mathbf{x}_0=(0,a), \qquad a>0,

and find the point on y=x2y=x^2 closest to x0\mathbf{x}_0. A point on the parabola is

p(x)=(x,x2).\mathbf{p}(x)=(x,x^2).

The squared distance is

D(x)=∥p(x)−x0∥2=x2+(x2−a)2.D(x) =\|\mathbf{p}(x)-\mathbf{x}_0\|^2 =x^2+(x^2-a)^2.

Differentiate:

D′(x)=2x+4x(x2−a)=2x(1+2x2−2a).\begin{aligned} D'(x) &=2x+4x(x^2-a)\\ &=2x(1+2x^2-2a). \end{aligned}

The stationary values satisfy

x=0orx2=a−12.x=0 \qquad\text{or}\qquad x^2=a-\frac12.

The second possibility exists only when a≥1/2a\ge1/2. Since D(x)→∞D(x)\to\infty as ∣x∣→∞|x|\to\infty, compare the stationary candidates:

D(0)=a2,D(0)=a^2,

whereas at x2=a−1/2x^2=a-1/2,

D(x)=a−14.D(x)=a-\frac14.

Their difference is

a2−(a−14)=(a−12)2≥0.a^2-\left(a-\frac14\right) =\left(a-\frac12\right)^2\ge0.

Therefore, if 0<a≤1/20<a\le1/2, the closest point is

(0,0).{(0,0)}.

If a>1/2a>1/2, the two closest points are

(±a−12, a−12).{ \left( \pm\sqrt{a-\frac12}, \ a-\frac12 \right) }.

At a=1/2a=1/2 the two non-zero candidates merge with the origin.

The economic applications page uses the same multiplier geometry to allocate a fixed budget between inputs: the budget line is the constraint and the production gradient replaces ∇f\nabla f.

On this page