Chapter 13. Level curves (aka contour plots)
§13.1 [TEXT] Level curves replace -graphs
In high school and 18.01, you were usually taught to plot single-variable functions in two dimensions, so would be drawn as a parabola , and so on. You may have drilled into your head that is an input and is an output.
However, for 18.02 we’ll typically want to draw pictures of functions like in a different way14, using what’s known as a level curve.
The contrast to what you’re used to is that:
- In high school and 18.01, the variables and play different roles, with representing the input and representing output.
- In 18.02, when we draw a function both and are inputs; we treat them all with equal respect. Meanwhile, the output of the function does not have a variable name. If we really want to refer to it, we might sometimes write as a shorthand for “the level curve for output ”.
To repeat that in table format:
| 18.01 -graphs | 18.02 level curves |
|---|---|
| is input | Both variables are inputs |
| is output | No variable name for output |
We give some examples.
To draw the level curves of the function , we begin by recalling that a level curve corresponds to the points such that the function takes on a constant value, say . For our function, this becomes:
which rearranges to
Let’s talk through some values of .
- As an example, if , then some points on the level curve would be , , , , , , , or even and . You probably already recognize what’s happening: happens to be an equation you met before in 18.01 form, so you get a parabola. (More generally, if you get an equation in 18.01 form where is a function of , you can sketch it like you did before).
- If we change the value of , this equation represents a family of parabolas. For example, the level curve for will be the parabola with points like , , , , .
In general, as varies, the level curves are parabolas that shift upward or downward along the -axis. The shape of these curves is determined by the quadratic term , which indicates that all level curves will have the same basic “U” shape.
Let’s draw level curves for . This example is exactly like the previous one, except the roles of and are flipped.
Let’s draw level curves of . For each we want to sketch the curve
When , no points at all appear on this curve, and when the only point is the origin . For this equation represents a family of circles centered at the origin , with radius . For example:
- For , the level curve is a circle with radius .
- For , the level curve is a circle with radius .
- For , the level curve is a circle with radius .
As increases, the circles expand outward from the origin. These concentric circles represent the level curves of the function .
Let’s draw level curves of . To draw the level curve for , we are looking at
Like before, if there are no pairs at all and for there is only a single point.
This equation represents a family of polygons. Specifically, for a given value of , the points that satisfy this equation form a diamond shape centered at the origin. Indeed, in the first quadrant (where the absolute values don’t do anything) it represents the line segment joining to .
So for example,
- When , there are no points.
- For , the level curve is just the point .
- For , the level curve is a diamond with vertices at , , , and .
- For , the level curve is a larger diamond with vertices at , , , and .
- For , the diamond expands further, with vertices at , , , and .
As increases, the diamonds expand outward, maintaining their shape but increasing in size. Each level curve is a square rotated by 45 degrees.
§13.2 [RECIPE] Drawing level curves
Despite the fact this section is labeled “recipe”, there isn’t an easy method that works for every function. You have to do it in an ad-hoc way depending on the exact function you’re given. For many functions you’ll see on an exam, it’ll be pretty easy.
To summarize the procedure, given an explicit function like and the value of , one tries to plot all the points in space with . We gave three examples right above, where:
- The level curves of were easy to plot because for any given , the equation just became an -plot like in 18.01.
- The level curves of were similar to the previous example, but the roles of and were flipped.
- To draw the level curves of , you needed to know that represents a circle of radius centered at .
- To draw the level curves of , we had to think about it an ad-hoc manner where we worked in each quadrant; in Quadrant I we figured out that we got a line, and then we applied the same image to the other quadrants to get diamond shapes.
So you can see it really depends on the exact you are given. If you wrote a really nasty function like , there’s probably no easy way to draw the level curve by hand.
§13.3 [TEXT] Level surfaces are exactly the same thing, with three variables instead of two
Nothing above really depends on having exactly two variables. If we had a three-variable function , we could draw level surfaces for a value of by plotting all the points in for which .
§13.4 [EXER] Exercises
Exercise 13.1. Draw 2D level curves for some values for the following functions:
- (i.e. outputs the larger of its two inputs, so and , for example).