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)

# Parametric functions, two parameters

To represent surfaces in space, you can use functions with a two-dimensional input and a three-dimensional output.

## What we're building to

• You can visualize a function with a two-dimensional input and a three-dimensional output by plotting all the output points corresponding to some region of the input space. This results in a surface, known as a parametric surface.
• The process of going the other way around, starting with a surface in space and trying to find a function that "draws" this surface, is known as parameterizing the surface. In general, this is a tricky thing to do.

## Quick review of one-parameter functions

In the last article, I talked about visualizing functions with a one-dimensional input and a two-dimensional output. For example:
$f\left(t\right)=\left[\begin{array}{c}t\mathrm{cos}\left(t\right)\\ \mathrm{sin}\left(t\right)\end{array}\right]$
I talked about how because the output space has more dimensions than the input space, you can get a good feel for the function just by seeing which points in the output space are "hit" by the function as the input $t$ ranges over some set of values.
When a function is interpreted this way, it is known as a parametric function, and its input $t$ is called the parameter

## Two parameters

We can do something very similar with functions that have a two-dimensional input and a three-dimensional output.
$f\left(s,t\right)=\left[\begin{array}{c}{t}^{3}-st\\ s-t\\ s+t\end{array}\right]$
Both input coordinates $s$ and $t$ will be known as the parameters, and you are about to see how this function draws a surface in three-dimensional space.
The first step to representing a function like this is to specify a range for the input, such as
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}0<& s<3\\ -2<& t<2\end{array}$
Here's what that region looks like in the input space.
Next, we consider all possible outputs of the function in that range.
Input $\left(s,t\right)$Output $\left({t}^{3}-st,s-t,s+t\right)$
$\left(0,0\right)$$\left(0,0,0\right)$
$\left(1,0\right)$$\left(1,1,1\right)$
$\left(2,1\right)$$\left(6,1,3\right)$
$\phantom{\rule{1em}{0ex}}⋮$$\phantom{\rule{1em}{0ex}}\phantom{\rule{0.278em}{0ex}}⋮$
Okay, so we don't literally write out all possible outputs, since, you know, that involves infinitely many things. In principle, though, our goal is to represent all those values. Since the function spits out a three-coordinate output, we visualize this output in three-dimensional space.
The following animation shows what it looks like as the points $\left(s,t\right)$ in the parameter space move to the corresponding output $f\left(s,t\right)$ in three-dimensional space:
The resulting surface in three-dimensional space is called a parametric surface.
Warning: Surfaces like these can be confused with the graphs of functions that have a two-dimensional input and a one-dimensional output since those are also drawn as surfaces in three-dimensional space. But these parametric functions have a very different flavor. They have a two-dimensional input and a three-dimensional output. Notice, this means graphing them would require five dimensions!

## Parameterizing a surface

One of the best ways to get a feel for parametric functions is to start with a surface that you want to describe, then try to find a function that will draw this as a parametric surface. This is also a necessary skill when you start learning about surface integrals later on in multivariable calculus.
Be warned, though, parameterizing surfaces is not easy. In the following example, we will parameterize a torus, the fancy word for the surface of a doughnut. As surfaces go, a torus is a relatively simple example, but it still takes some serious effort.

## Example: Parameterize a torus (doughnut)

