The math optional, made finite. Daily Practice

Lagrange’s method of multipliers (constrained extrema)

At a Glance

Why This Chapter Matters

Lagrange multipliers appear in 8 of the last 13 years, predominantly as 20-mark Section A questions — each appearance can swing an attempt by two full parts. The method is universal: one procedure handles distances, volumes, applied word problems, and the abstract maximum-on-an-ellipsoid problems that UPSC particularly favours. Every question reduces to the same four-step skeleton; the only variation is recognising which type you are looking at and how many constraints are present.

Minimum Theory

The method. To find the extreme values of f(x,y,z)f(x,y,z) subject to a single constraint g(x,y,z)=0g(x,y,z)=0, form the Lagrangian L=fλgL=f-\lambda g and set all partial derivatives to zero: fx=λgx,fy=λgy,fz=λgz,g(x,y,z)=0.\frac{\partial f}{\partial x}=\lambda\frac{\partial g}{\partial x},\qquad \frac{\partial f}{\partial y}=\lambda\frac{\partial g}{\partial y},\qquad \frac{\partial f}{\partial z}=\lambda\frac{\partial g}{\partial z},\qquad g(x,y,z)=0. The geometric content: at an extremum the level surface of ff is tangent to the constraint surface, so their normals are parallel — f=λg\nabla f=\lambda\nabla g.

Two constraints. When there are two constraints g=0g=0 and h=0h=0, introduce two multipliers: f=λg+μh,g=0,h=0.\nabla f=\lambda\nabla g+\mu\nabla h,\qquad g=0,\qquad h=0. This gives five equations for the five unknowns (x,y,z,λ,μ)(x,y,z,\lambda,\mu). For the specific problem of extremising r2=x2+y2+z2r^2=x^2+y^2+z^2 on the intersection of a quadric and a plane, the trick is to multiply each gradient equation by its variable and sum — this identifies λ=r2\lambda=r^2 (see quadratic-form-extrema below).

Nature of critical points. Lagrange multipliers find stationary points; max or min must be confirmed separately. On a compact constraint (ellipse, sphere) the largest value is the maximum and the smallest the minimum. On an unbounded constraint (a plane), a single stationary point of x2+y2+z2x^2+y^2+z^2 is always a minimum since the function grows without bound.

Lagrange multipliers: the level curve of f is tangent to the constraint g=0 at the optimum — \nabla f\parallel\nabla g

Question Archetypes

Four patterns cover all Lagrange multiplier questions in this atom.

ArchetypeYou are seeing this when…
constrained-distanceminimise a squared distance or x2+y2+z2x^2+y^2+z^2 on a single constraint
applied-constrained-optimizationa word problem (cone, wire, box) with a fixed volume, length, or surface
symmetric-constrainedsymmetric objective (x2y2z2x^2y^2z^2, xyzxyz) on a symmetric constraint (sphere or ellipsoid)
quadratic-form-extremaextremise x2+y2+z2x^2+y^2+z^2 on a quadric and a plane — two constraints

constrained-distance (2 question(s); 2013, 2020)

Recognition Cues

Solution Template

  1. Write the squared distance/objective ff and the constraint g=0g=0.
  2. Set f=λg\nabla f=\lambda\nabla g and write all gradient equations.
  3. Solve for x,y,zx,y,z in terms of λ\lambda (or a single parameter kk).
  4. Substitute into g=0g=0 to find λ\lambda.
  5. Compute ff at each critical point; the smallest is the minimum.
  6. Verify geometrically using the point-to-plane formula d=ax0+by0+cz0d/a2+b2+c2d=|ax_0+by_0+cz_0-d|/\sqrt{a^2+b^2+c^2} as a check.

Worked Example(s)

2013 Paper 1, 2013-P1-Q3a (20 marks)

Find the shortest distance between the line y=102xy=10-2x and the ellipse x24+y29=1\dfrac{x^2}{4}+\dfrac{y^2}{9}=1 by Lagrange multipliers.

The distance from (x,y)(x,y) to the line 2x+y10=02x+y-10=0 is 2x+y10/5|2x+y-10|/\sqrt5. Minimise the squared distance f=(2x+y10)2f=(2x+y-10)^2 subject to g=x2/4+y2/91=0g=x^2/4+y^2/9-1=0.

