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

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.
    f( ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣x,yMultiple numbersin the input ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣ ⁣)=x2y\quad \displaystyle f(\!\!\!\!\!\!\!\!\!\!\!\! \underbrace{x, y}_{\substack{ \text{Multiple numbers} \\ \text{in the input} }} \!\!\!\!\!\!\!\!\!\!\!\!) = x^2 y
  • 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.
    f(x)=[cos(x)sin(x)]Multiple numbers in output\displaystyle f(x) = \left[ \begin{array}{c} \cos(x) \\ \sin(x) \end{array} \right] \quad\leftarrow \small{\text{Multiple numbers in output}}
  • 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:
f, left parenthesis, x, right parenthesis, equals, x, squared
Or this:
f, left parenthesis, x, right parenthesis, equals, sine, left parenthesis, x, right parenthesis, plus, 2, square root of, x, end square root.
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.
Khan Academy video wrapper
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.
Khan Academy video wrapper

Example of different types of functions
Single-number inputMultiple-number inputs
Single-number outputf, left parenthesis, x, right parenthesis, equals, x, squaredf, left parenthesis, x, comma, y, right parenthesis, equals, x, squared, plus, y, cubed
Multiple-number outputf, left parenthesis, t, right parenthesis, equals, left parenthesis, cosine, left parenthesis, t, right parenthesis, comma, sine, left parenthesis, t, right parenthesis, right parenthesisf, left parenthesis, u, comma, v, right parenthesis, equals, left parenthesis, u, squared, minus, v, comma, v, squared, plus, u, right parenthesis

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 left parenthesis, 2, comma, 5, right parenthesis. 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 left parenthesis, 2, comma, 5, right parenthesis as a single point in two-dimensional space, with x-coordinate 2 and y-coordinate 5.
Similarly, it's fun to think about a triplet of numbers like left parenthesis, 3, comma, 1, comma, 2, right parenthesis not as three separate things, but as a single point in three-dimensional space.
Khan Academy video wrapper
So multivariable functions are all about associating points in one space with points in another space. For example, a function like f, left parenthesis, x, comma, y, right parenthesis, equals, x, squared, y, which has a two-variable input and a single-variable output, associates points in the x, y-plane with points on the number line. A function like f, left parenthesis, x, comma, y, comma, z, right parenthesis, equals, left parenthesis, y, z, comma, x, z, comma, x, y, right parenthesis 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 left parenthesis, 2, comma, 5, right parenthesis, is not thought about as a point in space, but as a vector. That is to say, an arrow which involves moving 2 to the right and 5 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, [25]\left[\begin{array}{c} 2 \\ 5\end{array}\right], or letting the symbol start bold text, i, end bold text, with, hat, on top represent the x-component while start bold text, j, end bold text, with, hat, on top represents the y-component: 2, start bold text, i, end bold text, with, hat, on top, plus, 5, start bold text, j, end bold text, with, hat, on top.
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 in 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

Global temperature
Image credit: "Annual Mean Temperature", Wikimedia, originally created by Robert A. Rohde
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:
T, equals, f, left parenthesis, L, start subscript, 1, end subscript, comma, L, start subscript, 2, end subscript, right parenthesis
  • T is temperature.
  • L, start subscript, 1, end subscript is longitude.
  • L, start subscript, 2, end subscript is latitude.
  • f is some complicated function that determines which temperature each longitude-latitude pair corresponds with.
Alternatively, you could say that the temperature T is a function of longitude L, start subscript, 1, end subscript and latitude L, start subscript, 2, end subscript and write it as T, left parenthesis, L, start subscript, 1, end subscript, comma, L, start subscript, 2, end subscript, right parenthesis.

Example 2: From time to location

Path of a particle through space.
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:
start bold text, s, end bold text, with, vector, on top, equals, f, left parenthesis, t, right parenthesis
  • start bold text, s, end bold text, with, vector, on top is a two or three dimensional "displacement vector", indicating the position of the particle.
  • t is time.
  • f is a vector-valued function.
Alternatively, you might break down components of the vector-valued function into separate scalar-valued functions x, left parenthesis, t, right parenthesis and y, left parenthesis, t, right parenthesis, which indicate the coordinates of x and y as functions of time:
x(t)=(some expression of t)y(t)=(some other expression of t)\begin{aligned} x(t) &= \dots (\text{some expression of $t$})\dots\\ y(t) &= \dots (\text{some other expression of $t$})\dots\\ \end{aligned}

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:
start bold text, v, end bold text, with, vector, on top, equals, f, left parenthesis, x, comma, y, right parenthesis
  • start bold text, v, end bold text, with, vector, on top is a two-dimensional velocity vector.
  • x and y are position coordinates.
  • f is a multivariable vector-valued function.
