One idea, one pictureDrag c to slide the line 2x+y=c parallel to itself. How large can c get before the line no longer touches the triangle? Which point is it touching at that moment?
Loading figure…
In one sentence
To find the extreme values of z=f(x,y) on a region D, think of f(x,y)=c as a family of curves (level curves). The value c can be taken by z only if its level curve has a point in common with D. So:
zmax=the last c before the level curve leaves D.
For a linear expression z=ax+by the level curves are a family of parallel lines; when D is a convex polygon, the last thing they touch is always a vertex.
Example: the extreme values of z = 2x + y on triangle ABC
Step 1 / 5
Loading figure…
A level line
A(−2,1), B(3,4), C(4,−2). At c=0 the line 2x+y=0 crosses the triangle, which means z=0 is attained.
2x+y=0
Push it up and to the right
The last point
Gone
The other direction
Predict first
On the same triangle A(−2,1), B(3,4), C(4,−2), what is the maximum of z=x−y?
Choose an answer first; then you can see the result.
✓You predicted it!✗Not what you expected — which is exactly why it is worth a pause.
The level lines point a different way, so the last vertex touched changes too: z(A)=−3, z(B)=−1, z(C)=6. The maximum is 6, at C.
Loading figure…
Try changing a and b: once the direction of the level lines changes, a different vertex may become the “champion”. Can you make two vertices share the maximum or the minimum? (Hint: make the level lines parallel to an edge.)
Stop 1 · A linear problem in three variables
x+y+z=2, 0≤x≤1, 0≤y≤1, z≥0. Find the extreme values of F=x+2y+3z.
First use the equation to eliminate one variable: z=2−x−y and F=6−(2x+y), and the conditions become 0≤x≤1, 0≤y≤1 (z=2−x−y≥0 then holds automatically). The problem is now: the extreme values of 2x+y on a square.
Loading figure…
2x+y has minimum 0 at (0,0) and maximum 3 at (1,1). So F has maximum 6 (x=y=0,z=2) and minimum 3 (x=y=1,z=0).
Stop 2 · A linear expression on a conic: the level line is tangent
Now let the region be the ellipse 16x2+9y2≤1, with the objective still z=x+y. At the moment the level line leaves the ellipse, it is tangent to it.
Loading figure…
Push c to 5: the line and the ellipse have only one point left in common.
One problem, several solutions
The point (x,y) lies on the ellipse 16x2+9y2=1. Find the maximum of x+y.
Tangent level line: discriminant 0
Substitute y=c−x: 9x2+16(c−x)2=144, that is 25x2−32cx+16c2−144=0. Tangency means Δ=0: (32c)2=100(16c2−144), 1024c2=1600c2−14400, c2=25, so the maximum is c=5.
CostSubstitute, tidy up, compute one discriminant.
The eccentric angle as parameter
x+y=4cosφ+3sinφ=5sin(φ+φ0)≤5, where tanφ0=34. Equality holds when cosφ=54 and sinφ=53, at the point of tangency (516,59).
CostOne line, and you get the point of tangency for free.
Stop 3 · When the level curves are not lines
The level curves of z=x2+y2 are circles centered at the origin, and z is the squared distance to the origin; the level curves of z=x+2y−1 are lines through (−2,1), and z is the slope. First recognize what the level curves are, then see where they last touch the region. That may be a vertex, the middle of an edge (see the Mistake Museum exhibits below), or a point of tangency.
Practice
Exercise 1Basic
x≥0, y≥0, 3x+4y≤12. Find the maximum of z=3x+2y.
Hint · direction
What shape is the region? Where are its vertices?
Hint · method
A linear expression on a triangle reaches its extremes at vertices: substitute them one by one.
Hint · first step
The vertices are (0,0), (4,0), (0,3).
Full solution
The values of z are 0, 12 and 6, so the maximum is 12.
Exercise 2Basic
On the same region, find the minimum of z=x−2y.
Hint · direction
The coefficient of y is negative: the bigger the intercept, the … z?
Hint · method
You still only need to compare the three vertices.
Hint · first step
z(0,0)=0, z(4,0)=4, z(0,3)=−6.
Full solution
The minimum is −6, at (0,3): the “highest” point of the region, which matches the largest intercept and the smallest z.
Exercise 3Advanced
The point (x,y) lies on the ellipse 4x2+y2=1. Let M be the maximum of x+2y. Find M2.
Hint · direction
Use the eccentric angle, or make the line x+2y=c tangent to the ellipse.
Hint · method
Set x=2cosφ,y=sinφ.
Hint · first step
x+2y=2cosφ+2sinφ.
Full solution
2cosφ+2sinφ=22sin(φ+4π)≤22, so M=22 and M2=8.
Exercise 4Challenge
x+y≥2, x≤3, y≤3. Find the minimum of x2+y2.
Hint · direction
What are the level curves of x2+y2?
Hint · method
It is the squared distance to the origin. The origin is not in the region (0+0<2), so look for the point of the region nearest to the origin.
Hint · first step
The region is a triangle with vertices (−1,3), (3,−1), (3,3). The nearest point may be in the middle of the edge x+y=2, not necessarily at a vertex.
Full solution
The foot of the perpendicular from the origin to the line x+y=2 is (1,1), which lies between (−1,3) and (3,−1), so it belongs to the region. The minimum is 12+12=2 (at the vertices the values are 10, 10 and 18).
Comparing only the vertices when the objective is not linear
✗
The wrong step: Minimum of x2+y2 on the triangle with vertices (1,3), (3,1), (4,4): the values at the three vertices are 10, 10, 32, so the minimum is 10.
What went wrong? Think first, then open
Diagnosis“The extremum is at a vertex” holds only for a linear objective: its level curves are lines, and a line sliding off a convex polygon touches a vertex last. The level curves of x2+y2=c are circles centered at the origin, and a growing circle may first touch the middle of an edge.
✓
The right step: The foot of the perpendicular from the origin to the edge x+y=4 is (2,2), which lies between (1,3) and (3,1), so the minimum is 22+22=8.
“Look at the shape of the level curves before deciding where to search”
Exhibit
“The bigger the intercept, the bigger z”
✗
The wrong step: Maximum of z=x−2y: slide the line x−2y=z upward; the bigger the intercept, the bigger z, so take the highest point of the region.
What went wrong? Think first, then open
Diagnosisx−2y=z becomes y=21x−2z, whose y-intercept is −2z: the bigger the intercept, the smallerz. When the coefficient of y is negative, every direction is reversed.
✓
The right step: Write down how the intercept is related to z before deciding the direction; or, easiest of all, substitute the candidate vertices one by one and compare.
“Whether intercept and z move together depends on the sign of y’s coefficient”
On Extremum Problems ← → step · F full screen · Esc exit