If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Transformations, part 1

One fun way to think about functions is to imagine that they literally move the points from the input space over to the output space. See what this looks like with some one-dimensional examples.  Created by Grant Sanderson.

Want to join the conversation?

Video transcript

- [Voiceover] So I have talked a lot about different ways that you can visualize multivariable functions. Functions that will have some kind of multidimensional input or output. These include three-dimensional graphs, which are very common. Contour maps, vector fields, parametric functions. But here, I want to talk about one of my all-time favorite ways to think about functions, which is as a transformation. So any time you have some sort of function, if you're thinking very abstractly, I like to think that there's some sort of input space. And I'll draw it as a blob, even though, you know, that could be the real number line. So it should be a line, or it could be three-dimensional space. And then there's some kind of output space. And again, I just very vaguely think about it as this blob. But that could be, again, the real number line, the x-y plane, a three-dimensional space. And the function is just some way of taking inputs to outputs. And every time that we're trying to visualize something, like with a graph or a contour map, you're just trying to associate input-ouput pairs. You know, if f inputs, you know, three gets mapped to the vector one-two. It's a question of how do you associate the number three with that vector one-two. And the thought behind transformations is that we're just gonna watch the actual points of the input space move to the output space. And I'll start with a simple example that's just a one-dimensional function. It will have a single variable input. And it will have a single variable output. So let's consider the function f of x is equal to x squared minus three. And, of course, the way we're used to visualizing something like this, it will be as a graph. You might kind of be thinking of something roughly parabolic that's squished down by three. But here, I don't want to think in terms of graphs. I just want to say, how do the inputs move to those outputs? So as an example, if you go to zero, when you plug in zero, you're gonna get negative three. You know, zero squared minus three is equal to negative three. So somehow we want to watch zero move to negative three. And then similarly, let's say you plug in one, and you get one squared minus three is negative two. So somehow we want to watch one move to negative two. Just another example here. Let's say you are plugging in three itself. So three squared minus three is nine minus three is six. So somehow in this transformation, we want to watch three move to the number six. And with a little animation, we can watch this happen. We can actually watch what it looks like for all these numbers to move to their corresponding outputs. So here we go. Each number will move over and land on its output. And I'll clear up the board here. So I kept track of what the original input numbers are by just kind of writing them on top here. And that was a way of just watching how it moves. And I'll play it again. Here, let's just watch where each number from the input space moves over to the output. And with single variable functions, this is a little bit nice because it gives the sense of inputs moving to outputs. But where it gets fun is in the context of multivariable functions. So now, let me consider a function that has a one-dimensional input and a two-dimensional output. And specifically, it will be f of x is equal to cosine of x, cosine of x. And then the y component will be x sine of y. Sorry, x sine of x. So just to think about a couple examples. If you plug in something like zero, and think about where zero ought to go, you'd have f of zero is equal to cosine of zero is one. And then, zero times anything is zero. So somehow we're gonna watch zero move over to the point one-zero. And so this is where we expect zero to land. And let's think about, like, pi. So f of pi. Then cosine of pi is negative one. This is gonna be pi multiplied by, and sine of pi is zero. So that will again be zero. So, you know, this little guy is where zero lands. And we expect that this is gonna be where the value pi lands. And if we watch this take place, and we actually watch each element of the input space move over to the output space, we get something like this. And again, this is just kind of a nice way to think about what's actually going on. You might ask questions about whether the space ends up getting stretched or squished. And notice that this is also what a parametric plot of this function would look like. If you interpret it as a parametric function, this is what you get in the end. But whereas in parametrics plots, you lose input information, here you can kind of see where things move as you go from one to the other. And in the next video, I'm gonna talk about how you can interpret functions with a two-dimensional input and a two-dimensional output as a transformation.