Introduction to 3d graphs | Multivariable calculus | Khan Academy
Hello everyone! So, what I'd like to do here is describe how we think about three-dimensional graphs.
Three-dimensional graphs are a way that we represent a certain kind of multivariable function, the kind that has two inputs, or rather a two-dimensional input, and then a one-dimensional output of some kind. So, the one that I have pictured here is f of XY equals x squared plus y squared.
Before talking exactly about this graph, I think it'll be helpful if, by analogy, we take a look at two-dimensional graphs and kind of remind ourselves how those work. What it is that we do, because it's pretty much the same thing in three dimensions, but it takes a little bit more visualization.
With two-dimensional graphs, you have some kind of function; you know, let's say you have f of X is equal to x squared. Anytime that you're visualizing a function, you're trying to understand the relationship between the inputs and the outputs, and here those are both just numbers. So, you know, you input a number like two, and given it's going to output four; you know you input negative one, it's going to output one.
You're trying to understand all of the possible input/output pairs, and the fact that we can do this—that we can give a pretty good intuitive feel for every possible input/output pair—is pretty incredible. The way we go about this with graphs is you think of just plotting these actual pairs. Right?
So, you're going to plot the point; you know, let's say we're going to plot the point two, four. So, we might kind of mark our graph to here: 1, 2, 3, 4. So you'd want to mark somewhere here: 2, 4, and that represents an input/output pair. And if you do that with, you know, negative 1, 1, go negative 1, 1, and when you do this for every possible input/output pair, what you end up getting—and I might not draw this super well—is some kind of smooth curve.
The implication for doing this is that we typically think of what is on the x-axis as being where the inputs live. You know, this would be—we think of it as the input 1, and this is the input 2, and so on. Then you think of the output as being the height, the height of the graph above each point. But this is kind of a consequence of the fact that we're just listing all of the pairs here.
Now, if we go to the world of multivariable functions, here I'm not going to show the graph right now. Let's just think we've got three-dimensional space at our disposal to do with what we will. We still want to understand the relationship between inputs and outputs of this guy, but in this case, inputs are something that we think of as, you know, a pair of points.
So, you might have a pair of points like one, two, and the output there is going to be 1 squared plus 2 squared. And what that equals is 5. So how do we visualize that? Well, if we want to pair these things together, the natural way to do that is to think of a triplet of some kind.
In this case, you'd want to plot the triplet 1, 2, 5. To do that in three dimensions, we'll take a look over here. We think of going 1 in the x-direction—this axis here is the x-axis—so we want to move a distance of one there. Then we want to go 2 in the y-direction, so we kind of think of going a distance of two there, and then 5 up.
That's going to give us some kind of point, right? So we think of this point in space, and that's a given input/output pair. But we could do this for a lot, right? A couple different points that you might get if you start plotting various different ones look something like this. Of course, there's infinitely many that you can do, and it'll take forever if you try to just draw each one in three dimensions.
But what's very nice here is that—here, I'll get rid of those lines—if you imagine doing this for all of the infinitely many pairs of inputs that you could possibly have, you end up drawing a surface. So in this case, the surface kind of looks like a 3-dimensional parabola. That's no coincidence; it has to do with the fact that we're using x squared plus y squared here.
Now, the inputs, like 1 and -we think of as being on the x-y plane, right? So you think of the inputs living here, and then what corresponds to the output is that height of a given point above the graph. Right? So it's very similar to two dimensions—you think, you know, we think of the input as being on one axis, and the height gives the output there.
So just to give an example of what the consequence of this is, I want you to think about what might happen if we change our multivariable function a little bit, and we multiplied everything by half. Right?
So I'll draw it in red here: let's say that we have our function, but I'm going to change it so that it outputs one half of x squared plus y squared. What's going to be the shape of the graph for that function? What it means is the height of every point above this xy-plane is going to have to get cut in half. So it's actually just a modification of what we already have, but everything kind of "sh loops" on down to be about half of what it was.
So in this case, instead of that height being five, it would be two-point five. You could imagine—let's say we did this, you know—it was even more extreme; instead of saying one half, you cut it down by like one-twelfth. Maybe I'll use the same color: by one-twelfth. That would mean that everything, you know, sh loops very flat, very flat and close to the xy-plane.
So a graph being very close to the xy-plane like this corresponds with very small outputs. One thing that I'd like to caution you against—it's very tempting to try to think of every multivariable function as a graph because we're so used to graphs in two dimensions, and we're so used to trying to find analogies between two dimensions and three dimensions directly.
But the only reason that this works is because if you take the number of dimensions in the input—two dimensions—and then the number of dimensions in the output—one dimension—it was reasonable to fit all of that into three, which we could do. But imagine you have a multivariable function with, you know, a three-dimensional input and a two-dimensional output. That would require a five-dimensional graph, but we're not very good at visualizing things like that.
So there's lots of other methods, and I think it's very important to kind of open your mind to what those might be. In particular, another one that I'm going to go through soon lets us think about 3D graphs but kind of in a two-dimensional setting, and we're just going to look at the input space—that's called a contour map.
A couple of other ones, like parametric functions, you just look in the output space. Things like a vector space, you kind of look in the input space but get all the outputs. There's lots of different ways; I'll go over those in the next few videos, and that's three-dimensional graphs.