Let k=2x+y10k=2x+y-10. The conditions f=λg\nabla f=\lambda\nabla g give 4k=λx/24k=\lambda x/2 and 2k=2λy/92k=2\lambda y/9, i.e. λx=8k,λy=9k.\lambda x=8k,\qquad \lambda y=9k.

The line does not meet the ellipse (discriminant of 25x2160x+364=025x^2-160x+364=0 is 10800<0-10\,800<0), so k0k\ne0, λ0\lambda\ne0. Solve: x=8k/λx=8k/\lambda, y=9k/λy=9k/\lambda. Substitute into g=0g=0: 64k24λ2+81k29λ2=25k2λ2=1    λ=±5k.\frac{64k^2}{4\lambda^2}+\frac{81k^2}{9\lambda^2}=\frac{25k^2}{\lambda^2}=1\;\Longrightarrow\;\lambda=\pm5k.

Two critical points:

  Shortest distance =5,  at (85,95) on the ellipse.  \boxed{\;\text{Shortest distance }=\sqrt5,\;\text{at }\Bigl(\tfrac{8}{5},\tfrac{9}{5}\Bigr)\text{ on the ellipse.}\;}


2020 Paper 1, 2020-P1-Q4c (20 marks)

Find the extreme value of u=x2+y2+z2u=x^2+y^2+z^2 subject to 2x+3y+5z=302x+3y+5z=30 by Lagrange’s method.

Set u=λg\nabla u=\lambda\nabla g with g=2x+3y+5z30g=2x+3y+5z-30: 2x=2λ,2y=3λ,2z=5λ    x=λ,y=3λ2,z=5λ2.2x=2\lambda,\quad 2y=3\lambda,\quad 2z=5\lambda\;\Longrightarrow\;x=\lambda,\quad y=\tfrac{3\lambda}{2},\quad z=\tfrac{5\lambda}{2}. Constraint: 2λ+9λ2+25λ2=19λ=302\lambda+\tfrac{9\lambda}{2}+\tfrac{25\lambda}{2}=19\lambda=30, so λ=30/19\lambda=30/19.

x=3019,y=4519,z=7519,umin=900+2025+5625361=45019.x=\frac{30}{19},\quad y=\frac{45}{19},\quad z=\frac{75}{19},\qquad u_{\min}=\frac{900+2025+5625}{361}=\frac{450}{19}.

This is a minimum (the constraint is a plane; uu\to\infty as the point recedes; no maximum exists). Geometric check: perpendicular distance from origin to 2x+3y+5z=302x+3y+5z=30 is 30/3830/\sqrt{38}, giving d2=900/38=450/19d^2=900/38=450/19 ✓.

  umin=45019,  at (3019,4519,7519).  \boxed{\;u_{\min}=\frac{450}{19},\;\text{at }\Bigl(\tfrac{30}{19},\tfrac{45}{19},\tfrac{75}{19}\Bigr).\;}

Common Traps


applied-constrained-optimization (2 question(s); 2015, 2022)

Recognition Cues

Solution Template

  1. Introduce variables for the dimensions and write ff (objective) and g=0g=0 (constraint) explicitly.
  2. Work with f2f^2 or a convenient power if it avoids square roots.
  3. Set f=λg\nabla f=\lambda\nabla g and solve for the ratio of variables.
  4. Use the constraint to recover actual values or the requested ratio.
  5. State the nature (min or max) by convexity, second derivative, or boundary argument.

Worked Example(s)

2015 Paper 1, 2015-P1-Q2b (13 marks)

A conical tent is of given capacity. Find the ratio of height to base radius for the least canvas.

Let rr = base radius, hh = height. Volume constraint: V=13πr2hV=\frac{1}{3}\pi r^2h (fixed). Canvas = lateral surface: S=πrr2+h2S=\pi r\sqrt{r^2+h^2} (minimise). Work with S2S^2 to eliminate the square root: S2=π2r4+9V2r2(after substituting h=3V/(πr2)).S^2=\pi^2r^4+\frac{9V^2}{r^2}\qquad\text{(after substituting }h=3V/(\pi r^2)\text{)}. Set ddrS2=0\tfrac{d}{dr}S^2=0: 4π2r3=18V2/r3r6=9V2/(2π2)4\pi^2r^3=18V^2/r^3\Rightarrow r^6=9V^2/(2\pi^2).

