hanegreefs.com/Math II
Chapter 8 · unit 8 of 12

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.

Worked example

A limit that does not exist

f(x, y) = xy / (x2 + y2) near (0, 0).

1

Along y = 0

f(x, 0) = 0, so the limit along this path is 0
2

Along y = x

f(x, x) = x2 / (2x2) = 1/2
Answer

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).

Worked example

Partials at a point

f(x, y) = x2y + 3xy3 − ln x at (1, 2).

1

fx

2xy + 3y3 − 1/x, so fx(1, 2) = 4 + 24 − 1 = 27
2

fy

x2 + 9xy2, so fy(1, 2) = 1 + 36 = 37
3

Gradient

∇f(1, 2) = (27, 37)
Answer

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

Formula
Duf = ∇f · u = fxu1 + fyu2
Worked example

A rate in a given direction

f(x, y) = x2 + 3xy at (1, 2) in the direction of (3, 4).

1

Gradient

∇f = (2x + 3y, 3x) = (8, 3) at (1, 2)
2

Unit vector

u = (3, 4) / 5 = (0.6, 0.8)
3

Directional derivative

8 · 0.6 + 3 · 0.8 = 7.2
Answer

Duf = 7.2. The fastest possible rate at (1, 2) is |∇f| = √73 ≈ 8.54, in the direction of (8, 3).

Common trapNormalise the direction first. Using (3, 4) itself would give 36, five times too large.

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 pointConclusion
levels increasefx > 0
levels decreasefx < 0
you stay on one level curve (the curve is horizontal there)fx = 0
levels increase and the curves get closer togetherfx > 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).

Worked example

Chain rule along a path

z = x2y with x = t2 and y = 3t.

1

Partials

zx = 2xy, zy = x2; x′ = 2t, y′ = 3
2

Combine

dz/dt = 2xy · 2t + x2 · 3 = 2t2(3t)(2t) + 3t4 = 15t4
3

Check directly

z = t4 · 3t = 3t5, whose derivative is 15t4
Answer

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.

Functionf(tx, ty)Homogeneous?
Q = 5L0.3K0.7t0.3 + 0.7 Q = t Qyes, degree 1
x2y + y3t3(x2y + y3)yes, degree 3
(x2 + y2) / (xy)unchangedyes, degree 0
x + y2tx + t2y2no: the terms have different degrees

Euler’s theorem: if f is homogeneous of degree k and differentiable, then

Formula
x fx + y fy = k f
Worked example

Euler for a Cobb-Douglas function

Q = 5L0.3K0.7.

1

Partials

QL = 0.3 Q / L and QK = 0.7 Q / K
2

Euler sum

L QL + K QK = 0.3Q + 0.7Q = Q
Answer

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.

Loading cards
Question
Click, tap or press space to flip
Answer

True or false (5)

Statement 1 · Chapter 8 · true or false

f(x, y) = x3 + xy2 is homogeneous of degree 3.

Why: Every term has degree 3.
Statement 2 · Chapter 8 · true or false

The directional derivative in the direction of the gradient equals |∇f|.

Why: u = ∇f / |∇f| gives ∇f · u = |∇f|.
Statement 3 · Chapter 8 · true or false

If f(x, 0) → 0 and f(0, y) → 0, then the limit of f at (0, 0) is 0.

Why: Other paths can still give a different value, as for xy / (x2 + y2).
Statement 4 · Chapter 8 · true or false

For f = exy, fx = y exy.

Why: Chain rule with y constant.
Statement 5 · Chapter 8 · true or false

A function homogeneous of degree 0 is constant.

Why: y / x is homogeneous of degree 0 but not constant; it is constant along rays from the origin.

Multiple choice (7)

Question 1 · Chapter 8

For f(x, y) = x3y2, fxy equals...

Why: fx = 3x2y2, then differentiate in y.
Question 2 · Chapter 8

∇f for f = x2 + y2 at (3, 4) is...

Why: (2x, 2y).
Question 3 · Chapter 8

The directional derivative of f = 2x + y in the direction (1, 0) is...

Why: fx = 2.
Question 4 · Chapter 8

The degree of homogeneity of f = x2y3 / (x + y) is...

Why: 5 − 1 = 4.
Question 5 · Chapter 8

For z = x y, x = et, y = t, dz/dt at t = 0 is...

Why: y et + x · 1 = 0 + 1.
Question 6 · Chapter 8

Moving up (positive y) from a point, you cross to lower contour values. Then...

Why: The function decreases in the y-direction.
Question 7 · Chapter 8

Which f is not homogeneous?

Why: Terms of degree 2 and 1.

Exam-style open questions (3)

Open question · Chapter 8

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).
Open question · Chapter 8

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.
Open question · Chapter 8

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.