Functions of several variables
Functions from ℝn to ℝ, contour plots, limits along paths, partial derivatives, the gradient and directional derivatives, the chain rule, the Hessian matrix, and homogeneous functions with Euler’s theorem.
Course notes: Syllabus ch. 8 (Multivariable calculus), first half · Exercise sessions: Sheet 11 (Partial derivatives and surfaces) · About 55 minutes
Functions of several variables and their picturesNeutral
A function f : ℝn → ℝ assigns a number to every point (x1, ..., xn) of its domain. Economic examples: output Q(L, K) of labour and capital, utility U(x, y) of two goods, profit of several prices. The building blocks are polynomial, rational, algebraic (with roots) and transcendental (exp, ln, trigonometric) functions; the domain excludes points where a denominator vanishes, a square root gets a negative argument or a logarithm a non-positive one.
For two variables there are three ways to picture f: the surface z = f(x, y) in three dimensions; the contour plot, a map of level curves f(x, y) = k (indifference curves for utility, isoquants for production); and plane intersections, the curves you get by fixing x or y.
Limits and continuityBackground
f(x, y) → L as (x, y) → (a, b) means f is close to L at every point close enough to (a, b), whatever the direction of approach. To show that a limit does not exist, find two paths with different limits.
A limit that does not exist
f(x, y) = xy / (x2 + y2) near (0, 0).
Along y = 0
Along y = x
Two paths, two different values: the limit does not exist. By contrast x2y / (x2 + y2) → 0, since its absolute value is at most |y|.
A function is continuous at a point when the limit there equals the function value. Polynomials are continuous everywhere, and sums, products, quotients (where the denominator is not 0) and compositions of continuous functions are continuous.
Partial derivatives and the gradientImportant
The partial derivative fx = ∂f/∂x differentiates with respect to x while all other variables are held constant; it is the slope of the surface in the x-direction. The gradient collects all first partials: ∇f = (fx, fy).
Partials at a point
f(x, y) = x2y + 3xy3 − ln x at (1, 2).
fx
fy
Gradient
Economic reading: if f were output, 27 would be the marginal product of input x at that point.
Properties of the gradient: it points in the direction of steepest increase; its length |∇f| is that steepest rate; and it is perpendicular to the level curve through the point.
Directional derivativesNeutral
The rate of change of f in the direction of a unit vector u is the directional derivative
A rate in a given direction
f(x, y) = x2 + 3xy at (1, 2) in the direction of (3, 4).
Gradient
Unit vector
Directional derivative
Duf = 7.2. The fastest possible rate at (1, 2) is |∇f| = √73 ≈ 8.54, in the direction of (8, 3).
Reading a contour plotImportant
Past exams show a contour plot with a marked point and ask for the signs of partial derivatives. Move from the point in the positive x-direction: if you climb to higher level values, fx > 0; if you go down, fx < 0; if you move along the level curve, fx = 0. Do the same upwards for fy. Second derivatives come from the spacing: level curves getting closer together in the +x direction mean the slope is growing in size.
| What you see moving right from the point | Conclusion |
|---|---|
| levels increase | fx > 0 |
| levels decrease | fx < 0 |
| you stay on one level curve (the curve is horizontal there) | fx = 0 |
| levels increase and the curves get closer together | fx > 0 and fxx > 0 |
The chain rule and the HessianImportant
If z = f(x, y) with x = x(t) and y = y(t), then dz/dt = fx x′(t) + fy y′(t). With x = x(u, v) and y = y(u, v): zu = fx xu + fy yu, and similarly for v. In matrix form the chain rule multiplies Jacobian matrices (the matrices of first partials).
Chain rule along a path
z = x2y with x = t2 and y = 3t.
Partials
Combine
Check directly
Both routes agree.
The Hessian is the matrix of second partials, H = fxxfxyfyxfyy. For smooth functions it is symmetric: fxy = fyx (Schwarz’s theorem). For f = x2y + 3xy3 − ln x at (1, 2): fxx = 2y + 1/x2 = 5, fxy = 2x + 9y2 = 38, fyy = 18xy = 36. Chapter 9 uses the Hessian to classify critical points.
Homogeneous functions and Euler’s theoremImportant
f is homogeneous of degree k when f(tx, ty) = tk f(x, y) for all t > 0. In economics, degree 1 means constant returns to scale (double all inputs, double output), degree above 1 increasing and below 1 decreasing returns.
| Function | f(tx, ty) | Homogeneous? |
|---|---|---|
| Q = 5L0.3K0.7 | t0.3 + 0.7 Q = t Q | yes, degree 1 |
| x2y + y3 | t3(x2y + y3) | yes, degree 3 |
| (x2 + y2) / (xy) | unchanged | yes, degree 0 |
| x + y2 | tx + t2y2 | no: the terms have different degrees |
Euler’s theorem: if f is homogeneous of degree k and differentiable, then
Euler for a Cobb-Douglas function
Q = 5L0.3K0.7.
Partials
Euler sum
With constant returns, paying each input its marginal product exactly uses up the output.
Key takeaways
- fx: differentiate in x, hold the other variables fixed.
- Gradient: direction of steepest increase, perpendicular to level curves.
- Directional derivative Duf = ∇f · u with |u| = 1.
- A limit fails to exist if two paths give different values.
- Chain rule: dz/dt = fxx′ + fyy′; the Hessian is symmetric for smooth f.
- Homogeneous of degree k: f(tx, ty) = tkf; Euler x fx + y fy = k f.
True or false (5)
f(x, y) = x3 + xy2 is homogeneous of degree 3.
The directional derivative in the direction of the gradient equals |∇f|.
If f(x, 0) → 0 and f(0, y) → 0, then the limit of f at (0, 0) is 0.
For f = exy, fx = y exy.
A function homogeneous of degree 0 is constant.
Multiple choice (7)
For f(x, y) = x3y2, fxy equals...
∇f for f = x2 + y2 at (3, 4) is...
The directional derivative of f = 2x + y in the direction (1, 0) is...
The degree of homogeneity of f = x2y3 / (x + y) is...
For z = x y, x = et, y = t, dz/dt at t = 0 is...
Moving up (positive y) from a point, you cross to lower contour values. Then...
Which f is not homogeneous?
Exam-style open questions (3)
Gradient and directional derivative
For f(x, y) = x ey + y2 at (2, 0): give the gradient, the rate of change in the direction of (1, −1), and the maximal rate.
Show a model answer outline
- fx = ey = 1, fy = x ey + 2y = 2: ∇f = (1, 2).
- u = (1, −1)/√2: Duf = (1 − 2)/√2 = −1/√2 ≈ −0.707.
- Maximal rate |∇f| = √5 ≈ 2.236, in the direction (1, 2).
Homogeneity and Euler
Show that f(x, y) = 3x2y − y3 is homogeneous and check Euler’s theorem.
Show a model answer outline
- f(tx, ty) = 3t2x2 ty − t3y3 = t3f(x, y): degree 3.
- fx = 6xy and fy = 3x2 − 3y2.
- x fx + y fy = 6x2y + 3x2y − 3y3 = 3(3x2y − y3) = 3f.
Hessian
Compute the Hessian of f(x, y) = x3 − 2x2y + y4 at (1, 1).
Show a model answer outline
- fx = 3x2 − 4xy, fy = −2x2 + 4y3.
- fxx = 6x − 4y = 2, fxy = −4x = −4, fyy = 12y2 = 12.
- H(1, 1) = [[2, −4], [−4, 12]], symmetric as expected.
LabGradient, directional derivative and Hessian lab
Use * for multiplication if you like; x^2, exp(x), ln(x), sqrt(x) all work.
LabHomogeneity and Euler lab
Try a Cobb-Douglas function and then add a constant to it.