Alternatively, you could break up the components of the vector-valued function f and use start bold text, i, end bold text, with, hat, on top, start bold text, j, end bold text, with, hat, on top notation:
start bold text, v, end bold text, with, vector, on top, equals, g, left parenthesis, x, comma, y, right parenthesis, start bold text, i, end bold text, with, hat, on top, plus, h, left parenthesis, x, comma, y, right parenthesis, start bold text, j, end bold text, with, hat, on top
  • start bold text, v, end bold text, with, vector, on top is a two-dimensional velocity vector.
  • start bold text, i, end bold text, with, hat, on top is the unit vector in the x-direction.
  • start bold text, j, end bold text, with, hat, on top is the unit vector in the y-direction.
  • g is a scalar-valued function indicating the x component of each vector as a function of position.
  • h is a scalar-valued function indicating the y 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?

Want to join the conversation?

  • primosaur tree style avatar for user James Baugher
    I am able to handle two or three variables, but when it gets to be six or seven, it is a bit overwhelming. is there any way to help deal with that?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • leaf grey style avatar for user Qeeko
      That is usually only a problem if one insists on sticking to a geometrical understanding of such functions. Algebraically, there is not much of a difference.

      When working with any number of variables, say n of them, there is no point of trying to picture this geometrically if n > 3; keep the three-dimensional case in mind for intuition, and the formal manipulations are essentially the same as far as algebra is concerned.
      (10 votes)
  • female robot amelia style avatar for user joon choi
    Why would you want to break down components of vector values into scalar values? How would this be beneficial?
    (0 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Justin
      It is very valuable to break a vector into components. You can find how a function will change specifically in one direction (x-axis) and possibly use the scalar values to average along that axis for some range
      (16 votes)
  • hopper jumping style avatar for user Toby
    Is this the hardest math in all of Khan Academy?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • male robot johnny style avatar for user saul sias
    how can multivariable calculas help me to interact within the content of architecture meanwhile useing the varibles to define reduced reliance on a graph
    (2 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Brook
      Not sure exactly what you mean. But I'm going to attempt to answer it. Imagine a 3D graph. Imagine Manhattan's skyline planted on the x-y plane on the graph. Then the height of each building or floor can would be given by the z-coordinate. So you can model Manhattan by some function z = f(x,y). It takes two inputs, namely the x and y coordinates and spits out a single output.

      So when describing certain points of the skyline you wouldn't need to have a 3D model in front of you, you could just give a (x, y, z) vector.
      (5 votes)
  • leafers ultimate style avatar for user Andy Mainord
    So... if you have a multivariable function with two inputs and two outputs, could you just make it two different functions?
    Not to say that it would be easier. I'm just trying to visualize this and what I'm thinking it is is a bunch of functions put together. Sometimes you get multiple outputs from this, or multiple inputs or both.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Alexander Wu
      You can separate outputs from each other. For example, for F(x,y)=(x + y) i + (-x y) j, we can let P(x,y) = x + y, Q(x,y) = -x y. However, you cannot separate the inputs, because both of the outputs depend on each of the inputs. You cannot calculate P with only the value of x and no y (though there are exceptions as F(x,y)=(x^2) i + (-x y) j).

      You can just think of the function as parametric equations, P(x,y) = x + y, Q(x,y) = -x y. The multiple outputs are quite separable. However, in many cases, thinking of the two parts as one, or as a vector, is very useful for both intuition and calculations.
      (3 votes)
  • blobby green style avatar for user Ross Lloyd
    Just after the 'single point in space' video: Why is f(x,y)=x^2 * y considered to have only a single output variable when both x and y appear in the output?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • starky sapling style avatar for user Anna
    can you change a multivariable function to be represented as a vector value function? how can you do this?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • orange juice squid orange style avatar for user Darkangel
    There is nothing wrong with that - in fact - everyone here at one time didn't know anything either - but we were honest with ourselves and made the necessary efforts needed (study, practice, asking questions) in order to know something. You can do it too. As ryan said i honestly agree with this. nobody knew anything when there was no earth or cave men. Comment if you know how to do cauclus
    (2 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user A. Andoche
    It'should be great if you explain how to determinate continuity (give some tricks) or non continuity for a multivariable functions (like f:R² ==> R).
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Vaishnavi Pal
    But to think of a function on a graph or Cartesian plane is like X values or the input on ordinate and Y values or output on ordinate then how can(2,3)be treated as input?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • winston default style avatar for user AMRUTHA YL
      In a multivariable function , the funciton f ( x, y ) consists of both x and y inputs. So if we would want to find f(x,y) we would have to plug in both x and y values. If you remember in the differential equations chapter , euler's method needed us to plug in both x and y values of the differential equation to find the value of the derivative. This is similar to that. I hope you find my answer helpful.
      (1 vote)