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]

Examples from Constrained extrema

All examples from Constrained extrema.

Back to Constrained extrema

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.

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.

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.

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.

On this page