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

### Course: Multivariable calculus>Unit 1

Lesson 6: Visualizing multivariable functions (articles)

# Multidimensional graphs

Examples and limitations of graphing multivariable functions.

## What we're building to

• Graphing a function with a two-dimensional input and a one-dimensional output requires plotting points in three-dimensional space.
• This ends up looking like a surface in three-dimensions, where the height of the surface above the x, y-plane indicates the value of the function at each point.

## Reviewing graphs of single-variable functions

Graphs are, by far, the most familiar way to visualize functions for most students. Before generalizing to multivariable functions, let's quickly review how graphs work for single-variable functions.
Suppose our function looks like this:
\begin{aligned} \quad f(x) = -x^2 + 3x + 2 \end{aligned}
To plot a single input, like x, equals, 1, we first compute f, left parenthesis, 1, right parenthesis:
\begin{aligned} \quad f(1) &= -x^2 + 3x + 2 \\ &= -(1)^2 + 3(1) + 2 \\ &= 4 \end{aligned}
Then we mark the point left parenthesis, 1, comma, f, left parenthesis, 1, right parenthesis, right parenthesis on the x, y-plane. In this case, that means marking left parenthesis, 1, comma, 4, right parenthesis.
When we do this for all possible inputs x, not just 1, we see what all the points of the form left parenthesis, x, comma, f, left parenthesis, x, right parenthesis, right parenthesis look like.
Unless f, left parenthesis, x, right parenthesis is some exotic or sporadic function that gives wildly different values as x changes slightly, the result will be a smooth-looking curve.

So what can we do for functions with a two-dimensional input and a one-dimensional output? Perhaps something like this:
f, left parenthesis, x, comma, y, right parenthesis, equals, left parenthesis, x, minus, 2, right parenthesis, squared, plus, left parenthesis, y, minus, 2, right parenthesis, squared, plus, 2
Associating inputs with outputs requires three numbers—two for the inputs and one for the output.
Inputs left parenthesis, x, comma, y, right parenthesisOutput f, left parenthesis, x, comma, y, right parenthesis
left parenthesis, 0, comma, 0, right parenthesis10
left parenthesis, 1, comma, 0, right parenthesis7
left parenthesis, 1, comma, 2, right parenthesis3
\varvdots, rectangle\varvdots, rectangle
To represent these associations using a graph, we plot points in three dimensions.
• The association left parenthesis, 0, comma, 0, right parenthesis, right arrow, 10 is plotted with the point left parenthesis, 0, comma, 0, comma, 10, right parenthesis.
• The association left parenthesis, 1, comma, 0, right parenthesis, right arrow, 7 is plotted with the point left parenthesis, 1, comma, 0, comma, 7, right parenthesis.
• In general, the goal is to represent all points of the form left parenthesis, x, comma, y, comma, f, left parenthesis, x, comma, y, right parenthesis, right parenthesis for some pair of numbers x and y.
The resulting graph is shown below. The video shows this graph rotating, which hopefully will help you get a feel for the three-dimensional nature of it. You can also see the x, y-plane—which is now the input space—below the graph.
This means for any given point left parenthesis, x, comma, y, right parenthesis on the plane, the vertical distance between that point and the graph indicates the value of f, left parenthesis, x, comma, y, right parenthesis. That vertical direction is usually referred to as the z-direction, and the third axis which is perpendicular to the x, y-plane is called the z-axis.
As long as the value of f, left parenthesis, x, comma, y, right parenthesis changes continuously as x and y change values, which is almost always the case in functions we deal with in practice, the graph ends up looking like some sort of​ surface.

## Example 1: The bell curve

Function: f, left parenthesis, x, comma, y, right parenthesis, equals, e, start superscript, minus, left parenthesis, x, squared, plus, y, squared, right parenthesis, end superscript
Graph:
Let's analyze what's going on with this function. First, let's look inside the exponent of e, start superscript, minus, left parenthesis, x, squared, plus, y, squared, right parenthesis, end superscript and think about the value x, squared, plus, y, squared.
Question: How can you interpret the value x, squared, plus, y, squared?

When the point left parenthesis, x, comma, y, right parenthesis is far from the origin, the function e, start superscript, minus, left parenthesis, x, squared, plus, y, squared, right parenthesis, end superscript will look like e, start superscript, start text, left parenthesis, s, o, m, e, space, b, i, g, space, n, e, g, a, t, i, v, e, space, n, u, m, b, e, r, right parenthesis, end text, end superscript, which is nearly zero. This means the distance between the graph and the x, y-plane at those points will be tiny. When x, equals, 0 and y, equals, 0, on the other hand, e, start superscript, minus, left parenthesis, x, squared, plus, y, squared, right parenthesis, end superscript, equals, e, start superscript, minus, 0, end superscript, equals, 1, which is what gives us the bulge in the middle.
Reflection Question: The graph above has rotational symmetry, in the sense that it will look the same if we rotate it in any way about the z-axis. Why is this?

