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.

## Multivariable calculus

### Unit 1: Lesson 6

Visualizing multivariable functions (articles)

# Transformations

Here we see how to think about multivariable functions through movement and animation.

## The idea of transformations

In all of our methods for visualizing multivariable functions, the goal is to somehow see the connection between the input and the output of a function.
• With graphs, this means plotting points whose coordinates include both input and output information.
• With contour maps this means marking which input values will go to certain output values.
• With parametric functions, you mark where the input lands in the output space.
• With vector fields you plot the output as a vector whose tail sits at the input.
The thought behind transformations is to simply watch (or imagine) each input point moving to its corresponding output point.
It can be a bit of a mind-warp to view functions as transformations if you never have before, so if it feels confusing at first, that's okay.
To whet your appetite for what this might look like, here's a video from the parametric surface article which shows how a certain function transforms a square into a torus (doughnut shape):

## Concept over precision

Thinking about functions as transformations can be very powerful for a few reasons:
• We are not constrained as much by dimension. Both the input and the output can have either one, two or three dimensions, and there will be a way to concretely think about what the function is doing.
Even when the dimensions are too big to look at, thinking in terms of a transformation at least allows for a vague idea of what's happening in principle. For example, we can know that a function from 100-dimensional space to 20-dimensional space is "flattening" down 80 dimensions, perhaps analogous to squishing three-dimensional space onto the line.
• This idea generalizes more easily to functions with different types of inputs and outputs, such as functions of the complex numbers, or functions that map points of the sphere onto the x, y-plane.
• Understanding functions in this capacity will make it easier to see the connections between multivariable calculus and linear algebra.
However, with all that said, it should be stressed that transformations are most powerful as an understanding of what functions do, not as a precise description. It would be rare to learn the properties of a given function by observing what it looks like as a transformation.

## Example 1: From line to line

Let's start simple, with a single-variable function.
f, left parenthesis, x, right parenthesis, equals, x, squared, minus, 3
Consider all the input-output pairs.
x (input)x, squared, minus, 3 (output)
minus, 21
minus, 1minus, 2
0minus, 3
1minus, 2
21
\varvdots, rectangle\varvdots, rectangle
What would it look like for all the inputs on the number line to slide over onto their corresponding output? If we pictured the input space as one number line, and the output space as another number line, we might get a motion like this:
Alternatively, since in this case the input space and output space are really the same thing, a number line, we could think of the line transforming onto itself, dragging each point x to where the point x, squared, minus, 3 started off, like this:

## Example 2: From line to plane

Now let's take a function with a one-dimensional input and a two-dimensional output, like
\begin{aligned} \quad f(x) = \left( \cos(x), \dfrac{x}{2}\sin(x) \right) \end{aligned}
Again we consider all input-output pairs.
Inputs xOutputs left parenthesis, cosine, left parenthesis, x, right parenthesis, comma, start fraction, x, divided by, 2, end fraction, sine, left parenthesis, x, right parenthesis, right parenthesis
0left parenthesis, 1, comma, 0, right parenthesis
start fraction, pi, divided by, 2, end fractionleft parenthesis, 0, comma, start fraction, pi, divided by, 4, end fraction, right parenthesis
pileft parenthesis, minus, 1, comma, 0, right parenthesis
\varvdots, rectangle\varvdots, rectangle
Imagine all possible inputs on the number line sliding onto their corresponding outputs. This time, since the outputs have two coordinates, they live in the x, y-plane.
Notice, the final image of the warped and twirled number line inside the x, y-plane is what we would have drawn if we interpreted f as a parametric function, but this time, we can actually see which input points end up where on the final curve.
Let's take a moment to watch it again and follow some specific inputs as they move to their outputs.
\begin{aligned} \quad \blueE{0} &\to f(0) = (\cos(0), 0\sin(0)) = \blueE{(1, 0)} \\ \\ \greenE{\frac{\pi}{2}} &\to f\left(\frac{\pi}{2}\right) = \left(\cos\left(\frac{\pi}{2}\right), \frac{\pi}{4}\sin\left(\frac{\pi}{2}\right) \right) = \greenE{(0, \pi/4)}\\ \\ \redE{\pi} &\to f(\pi) = (\cos(\pi), \frac{\pi}{2}\sin(\pi)) = \redE{(-1, 0)} \\ \\ \end{aligned}