Consider the surface pictured above. You can think of it as a doughnut shape, or perhaps just as the glaze on the doughnut, since we don't care about the filling. Our goal right now is to find a function with a two-dimensional input, and a three-dimensional output, such that this doughnut shape is the output.
We imagine "drawing" the surface, although one does not simply draw a surface with a pencil and paper the way we can draw a curve. Instead, our strategy will be to draw each circular slice of the torus. To see what I mean, here is a sample of those circular slices (drawn in blue):
I also drew a large red circle on the $xy$-plane running through the centers of each of these slices. This is not part of the torus, but will be a useful reference point for the end goal of drawing each blue slice.
In a real problem, the radius of the red circle might be given to you, as would the radius of each blue circular slice. For now, let's choose arbitrarily that the radius of the red circle is $3$, and the radius of each blue slice is $1$, with the understanding that choosing different values would give different toruses (torii? torotes?).
Core idea: We will describe each point on the torus as the sum of two vectors:
1. A vector $\stackrel{\to }{\mathbf{\text{c}}}$ from the origin to a point on the red circle. To specify which point on the red circle, we will make this a vector-valued function that depends on a parameter $t$. As the value of $t$ changes, the point on the red circle described by $\stackrel{\to }{\mathbf{\text{c}}}\left(t\right)$ will change.
2. A vector $\stackrel{\to }{\mathbf{\text{d}}}$ from that point on the red circle to a point on the corresponding "slice" of the torus. The direction this vector points will depend on which point of the red circle it is anchored to, so the value of $\stackrel{\to }{\mathbf{\text{d}}}$ should depend on the parameter $t$ used to describe points of the red circle. Furthermore, we will use a second parameter $u$ to determine which part of the blue torus slice $\stackrel{\to }{\mathbf{\text{d}}}$ points to.
This means points on the torus will each be described as a sum.
$\stackrel{\to }{\mathbf{\text{c}}}\left(t\right)+\stackrel{\to }{\mathbf{\text{d}}}\left(u,t\right)$
(If you are unfamiliar with the tip-to-tail method of adding vectors, consider reviewing this video).

#### Why this strategy?

The idea here is that we don't immediately know how to define points on a torus, but we do know how to define circles.
Since the big red circle is flat on the $xy$-plane, and has radius $3$, we can parameterize it as follows:
$\begin{array}{r}\phantom{\rule{1em}{0ex}}\stackrel{\to }{\mathbf{\text{c}}}\left(t\right)=3\left[\begin{array}{c}\mathrm{cos}\left(t\right)\\ \mathrm{sin}\left(t\right)\\ 0\end{array}\right]=3\mathrm{cos}\left(t\right)\stackrel{^}{\mathbf{\text{i}}}+3\mathrm{sin}\left(t\right)\stackrel{^}{\mathbf{\text{j}}}+0\stackrel{^}{\mathbf{\text{k}}}\end{array}$
Now, the vector-valued function $\stackrel{\to }{\mathbf{\text{d}}}\left(u,t\right)$ should also describe a circle, but it's a bit trickier. The (blue) circular slice of the torus we want $\stackrel{\to }{\mathbf{\text{d}}}\left(u,t\right)$ to draw is at an angle. How do you draw a circle which is sitting at an angle in three-dimensional space?
Well, let's start from what we know. We know that in two dimensions, a unit circle centered at the origin can be described with the parametric function
$\begin{array}{r}\phantom{\rule{1em}{0ex}}g\left(u\right)=\left[\begin{array}{}\mathrm{cos}\left(u\right)\\ \mathrm{sin}\left(u\right)\end{array}\right]=\mathrm{cos}\left(u\right)\stackrel{^}{\mathbf{\text{i}}}+\mathrm{sin}\left(u\right)\stackrel{^}{\mathbf{\text{j}}}\end{array}$
For our desired blue circular slice, we do something similar, but we exchange $\stackrel{^}{\mathbf{\text{i}}}$ and $\stackrel{^}{\mathbf{\text{j}}}$ for different unit vectors. Take a look at this picture:
Instead of the "sideways" direction being $\stackrel{^}{\mathbf{\text{i}}}$, the unit vector in the $x$-direction, we think of it as the unit vector pointing away from the origin, which we'll call $\stackrel{^}{\mathbf{\text{v}}}$. Actually, since that direction might depend on where we start, $\stackrel{^}{\mathbf{\text{v}}}$ should​ be a vector-valued function dependent on the parameter $t$, so we write it as $\stackrel{^}{\mathbf{\text{v}}}\left(t\right)$.
Similarly the "upward" direction is no longer $\stackrel{^}{\mathbf{\text{j}}}$, but $\stackrel{^}{\mathbf{\text{k}}}$, the unit vector in the $z$-direction. Therefore, the parameterization of the circular slice should look something like this:
$\begin{array}{r}\phantom{\rule{1em}{0ex}}\stackrel{\to }{\mathbf{\text{d}}}\left(u,t\right)=\mathrm{cos}\left(u\right)\stackrel{^}{\mathbf{\text{v}}}\left(t\right)+\mathrm{sin}\left(u\right)\stackrel{^}{\mathbf{\text{k}}}\end{array}$
This of course leaves us with a question: What is the formula for $\stackrel{^}{\mathbf{\text{v}}}\left(t\right)$?
Looking at the picture, the direction away from the origin is also described by $\stackrel{\to }{\mathbf{\text{c}}}\left(t\right)$, so the formula for $\stackrel{^}{\mathbf{\text{v}}}\left(t\right)$ should be the same as that for $\stackrel{\to }{\mathbf{\text{c}}}\left(t\right)$, but scaled down to be a unit vector.
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}\stackrel{\to }{\mathbf{\text{c}}}\left(t\right)=3& \left[\begin{array}{c}\mathrm{cos}\left(t\right)\\ \mathrm{sin}\left(t\right)\\ 0\end{array}\right]\phantom{\rule{1em}{0ex}}←\text{Not a unit vector}\\ ⇓& \\ \stackrel{^}{\mathbf{\text{v}}}\left(t\right)=& \left[\begin{array}{c}\mathrm{cos}\left(t\right)\\ \mathrm{sin}\left(t\right)\\ 0\end{array}\right]\phantom{\rule{1em}{0ex}}←\text{Unit vector}\end{array}$
This means our full expression for $\stackrel{\to }{\mathbf{\text{d}}}\left(u,t\right)$ is
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}\stackrel{\to }{\mathbf{\text{d}}}\left(u,t\right)& =\mathrm{cos}\left(u\right)\stackrel{^}{\mathbf{\text{v}}}\left(t\right)+\mathrm{sin}\left(u\right)\stackrel{^}{\mathbf{\text{k}}}\\ & =\mathrm{cos}\left(u\right)\left[\begin{array}{c}\mathrm{cos}\left(t\right)\\ \mathrm{sin}\left(t\right)\\ 0\end{array}\right]+\mathrm{sin}\left(u\right)\left[\begin{array}{c}0\\ 0\\ 1\end{array}\right]=\left[\begin{array}{c}\mathrm{cos}\left(u\right)\mathrm{cos}\left(t\right)\\ \mathrm{cos}\left(u\right)\mathrm{sin}\left(t\right)\\ \mathrm{sin}\left(u\right)\end{array}\right]\end{array}$