## Example 2: Waves

Function: f, left parenthesis, x, comma, y, right parenthesis, equals, cosine, left parenthesis, x, right parenthesis, dot, sine, left parenthesis, y, right parenthesis
Graph:
One way to get an intuition for the function f, left parenthesis, x, comma, y, right parenthesis, equals, cosine, left parenthesis, x, right parenthesis, sine, left parenthesis, y, right parenthesis—and multivariable functions in general—is to see what happens when one of the inputs is held constant.
For example, what happens when we fix the value of x to be 2? Usually, we are plotting all the points that look like this:
left parenthesis, x, comma, y, comma, cosine, left parenthesis, x, right parenthesis, sine, left parenthesis, y, right parenthesis, right parenthesis, left arrow, start text, x, space, a, n, d, space, y, space, r, a, n, g, e, space, f, r, e, e, l, y, point, end text
By holding x constant at 2, we are limiting our view to points that look like this:
left parenthesis, 2, comma, y, comma, cosine, left parenthesis, 2, right parenthesis, sine, left parenthesis, y, right parenthesis, right parenthesis, left arrow, start text, O, n, l, y, space, y, space, r, a, n, g, e, s, space, f, r, e, e, l, y, point, end text
There is a very nice way to interpret this geometrically:
The points in space where x, equals, 2, which is to say all the points of the form left parenthesis, 2, comma, y, comma, z, right parenthesis, make up a plane. Why? Imagine slicing the graph with this plane. The points where the plane and the graph intersect—drawn in red above—are the points on our graph where x, equals, 2.
So why would this be helpful for understanding the graph?
We have basically turned the multivariable function f, left parenthesis, x, comma, y, right parenthesis, equals, cosine, left parenthesis, x, right parenthesis, sine, left parenthesis, y, right parenthesis into a single variable function:
\begin{aligned} \quad g(y) &= \cos(2)\sin(y) \\ &\approx -0.42\sin(y) \end{aligned}
In fact, the curve we get from slicing the three-dimensional graph at x, equals, 2 has the same shape as the two-dimensional graph of g, left parenthesis, y, right parenthesis.
In this way, you can understand the three-dimensional graph of a multivariable function one slice at a time by holding one variable constant and looking at the resulting two-dimensional graph.

## Example 3: One input, two outputs

You can also graph a function with a one-dimensional input and a two-dimensional output—although, for whatever reason, this is not commonly done.
Function: f, left parenthesis, x, right parenthesis, equals, left parenthesis, x, squared, comma, sine, left parenthesis, x, right parenthesis, right parenthesis
Points plotted: left parenthesis, x, comma, x, squared, comma, sine, left parenthesis, x, right parenthesis, right parenthesis
Graph:
In this case, only x runs freely, while the y and z values on the graph are both dependent on x.
If we rotate the image so we can look squarely at the x, y-plane, the graph looks like f, left parenthesis, x, right parenthesis, equals, x, squared. Another way to say this is that when we project the graph onto the x, y-plane, it gives the graph of f, left parenthesis, x, right parenthesis, equals, x, squared.
Similarly, rotating the image so that we're looking squarely at the x, z-plane makes the image look like the graph of f, left parenthesis, x, right parenthesis, equals, sine, left parenthesis, x, right parenthesis.
In other words, this function f, left parenthesis, x, right parenthesis, equals, left parenthesis, x, squared, comma, sine, left parenthesis, x, right parenthesis, right parenthesis is a way to combine the two functions f, left parenthesis, x, right parenthesis, equals, x, squared and f, left parenthesis, x, right parenthesis, equals, sine, left parenthesis, x, right parenthesis into one, and its graph captures the information of both in one image.

## Limitations

As soon as you try to apply this process to functions with higher-dimensional inputs or outputs, you'll run out of dimensions which you can comfortably visualize.
For instance, consider the function f, left parenthesis, x, comma, y, right parenthesis, equals, left parenthesis, x, squared, comma, y, squared, right parenthesis with a two-dimensional input and a two-dimensional output. Graphing it would require four dimensions of space! This is because we would need to plot all points of the form left parenthesis, x, comma, y, comma, x, squared, comma, y, squared, right parenthesis.
In practice, when people think about graphs of higher dimensional functions, like f, left parenthesis, x, comma, y, comma, z, right parenthesis, equals, x, squared, plus, y, squared, plus, z, squared, they usually start by considering graphs of some simpler function with a two-dimensional input and one-dimensional output like f, left parenthesis, x, comma, y, right parenthesis, equals, x, squared, plus, y, squared. This is a sort of conceptual prototype.
Such a prototype can help make sense out of certain operations, and can give you a feel for what starts to happen as your input space becomes multidimensional. At the end of the day, the actual computations are performed purely symbolically for the higher dimensional function.