Then h2/r2=9V2/(π2r6)=2h^2/r^2=9V^2/(\pi^2r^6)=2, so   hr=2.  \boxed{\;\frac{h}{r}=\sqrt{2}.\;} S2S^2 is convex (S>0S'''>0 for all r>0r>0), so this is the global minimum.


2022 Paper 1, 2022-P1-Q2b (15 marks)

A wire of length ll is cut into two parts bent into a square and a circle. Use Lagrange’s method to find the least sum of areas.

Let the square use length xx and the circle use length yy, with x+y=lx+y=l. Areas: A1=x2/16A_1=x^2/16 (side =x/4=x/4), A2=y2/(4π)A_2=y^2/(4\pi) (radius =y/(2π)=y/(2\pi)). Minimise f=x2/16+y2/(4π)f=x^2/16+y^2/(4\pi) subject to g=x+yl=0g=x+y-l=0.

f=λg\nabla f=\lambda\nabla g: x8=λ,y2π=λ    y=πx4.\frac{x}{8}=\lambda,\quad\frac{y}{2\pi}=\lambda\;\Longrightarrow\;y=\frac{\pi x}{4}. Constraint: x(1+π/4)=lx=4l/(4+π)x(1+\pi/4)=l\Rightarrow x=4l/(4+\pi), y=πl/(4+π)y=\pi l/(4+\pi).

fmin=l2(4+π)2+πl24(4+π)2=l2(4+π)24+π4=  l24(4+π).  f_{\min}=\frac{l^2}{(4+\pi)^2}+\frac{\pi l^2}{4(4+\pi)^2}=\frac{l^2}{(4+\pi)^2}\cdot\frac{4+\pi}{4}=\boxed{\;\frac{l^2}{4(4+\pi)}.\;}

ff is strictly convex (sum of quadratics), confirming this is the global minimum.

Common Traps


symmetric-constrained (2 question(s); 2019, 2025)

Recognition Cues

Solution Template

  1. Set f=λg\nabla f=\lambda\nabla g and write the three gradient equations.
  2. Multiply each equation by the corresponding variable; observe all three products are equal.
  3. Conclude x2/a2=y2/b2=z2/c2x^2/a^2=y^2/b^2=z^2/c^2 (or x=y=zx=y=z on a sphere).
  4. Substitute into the constraint to find the common value.
  5. Confirm the nature: boundary (any variable =0=0) gives f=0f=0; the interior critical point is the maximum.

Worked Example(s)

2019 Paper 2, 2019-P2-Q4a (15 marks)

Find the maximum value of f=x2y2z2f=x^2y^2z^2 subject to x2+y2+z2=c2x^2+y^2+z^2=c^2, x,y,z>0x,y,z>0.

f=λg\nabla f=\lambda\nabla g: 2xy2z2=2λx2xy^2z^2=2\lambda x, etc. Since x,y,z>0x,y,z>0, divide by 2x,2y,2z2x,2y,2z: y2z2=λ,x2z2=λ,x2y2=λ    x=y=z.y^2z^2=\lambda,\quad x^2z^2=\lambda,\quad x^2y^2=\lambda\;\Longrightarrow\;x=y=z. Constraint: 3x2=c2x=c/33x^2=c^2\Rightarrow x=c/\sqrt3. Maximum: fmax=(c23)3=c627.f_{\max}=\left(\frac{c^2}{3}\right)^3=\frac{c^6}{27}. Boundary: any variable =0=0 gives f=0<c6/27f=0<c^6/27, confirming this is the maximum.   fmax=c627,  at x=y=z=c3.  \boxed{\;f_{\max}=\frac{c^6}{27},\;\text{at }x=y=z=\frac{c}{\sqrt3}.\;}

AM–GM check: with u=x2,v=y2,w=z2u=x^2,v=y^2,w=z^2: uvw3(u+v+w)/3=c2/3\sqrt[3]{uvw}\le(u+v+w)/3=c^2/3, so uvwc6/27uvw\le c^6/27, equality at u=v=wu=v=w ✓.


2025 Paper 2, 2025-P2-Q3b (20 marks)

Show that the volume of the greatest rectangular parallelepiped inscribed in x2/a2+y2/b2+z2/c2=1x^2/a^2+y^2/b^2+z^2/c^2=1 is 8abc/(33)8abc/(3\sqrt3).

The box centred at the origin with first-octant vertex (x,y,z)(x,y,z) on the ellipsoid has volume V=8xyzV=8xyz (8 octants). Maximise VV subject to g=x2/a2+y2/b2+z2/c21=0g=x^2/a^2+y^2/b^2+z^2/c^2-1=0.

V=λg\nabla V=\lambda\nabla g: 8yz=2λx/a28yz=2\lambda x/a^2, etc. Multiply each by x,y,zx,y,z respectively — all three give 8xyz=2λ()8xyz=2\lambda(\ldots), forcing x2a2=y2b2=z2c2.\frac{x^2}{a^2}=\frac{y^2}{b^2}=\frac{z^2}{c^2}. Call this tt; constraint gives 3t=1t=1/33t=1\Rightarrow t=1/3, so x=a/3,y=b/3,z=c/3x=a/\sqrt3,\,y=b/\sqrt3,\,z=c/\sqrt3.

  Vmax=8abc33=83abc9.  \boxed{\;V_{\max}=8\cdot\frac{abc}{3\sqrt3}=\frac{8\sqrt3\,abc}{9}.\;}

Common Traps


quadratic-form-extrema (2 question(s); 2014, 2016)

Recognition Cues

Solution Template

  1. Introduce two multipliers: (r2)=λg+μh\nabla(r^2)=\lambda\nabla g+\mu\nabla h.
  2. Write the three gradient equations.
  3. Key trick: multiply each equation by its variable and sum; using both constraints gives λ=r2\lambda=r^2.
  4. Express x,y,zx,y,z in terms of μ\mu and r2r^2; apply the plane constraint to get the secular equation: l21ar2+m21br2+n21cr2=0.\frac{l^2}{1-ar^2}+\frac{m^2}{1-br^2}+\frac{n^2}{1-cr^2}=0.
  5. Clear denominators; solve the resulting quadratic in r2r^2 for the two extreme values.
  6. Geometric interpretation: the constraint intersection is a central elliptical section of the ellipsoid; r1,r2r_1,r_2 are its semi-axes.

Worked Example(s)

2014 Paper 1, 2014-P1-Q3b (20 marks)

Find max/min of x2+y2+z2x^2+y^2+z^2 subject to ax2+by2+cz2=1ax^2+by^2+cz^2=1 and lx+my+nz=0lx+my+nz=0. Interpret geometrically.

With multipliers λ,μ\lambda,\mu, the gradient equations are 2x(1aλ)=μl2x(1-a\lambda)=\mu l, and analogously for y,zy,z. Multiply by x,y,zx,y,z and sum, then substitute both constraints: (x2+y2+z2)λ(ax2+by2+cz2)=1=μ2(lx+my+nz)=0    λ=r2.(x^2+y^2+z^2)-\lambda\underbrace{(ax^2+by^2+cz^2)}_{=1}=\frac{\mu}{2}\underbrace{(lx+my+nz)}_{=0}\;\Longrightarrow\;\lambda=r^2.

Solving: x=μl/[2(1ar2)]x=\mu l/[2(1-ar^2)], etc. Substitute into the plane condition lx+my+nz=0lx+my+nz=0:   l21ar2+m21br2+n21cr2=0.  \boxed{\;\frac{l^2}{1-ar^2}+\frac{m^2}{1-br^2}+\frac{n^2}{1-cr^2}=0.\;} This quadratic in r2r^2 yields the two squared extreme distances r12r_1^2 and r22r_2^2.

Geometric interpretation. The surface ax2+by2+cz2=1ax^2+by^2+cz^2=1 is an ellipsoid; the plane lx+my+nz=0lx+my+nz=0 through its centre cuts it in a central ellipse. The extreme values r1r_1 and r2r_2 are the semi-major and semi-minor axes of that ellipse.


2016 Paper 1, 2016-P1-Q3a (20 marks)

Find max/min of x2+y2+z2x^2+y^2+z^2 subject to x24+y25+z225=1\dfrac{x^2}{4}+\dfrac{y^2}{5}+\dfrac{z^2}{25}=1 and x+yz=0x+y-z=0.

Here a1=4,a2=5,a3=25a_1=4,a_2=5,a_3=25 and (l,m,n)=(1,1,1)(l,m,n)=(1,1,-1). The secular equation is: 44r2+55r2+2525r2=0.\frac{4}{4-r^2}+\frac{5}{5-r^2}+\frac{25}{25-r^2}=0. Clearing denominators gives 17r4245r2+750=017r^4-245r^2+750=0. Discriminant =24524(17)(750)=9025=952=245^2-4(17)(750)=9025=95^2: r2=245±9534    r2=10  or  r2=7517.r^2=\frac{245\pm95}{34}\;\Longrightarrow\;r^2=10\;\text{or}\;r^2=\frac{75}{17}.

  max(x2+y2+z2)=10,min(x2+y2+z2)=7517.  \boxed{\;\max(x^2+y^2+z^2)=10,\qquad\min(x^2+y^2+z^2)=\frac{75}{17}.\;}

Common Traps


Marks-Aware Writing

13-mark questions (2015): Set up in 2–3 lines, minimise S2S^2 via a single-variable derivative, state the ratio, confirm minimum by convexity. No geometry required.

15-mark questions (2019, 2022): Full Lagrange setup — write LL, state f=λg\nabla f=\lambda\nabla g, solve the system, apply the constraint, compute the extremum, confirm nature. Box the answer.

20-mark questions (2013, 2014, 2016, 2020, 2025): Introduce notation (1–2 lines), write all gradient equations clearly, show the key algebraic step (identification of λ\lambda, or the two-case split), apply the constraint, compute all critical values, state which is max/min and why. For 2014: include the geometric interpretation paragraph. For the secular-equation problems (2014, 2016): display the quadratic explicitly and show the discriminant.

Practice Set

YearPaper/QMarksArchetypeOne-line hint
2025P2-Q3b20symmetric-constrainedEqual ratios x2/a2=y2/b2=z2/c2x^2/a^2=y^2/b^2=z^2/c^2; factor 8 for full box; V=8abc/(33)V=8abc/(3\sqrt3)
2022P1-Q2b15applied-constrained-optimizationx/8=y/(2π)x/8=y/(2\pi); square gets 4l/(4+π)4l/(4+\pi) of wire; fmin=l2/[4(4+π)]f_{\min}=l^2/[4(4+\pi)]
2020P1-Q4c20constrained-distancex=λ,y=3λ/2,z=5λ/2x=\lambda,y=3\lambda/2,z=5\lambda/2; constraint gives 19λ=3019\lambda=30; minimum only on a plane
2019P2-Q4a15symmetric-constrainedDivide by 2x,2y,2z2x,2y,2z; symmetry forces x=y=z=c/3x=y=z=c/\sqrt3; fmax=c6/27f_{\max}=c^6/27
2016P1-Q3a20quadratic-form-extremaSecular eq with ai=(4,5,25)a_i=(4,5,25); quadratic 17s2245s+750=017s^2-245s+750=0; roots 1010 and 75/1775/17
2015P1-Q2b13applied-constrained-optimizationLateral surface only; S2=π2r4+9V2/r2S^2=\pi^2r^4+9V^2/r^2; minimise; h2/r2=2h^2/r^2=2
2014P1-Q3b20quadratic-form-extremaMultiply by x,y,zx,y,z, sum; identify λ=r2\lambda=r^2; secular eq li2/(1air2)=0\sum l_i^2/(1-a_ir^2)=0
2013P1-Q3a20constrained-distanceMinimise (2x+y10)2(2x+y-10)^2 on ellipse; λ=±5k\lambda=\pm5k; two points; shortest dist =5=\sqrt5

We've mapped all 13 years of this exam. Get new chapters, tools, and solutions as we release them — free.