#### Bring it on home

Remember, the whole reason we defined $\stackrel{\to }{\mathbf{\text{d}}}\left(u,t\right)$ and $\stackrel{\to }{\mathbf{\text{c}}}\left(t\right)$ was to describe each point on the torus as $\stackrel{\to }{\mathbf{\text{c}}}\left(t\right)+\stackrel{\to }{\mathbf{\text{d}}}\left(u,t\right)$. Putting this together, we have the following vector-valued two-parameter function:
$\begin{array}{rl}\phantom{\rule{1em}{0ex}}\stackrel{\to }{f}\left(u,t\right)& =\stackrel{\to }{\mathbf{\text{c}}}\left(t\right)+\stackrel{\to }{\mathbf{\text{d}}}\left(u,t\right)\\ & =3\left[\begin{array}{c}\mathrm{cos}\left(t\right)\\ \mathrm{sin}\left(t\right)\\ 0\end{array}\right]+\left[\begin{array}{c}\mathrm{cos}\left(u\right)\mathrm{cos}\left(t\right)\\ \mathrm{cos}\left(u\right)\mathrm{sin}\left(t\right)\\ \mathrm{sin}\left(u\right)\end{array}\right]\\ & =\left[\begin{array}{c}3\mathrm{cos}\left(t\right)+\mathrm{cos}\left(u\right)\mathrm{cos}\left(t\right)\\ 3\mathrm{sin}\left(t\right)+\mathrm{cos}\left(u\right)\mathrm{sin}\left(t\right)\\ \mathrm{sin}\left(u\right)\end{array}\right]\end{array}$
As $u$ ranges from $0$ to $2\pi$, the output of this function $\stackrel{\to }{f}\left(u,t\right)$ will trace one of the blue slices, and as $t$ ranges from $0$ to $2\pi$, the slices themselves will trace out the entire torus.
Here's what it might look like if we take the points from the parameter space where $0\le u\le 2\pi$ and $0\le t\le 2\pi$, and watch them move to the output of our function $\stackrel{\to }{f}\left(u,t\right)$: