Linear Algebra
10.46 min read

Multivariate Functions

A multivariate function f:RnRf: \mathbb{R}^n \to \mathbb{R} takes an nn-dimensional vector as input. For n=2n=2: f(x1,x2)f(x_1, x_2), whose graph is a surface in R3\mathbb{R}^3. For n>2n > 2, direct visualization is impossible — we rely on contour plots (level sets) and tools like partial derivatives.

The key difference from univariate functions: there are infinitely many directions to move in Rn\mathbb{R}^n, and ff might behave differently in each. This is why the univariate derivative (a single number) generalizes to the gradient (a vector) for multivariate functions. Understanding univariate derivatives first gives us the building blocks.

Formal View

Definition 10.3 — Multivariate Function
A multivariate function is a map f:RnRf: \mathbb{R}^n \to \mathbb{R}. For n=2n=2, the graph is a surface in R3\mathbb{R}^3: {(x1,x2,f(x1,x2))}\{(x_1, x_2, f(x_1, x_2))\}. For general nn, the level sets {x:f(x)=c}\{\mathbf{x} : f(\mathbf{x}) = c\} (contours) are used for visualization.

Why This Matters

All interesting optimization problems in data science and engineering involve multivariate functions.

  • Neural network loss: L(w1,w2,,wp)\mathcal{L}(w_1, w_2, \ldots, w_p) is a function of millions of parameters.
  • Option pricing: V(S,t)V(S, t) as a function of stock price SS and time tt.
  • Weather modeling: pressure P(x,y,t)P(x, y, t) at location (x,y)(x,y) and time tt.

Quiz

Question 1

The level set {(x1,x2):f(x1,x2)=c}\{(x_1, x_2) : f(x_1, x_2) = c\} of a function f:R2Rf: \mathbb{R}^2 \to \mathbb{R} is:

Question 2

For n>3n > 3, the graph of f:RnRf: \mathbb{R}^n \to \mathbb{R} can be visualized directly in 3D.

Common Mistakes

  • Thinking that rules from single-variable calculus automatically extend to multiple variables — some do, but many require care.
  • Confusing the graph (in Rn+1\mathbb{R}^{n+1}) with the level sets (in Rn\mathbb{R}^n) — they are different objects.