# What are multivariable functions?

An overview of multivariable functions, with a sneak preview of what applying calculus to such functions looks like.

## What we're building to

- A function is called
**multivariable**if its input is made up of multiple numbers. - If the output of a function consists of multiple numbers, it can also be called multivariable, but these ones are also commonly called
**vector-valued functions**. - Visualizing these functions is all about thinking of space with multiple dimensions (typically just two or three if we don't want our brains to explode).

## What are multivariable functions?

When I first learned about functions, and maybe this is true for you too, I remember always thinking about them as taking in a number and outputting a number. A typical example would be something like this:

Or this:

.

And if you think back to the first time you learned about functions, you might have been taught to imagine the function as a machine which sucks in some input, somehow manipulates it, then spits out an output.

But really, functions don't just have to take in and spit out numbers, they can take in any

*thing*and spit out any*thing*. In**multivariable**calculus, that thing can be a**list of numbers**. That is to say, the input and/or output can consists of multiple numbers.Single-number input | Multiple-number inputs | |
---|---|---|

Single-number output | ||

Multiple-number output |

A

**multivariable function**is just a function whose input and/or output is made up of multiple numbers. In contrast, a function with single-number inputs and a single-number outputs is called a**single-variable function**.**Note**: Some authors and teachers use the word multivariable for functions with multiple-number inputs, not outputs.

## Lists of numbers $\leftrightarrow$ points in space

What makes multivariable calculus beautiful is that visualizing functions, along with all the new calculus you will learn to manipulate them, involves space with multiple dimensions.

For example, say the input of some function you are dealing is a pair of numbers, like . You

*could*think about this as two separate things: the number two and the number five.However, it's more common to represent a pair like as a single point in two-dimensional space, with -coordinate and -coordinate .

Similarly, it's fun to think about a triplet of numbers like not as three separate things, but as a single point in three-dimensional space.

So multivariable functions are all about associating points in one space with points in another space. For example, a function like , which has a two-variable input and a single-variable output, associates points in the -plane with points on the number line. A function like associates points in three-dimensional space with other points in three-dimensional space.

In the next few articles, I'll go over various methods you can use to visualize these functions. These visualizations can be beautiful and often extremely helpful for understanding why a formula looks the way it does. However, it can also be mind-bendingly confusing at times, especially if the number of dimensions involved is greater than three.

I think it is comforting to sit back and realize that at the end of the day, it's all just numbers. Maybe it's a pair of numbers turning into a triplet, or maybe it's one hundred numbers turning into one hundred thousand, but ultimately any task that you perform—or that a computer performs—is done one number at a time.

## Vector-valued functions

Sometimes a list of numbers, like , is not thought about as a

*point*in space, but as a*vector*. That is to say, an arrow which involves moving to the right and up as you go from its tail to its tip.To emphasize the conceptual difference, it's common to use a different notation, either writing the numbers vertically, $\left[\begin{array}{c} 2 \\ 5\end{array}\right]$, or letting the symbol $\hat{\textbf{i}}$ represent the -component while $\hat{\textbf{j}}$ represents the -component: $2\hat{\textbf{i}} + 5 \hat{\textbf{j}}$.

This is, of course, only a conceptual difference. A list of numbers is a list of numbers no matter whether you choose to represent it with an arrow or a point. Depending on the context, though, it can feel more natural to think about vectors. Velocity and force, for instance, are almost always represented as vectors, since this gives the strong visual of movement, or of pushing and pulling.

For whatever reason, when it comes to multivariable functions, it is more commonly the output that you think of as a vector, while you think about the input as a point. This is not a rule, it just happens to play out that way I guess.

#### Terminology

Functions whose output is a vector are called

**vector-valued functions**, while functions with a single number as their output are called either**scalar-valued**, as is common in engineering, or**real-valued**, as is common is pure math (real as in real number).## Examples of multivariable functions

The more you try to model the real world, the more you realize just how constraining single-variable calculus can be. Here are just a few examples of where multivariable functions arise.

## Example 1: From location to temperature

To model varying temperatures in a large region, you could use a function which takes in two variables—longitude and latitude, maybe even altitude as a third—and outputs one variable, the temperature. Written down, here's how that might look:

- is temperature.
- is longitude.
- is latitude.
- is some complicated function that determines which temperature each longitude-latitude pair corresponds with.

Alternatively, you could say that the temperature is a function of longitude and latitude and write it as .

## Example 2: From time to location

To model how a particle moves through space over time, you could use a function which takes in one number—the time—and outputs the coordinates of the particle, perhaps two or three numbers depending on the dimension you are modeling.

There are a couple different ways this could be written down:

- is a two or three dimensional "displacement vector", indicating the position of the particle.
- is time.
- is a vector-valued function.

Alternatively, you might break down components of the vector-valued function into separate scalar-valued functions and , which indicate the coordinates of x and y as functions of time:

## Example 3: From user data to prediction

When a website tries to predict a user's behavior, it might create a function that takes in thousands of variables, including the user's age, the coordinates of their location, the number of times they've clicked on links of a certain type, etc. The output might also include multiple variables, such as the probability they will click on a different link or the probability they purchase a different item.

## Example 4: From position to a velocity vector

If you are modeling the flow of a fluid, one approach is to express the velocity of each individual particle in the fluid. To do this, imagine a function which takes as its input the coordinates of a particle, and which outputs the velocity vector of that particle.

Again, there are several ways this might look written down:

- is a two-dimensional velocity vector.
- and are position coordinates.
- is a multivariable vector-valued function.

Alternatively, you could break up the components of the vector-valued function and use $\hat{\textbf{i}}$, $\hat{\textbf{j}}$ notation:

- is a two-dimensional velocity vector.
- $\hat{\textbf{i}}$ is the unit vector in the -direction.
- $\hat{\textbf{j}}$ is the unit vector in the -direction.
- is a scalar-valued function indicating the component of each vector as a function of position.
- is a scalar-valued function indicating the component of each vector as a function of position.

## Where calculus fits in

There are two fundamental topics in calculus:

**Derivatives**, which study the*rate of change*of a function as you tweak its input.**Integrals**, which study how to*add together infinitely many infinitesimal quantities*that make up a function's output.

Multivariable calculus extends these ideas to functions with higher-dimensional inputs and/or outputs.

With respect to the examples above, rates of change could refer to the following:

- How temperature changes as you move in a some direction.
- The amount an online shopper's behavior changes as some aspect of the site changes.
- The fluctuations in flow rate across space.

On the other hand, "add together infinitely many infinitesimal quantities" might mean

- Finding the average temperature.
- Computing the total work done on a particle by some external force while it moves.
- Describing the net velocity of an entire region of some flowing liquid.

What makes these cases fundamentally different from single variable calculus is that we will need to describe changes in

*different directions*, as well as how those changes relate to each other. You'll see what I mean in coming topics.**Concept Check**: In Example 2 above, where the location of a particle is described as a function of time, what would be an example of a rate of change we might be interested in?