Skip to content

Optimization in two variables and Lagrange multipliers

The candidates for an extreme of a function of two variables are its critical points, where both partial derivatives are zero, and its singular points, where one fails to exist; the second derivative test sorts the critical points into maxima, minima and saddle points. On a closed, bounded region the boundary supplies candidates too. With a constraint such as a budget, Lagrange multipliers give the candidates: the points where each partial derivative of the objective is the same multiple of the matching partial derivative of the constraint.

In this topic

Taught
Before the final, flavour C
Questions
11
Total marks
33
Suggested time
55 min
Difficulty

Introductory to Capstone

Show the 3 hardest

Key results

Critical points
fx(a,b)=0andfy(a,b)=0f_x(a, b) = 0 \quad\text{and}\quad f_y(a, b) = 0

At any local maximum or minimum (a,b)(a, b) inside the domain where both partial derivatives exist; where one does not exist, (a,b)(a, b) is a singular point and a candidate too, as in one variable.

The second derivative test
D=fxxfyy−fxy2:{D>0, fxx>0:local minimumD>0, fxx<0:local maximumD<0:saddle pointD = f_{xx}f_{yy} - f_{xy}^{2}:\quad \begin{cases} D > 0,\ f_{xx} > 0: & \text{local minimum} \\ D > 0,\ f_{xx} < 0: & \text{local maximum} \\ D < 0: & \text{saddle point} \end{cases}

At a point where fx=fy=0f_x = f_y = 0 and the second partial derivatives are continuous nearby; D=0D = 0 gives no conclusion.

Extremes on a closed, bounded region
max⁡Rf and min⁡Rf occur at critical orsingular points inside Ror on its boundary\begin{aligned} &\max_{R} f \text{ and } \min_{R} f \text{ occur at critical or} \\ &\text{singular points inside } R \\ &\text{or on its boundary} \end{aligned}

When ff is continuous on a closed, bounded region RR; both extremes then exist.

Lagrange multipliers
fx=λ gx,fy=λ gy,g(x,y)=kf_x = \lambda\, g_x, \qquad f_y = \lambda\, g_y, \qquad g(x, y) = k

For some number λ\lambda, at any maximum or minimum of ff on the curve g(x,y)=kg(x, y) = k, when ff and gg have continuous partial derivatives and gxg_x, gyg_y are not both 0 there.

Read the theoryUBC Math 100 §16 Optimization of multivariable functionsUBC Math 100 §16.1 Local maximum and minimum valuesUBC Math 100 §16.2 Absolute minima and maximaUBC Math 100 §16.3 Lagrange multipliers

Worked example

Standard3 marks · 5 min

A company sells xx thousand wired and yy thousand wireless headphones a month. Its monthly profit, in thousands of dollars, is

P(x,y)=36x+24y−2x2−xy−2y2−50.P(x, y) = 36x + 24y - 2x^{2} - xy - 2y^{2} - 50.

Find the largest monthly profit, in thousands of dollars.

Strategy

Find the critical point of P, confirm with the second derivative test that it is a maximum, and evaluate P there.

Working

  1. Px=36−4x−y=0,Py=24−x−4y=0P_x = 36 - 4x - y = 0, \qquad P_y = 24 - x - 4y = 0

    The −xy term contributes −y to P_x and −x to P_y.

  2. y=36−4x⟹24−x−4(36−4x)=0⟹15x=120y = 36 - 4x \quad\Longrightarrow\quad 24 - x - 4(36 - 4x) = 0 \quad\Longrightarrow\quad 15x = 120

    Solve the first equation for y and substitute into the second.

  3. x=8,y=36−32=4x = 8, \qquad y = 36 - 32 = 4

    The only critical point.

  4. Pxx=−4,Pyy=−4,Pxy=−1,D=16−1=15>0P_{xx} = -4, \quad P_{yy} = -4, \quad P_{xy} = -1, \qquad D = 16 - 1 = 15 > 0

    D > 0 with P_xx < 0: a local maximum. P is a quadratic that curves down in every direction, so this is also its largest value overall.

  5. P(8,4)=288+96−128−32−32−50=142P(8, 4) = 288 + 96 - 128 - 32 - 32 - 50 = 142

    Evaluate P at the maximum, every term included.

Answer

Pmax⁡=142 (thousand dollars) at (8,4)P_{\max} = 142 \ \text{(thousand dollars) at } (8, 4)

The answer is 142 thousand dollars, from 8 thousand wired and 4 thousand wireless headphones.

Check

A thousand more or fewer of either kind, at (9, 4), (7, 4), (8, 5) or (8, 3), brings the profit down to 140, below 142.

Where this goes wrong

Dropping the −xy term when differentiating, so P_x = 36 − 4x and P_y = 24 − 4y. That moves the critical point to (9, 6), where the profit is only 130. The term says the two products compete for the same buyers, and it belongs in both partial derivatives.

On the paper

Find every critical point by solving fx=0f_x = 0 and fy=0f_y = 0 together, then classify each with DD, quoting the signs of DD and fxxf_{xx}.

Leans on

Partial derivatives, from Functions of two variables and partial derivatives

Your turn

Standard3 marks · 5 min

How many of the critical points of f(x,y)=x3−3x+y3−3y2f(x, y) = x^{3} - 3x + y^{3} - 3y^{2} are saddle points?

Answer this question

Practice questions

5 of the 11, across every level. Open a solution to read the working, or answer the question yourself and it counts towards your progress.

  • Introductory2 marks · 3 min

    The function f(x,y)=x2+xy+y2−5x−4yf(x, y) = x^{2} + xy + y^{2} - 5x - 4y has exactly one critical point, (a,b)(a, b). Find a+ba + b.

    Answer this question
  • Introductory2 marks · 3 min

    The function f(x,y)=x2+4xy+y2−6x−6yf(x, y) = x^{2} + 4xy + y^{2} - 6x - 6y has a critical point at (1,1)(1, 1). What does the second derivative test say about it?

    Answer this question
  • Standard3 marks · 5 min

    A thin wire is bent into the circle x2+y2=20x^{2} + y^{2} = 20, with lengths in centimetres. The temperature at the point (x,y)(x, y) of the wire is T(x,y)=30+2x−yT(x, y) = 30 + 2x - y degrees Celsius. Use Lagrange multipliers to find the lowest temperature on the wire.

    Answer this question
  • Challenging4 marks · 7 min

    Find the absolute minimum value of f(x,y)=x2+y2−6x−4yf(x, y) = x^{2} + y^{2} - 6x - 4y on the closed triangular region with vertices (0,0)(0, 0), (4,0)(4, 0) and (0,4)(0, 4).

    Answer this question
  • Capstone6 marks · 10 min

    A workshop’s output is Q=xyQ = x\sqrt{y} units, where xx is hours of labour at $25 an hour and yy is units of material at $50 each. Its budget is $2400. Use Lagrange multipliers to find the maximum output on this budget. Then find the maximum output on a budget of $3750, and give the increase.

    Give the increase in maximum output.

    Answer this question

Browse all 11 questions