A firm maximising output cannot choose any labour and capital it likes, because it has a budget, and the best point on the budget line is almost never a point where the gradient of output vanishes.
The previous lesson found maxima and minima by setting the gradient to zero and sorting the critical points with the second derivative test. It ended on the catch: real problems restrict the inputs to a curve or a surface (a fixed amount of material, a budget, a plane to stay on), and the best point there can sit on a steep hillside of . It assumes the gradient and the fact, proved in an earlier lesson, that is perpendicular to the level curve of through the point.
Substituting the constraint
The obvious approach is to use the constraint to eliminate a variable. A farmer with metres of fencing encloses a rectangle of sides and , so , and wants the area as large as possible. Solving the constraint gives , the area becomes on , and at . The best field is a square of square metres.
It fails quietly as soon as the constraint is less tidy. Take , the squared distance from the origin, on the ellipse . Substituting gives , whose derivative vanishes only at , where . That is the minimum. The maximum, at , is missed entirely: it sits at the ends of the interval on which the substitution is valid, a restriction the formula does not remember.
Other constraints cannot be solved at all: the closed curve needs a quartic solved for . What is wanted is a method that takes the constraint as a level set and never solves it.
Where a contour touches the constraint
Lay the constraint curve over the contour map of and walk along it. Where the constraint cuts a contour at an angle, is higher on one side of the crossing and lower on the other, so that point is neither a maximum nor a minimum along the walk. The only places the walk can turn round in are where the constraint does not cut the contour but grazes it: at a constrained extremum the level curve of is tangent to the constraint curve.
The chain rule makes this exact. Let trace the constraint curve, passing the point at with velocity . If restricted to the curve is extreme at , the single variable function is extreme at , so its derivative vanishes, and by the chain rule along a path
So is perpendicular to the constraint at . So is , since for every and differentiating gives . In the plane, two vectors perpendicular to the same nonzero direction lie on one line. Provided , there is therefore a number with
This is the tangency of the picture restated: the gradients are the normals of the two curves, and parallel normals mean the curves share a tangent line. The number , the Greek letter lambda, is called a Lagrange multiplier, after Joseph-Louis Lagrange, who used it in his Mécanique analytique of 1788 for mechanical systems held by constraints. It can be positive, negative or zero.
On a constraint surface the same argument applies to every curve through , so is perpendicular to the whole tangent plane, as is its normal . Again .
The method
Written out in components, together with the constraint is a system of equations:
That is three equations in the three unknowns , and , or four in four with . Solve it, evaluate at every solution, and compare. The solutions are candidates, like the critical points of the previous lesson, not answers. When the constraint set is closed and bounded, such as an ellipse or a sphere, a continuous is guaranteed a largest and a smallest value on it, and they are among the candidates (together with any points where , which the argument above excluded). When the set is unbounded, a separate argument is needed that an extremum exists at all.
The ellipse that defeated substitution shows the method at work. With and , the equations are and . The first says or ; the second says or . Taking , the constraint gives and . Taking , the second equation forces , so and . Both the minimum and the missed maximum appear, and at each the ellipse touches a circle centred on the origin, the level curves of .
Example. An open-topped box is to be made from square metres of sheet metal. What dimensions give the largest volume?
With base by and height , maximise subject to : the base plus four sides. The system is
Every quantity is positive, so nothing vanishes. Multiply the first equation by and the second by : both left sides become , so , which gives and . Multiply the third by and compare with the first times : , so and . The box has a square base twice as wide as it is tall. The constraint becomes , so and the box is by by metres, holding cubic metres, with . The volume is near for a flat tray or a tall narrow tube, so a largest volume exists and this single candidate is it. A random search over bases found nothing above .
Now you. A closed cylindrical can must hold cubic centimetres. Find the radius and height that use the least metal, to two decimal places.
Answer
Minimise subject to . The equations are and . The second gives , and the first becomes , so : the height equals the diameter. Then , so cm and cm, with area square centimetres.
The nearest point of a plane
An earlier lesson found the distance from a point to a plane by projecting onto the normal. Lagrange's method finds it with no geometry, together with the nearest point. Minimising the squared distance avoids a square root.
Example. Find the point of the plane closest to the origin.
Minimise subject to . The system gives , , . Substituting into the plane, , so and the point is , at distance . The projection formula agrees, giving . The equations made the point a multiple of the normal, the projection argument in other words. The distance grows without bound far out on the plane, so the single candidate is the minimum.
Now you. The roof of the earlier lesson on vectors lay in the plane . Find its point nearest the origin, and the distance.
Answer
gives , , . Then , so and the point is . Its distance is metres, matching .
A production budget
The first lesson of this course met the Cobb-Douglas function , fitted in 1928 to American manufacturing output from labour and capital . A firm running on it has the budget problem this lesson opened with.
Example. Labour costs £3 a unit, capital £1 a unit, and the budget is £400. Maximise output.
The constraint is . The partials are and , so the system reads and . Replacing in the first by the second gives , so , and the budget gives : , output , and . The spending splits £300 to labour and £100 to capital, in the ratio of the exponents. Stepping along the budget line by finds the same peak.
Now you. Labour now costs £2 a unit, capital £4, and the budget is £800. Find , , the maximum output and , to two decimal places.
Answer
The equations and give , so . Then gives and (again to labour, to capital). Output is , and .
What the multiplier measures
Let be the optimal value when the constraint is , attained at a point that moves smoothly with . By the chain rule and then ,
because . So is the rate at which the best achievable value changes as the constraint is loosened. Economists call it a shadow price: for the firm, units of output per extra pound, the most an extra pound of budget is worth. Moving the budget to £401 gives and , up by exactly . It is exact here because the exponents add to , so output grows in proportion to the budget.
The box shows the approximation. There , predicting more cubic metres for more square metres of metal. Redoing the solution with square metres gives and , a rise of .
When the method misleads
The equations are necessary conditions, and a solution need not be an extremum. On the curve , written , take . Then gives and , the candidate . But along the curve , which passes through without turning: the level line is tangent to the curve and crosses it anyway.
The other failure is where , which the derivation had to exclude. Minimise on the cusp , so . Every point of the curve has , so the minimum is at the origin. The system asks and ; the first forces , then and , and then . The system has no solution at all, because at the cusp . The honest recipe therefore solves the system, adds the points where , and on unbounded constraints checks what happens far out.
Two constraints at once
In space, two constraints and usually meet in a curve. Its tangent at is perpendicular to both and , and at a constrained extremum is perpendicular to it too. The vectors perpendicular to a line in space form a plane, and when and are not parallel they span it, so
with a second multiplier (mu): five unknowns, matched by three component equations and two constraints.
The plane cuts the cylinder in an ellipse. For its highest and lowest points, and . The third component gives , the first two , so , and the cylinder gives . The ellipse peaks at and bottoms out at .
With that, differentiation in several variables is complete: slopes in every direction, tangent planes, chains of dependence, and extrema with and without constraints. The other half of calculus remains. In one variable the integral followed the derivative as a limit of sums, and a function of two variables asks for the same summing over a region of the plane, the volume under a surface. The next lesson builds it.