## Example 3: Simple plane to plane transformation

Consider a 90, degrees rotation of the plane (arrows are pictured just to help follow the transformation):
This could be considered a way to visualize a certain function with a two-dimensional input and a two-dimensional output. Why?
This transformation moves points in two-dimensional space to other points in two-dimensional space. For example, the point that starts at left parenthesis, 1, comma, 0, right parenthesis ends at left parenthesis, 0, comma, 1, right parenthesis. The point that starts at left parenthesis, 1, comma, 2, right parenthesis ends at left parenthesis, minus, 2, comma, 1, right parenthesis, etc. The function describing this transformation is
f, left parenthesis, x, comma, y, right parenthesis, equals, left parenthesis, minus, y, comma, x, right parenthesis
For any given point, like left parenthesis, 3, comma, 4, right parenthesis, this function f tells you where that point lands after you rotate the plane 90, degrees counterclockwise, (in this case left parenthesis, minus, 4, comma, 3, right parenthesis).

## Example 4: More complicated plane to plane transformation

Now let's look at a more complicated function with a two-dimensional input and a two-dimensional output:
f, left parenthesis, x, comma, y, right parenthesis, equals, left parenthesis, x, squared, plus, y, squared, comma, x, squared, minus, y, squared, right parenthesis.
Each input is a point on the plane, such as left parenthesis, 1, comma, 2, right parenthesis, and it moves to another point on the plane, such as left parenthesis, 1, squared, plus, 2, squared, comma, 1, squared, minus, 2, squared, right parenthesis, equals, left parenthesis, 5, comma, minus, 3, right parenthesis. When we watch every point on the plane slide over to its corresponding output point, it looks as if a copy of the plane is morphing:
Notice, all the points end up on the right side of the plane. This is because the first coordinate of the output is x, squared, plus, y, squared, which must always be positive.
Challenge question: In the transformation above, representing the function f, left parenthesis, x, comma, y, right parenthesis, equals, left parenthesis, x, squared, plus, y, squared, comma, x, squared, minus, y, squared, right parenthesis, notice that all points end up in the sideways-V-shaped region between the lines x, equals, y and x, equals, minus, y. Which of the following numerical facts explains this?

## Example 5: From plane to line

Next think of a function with a two-dimensional input and a one-dimensional output.
f, left parenthesis, x, comma, y, right parenthesis, equals, x, squared, plus, y, squared,
The corresponding transformation will squish the x, y-plane onto the number line.
Such squishification can make it hard to follow everything that's going on, so for the sake of a precise and clear description, you would be better off using a graph or a contour map. Nevertheless, it can be a helpful concept to keep in the back of your mind that what function from two dimensions to one dimension does is squish the plane onto the line in a certain way.
For instance, this gives a new way to interpret the level sets in a contour map: they are all the points of the plane which scrunch together into a common point on the line.

## Example 6: From plane to space

Functions with a two-dimensional input and three-dimensional output map the plane into three-dimensional space. For instance, such a transformation might look like this (the red and blue lines are just to help keep track of what happens to the x and y directions):
Analogous to the one-to-two dimensions example above, our final image reflects the surface we would get by interpreting the function as a parametric function.

## Example 7: From space to space

Functions from three dimensions to three dimensions can be seen as mapping all three-dimensional space onto itself. With this many variables, actually looking at the transformation can be a combination of horrifying, beautiful, and confusing. For instance, consider this function:
f, left parenthesis, x, comma, y, comma, z, right parenthesis, equals, left parenthesis, y, z, comma, x, z, comma, x, y, right parenthesis
Here's what it looks like as a transformation.