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
At any local maximum or minimum inside the domain where both partial derivatives exist; where one does not exist, is a singular point and a candidate too, as in one variable.
- The second derivative test
At a point where and the second partial derivatives are continuous nearby; gives no conclusion.
- Extremes on a closed, bounded region
When is continuous on a closed, bounded region ; both extremes then exist.
- Lagrange multipliers
For some number , at any maximum or minimum of on the curve , when and have continuous partial derivatives and , 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
A company sells thousand wired and thousand wireless headphones a month. Its monthly profit, in thousands of dollars, is
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
The −xy term contributes −y to P_x and −x to P_y.
Solve the first equation for y and substitute into the second.
The only critical point.
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.
Evaluate P at the maximum, every term included.
Answer
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 and together, then classify each with , quoting the signs of and .
Leans on
Partial derivatives, from Functions of two variables and partial derivatives
Your turn
How many of the critical points of are saddle points?
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 has exactly one critical point, . Find .
Answer this questionStrategy
Both partial derivatives exist everywhere, so the critical points are where both are zero. Differentiate with respect to each variable, holding the other fixed, and solve the two equations together.
Working
With y held fixed, xy differentiates to y; with x held fixed, to x.
Solve f_x = 0 for y and substitute into f_y = 0.
Back-substitute. Check: f_x = 4 + 1 − 5 = 0 and f_y = 2 + 2 − 4 = 0.
The sum asked for.
Answer
The answer is 3, from the critical point (2, 1).
Check
f(2, 1) = −7, while each neighbour (1, 1), (3, 1), (2, 0) and (2, 2) gives −6, so (2, 1) sits at the bottom of the bowl.
Where this goes wrong
Leaving out the xy term when differentiating, so f_x = 2x − 5 and f_y = 2y − 4. That gives (5/2, 2) and a sum of 4.5. With y held fixed, xy is a constant times x and differentiates to y.
Leans on
Partial derivatives, from Functions of two variables and partial derivatives
- Introductory2 marks · 3 min
The function has a critical point at . What does the second derivative test say about it?
Answer this questionStrategy
The second derivative test: compute D = f_xx f_yy − (f_xy)² at the critical point. Its sign is read first; only when D > 0 does the sign of f_xx decide between a maximum and a minimum.
Working
Confirms that (1, 1) is a critical point.
The second partials are constants because f is quadratic.
The mixed partial is squared, and here it outweighs the product of the other two.
Along the line y = x, f rises away from (1, 1); along y = 2 − x it falls.
Answer
The answer is a saddle point, since D = −12 is negative.
Check
f(1, 1) = −6, but f(1.1, 1.1) = −5.94 is higher and f(1.1, 0.9) = −6.02 is lower, so (1, 1) is neither a maximum nor a minimum.
Where this goes wrong
Calling it a local minimum because f_xx and f_yy are both positive. The mixed partial can override them: D = 4 − 16 is negative, so the surface curves up in some directions and down in others.
Leans on
Second partial derivatives, from Functions of two variables and partial derivatives
Try a similar question
How many of the critical points of are saddle points? - Standard3 marks · 5 min
A thin wire is bent into the circle , with lengths in centimetres. The temperature at the point of the wire is degrees Celsius. Use Lagrange multipliers to find the lowest temperature on the wire.
Answer this questionStrategy
The wire is a closed, bounded curve, so T has a lowest and a highest value on it. Lagrange multipliers give the candidates, and evaluating T at each one picks out the minimum.
Working
The Lagrange conditions. None of x, y and λ can be zero here, so dividing is safe.
Divide the first equation by the second; λ cancels.
Substitute x = −2y into the circle.
Compare the candidates: the smaller value is the minimum, the larger the maximum.
Answer
The answer is 20 °C, at the point (−4, 2).
Check
Other points on the circle with integer coordinates are warmer, such as (−2, 4) at 22 °C and (−4, −2) at 24 °C, and (−4, 2) is on it since 16 + 4 = 20.
Where this goes wrong
Reporting the first candidate found. Here Lagrange multipliers give both the coldest and the hottest point, and 40 °C at (4, −2) is the hottest, so evaluate T at every candidate before choosing.
Leans on
Partial derivatives, from Functions of two variables and partial derivatives
- Challenging4 marks · 7 min
Find the absolute minimum value of on the closed triangular region with vertices , and .
Answer this questionStrategy
f is continuous on a closed, bounded region, so it has an absolute minimum, either at a critical point inside or on the boundary. Check the inside, reduce each edge to a one-variable closed-interval problem, and compare everything.
Working
The only critical point lies outside the triangle, so the minimum is on the boundary.
The two edges along the axes, each on [0, 4].
The slanted edge: 4x − 10 = 0 at x = 5/2, the point (5/2, 3/2).
The corners, which are the endpoints of the edges.
The minimum is partway along the slanted edge, at (5/2, 3/2).
Answer
The answer is −25/2, at the point (5/2, 3/2) on the edge x + y = 4.
Check
As f = (x − 3)² + (y − 2)² − 13, the least value is at the point of the triangle nearest (3, 2), which is (2.5, 1.5), at squared distance 0.5: −12.5.
Where this goes wrong
Reporting f(3, 2) = −13 from the critical point without checking that it is in the region. It is not, since 3 + 2 > 4. The least value on the triangle is on the edge nearest that point, x + y = 4.
Leans on
The closed-interval method, from Optimization
- Capstone6 marks · 10 min
A workshop’s output is units, where is hours of labour at $25 an hour and 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 questionStrategy
Lagrange multipliers fix the ratio of the two inputs, and the budget does not enter that ratio. Each budget then fixes the sizes of the inputs, and the increase is the difference of the two maxima.
Working
Q_x = λg_x, Q_y = λg_y and the budget B, with g(x, y) = 25x + 50y.
Divide the second equation by the first; λ cancels, and B never appears.
At either end of the budget line one input is zero and Q = 0, so this candidate is the maximum.
The same ratio on the larger budget.
Both inputs grow by the factor 25/16 and √y by 5/4, so output grows by 125/64: the budget rises by just over half, but output nearly doubles.
Answer
The answer is 244 units: the maximum output rises from 256, with 64 hours of labour and 16 units of material, to 500, with 100 hours and 25 units.
Check
Neighbouring bundles do worse: on $2400, 60 hours and 18 units give 60√18 ≈ 254.6, and on $3750, 110 hours and 20 units give 110√20 ≈ 491.9.
Where this goes wrong
Dividing the conditions the wrong way round, which gives x = y instead of x = 4y and an increase of 122√2 ≈ 173. Substitute back to check: with x = 4y, x/(2√y) = 2√y, which is 50λ when √y = 25λ.
Related topics
Needs
Functions of two variables and partial derivatives
Evaluating and reading functions of two variables, level curves, partial derivatives as marginal rates, and second partials.
15 questions
18 questions