Math Core

Lesson 3.1 · Partial Derivatives

Functions of several variables

Most quantities you meet outside a textbook depend on more than one input. The temperature in a room depends on where you stand, the cost of a box depends on its length, width and height, and the monthly payment on a loan depends on the principal, the rate and the term. To do calculus with these quantities, you first need a clear picture of what a function of several variables is and how to see one.

Functions of two variables

A function of two variables takes an ordered pair and returns one number.

Definition

Function of two variables

A function of two variables ff assigns to each point (x,y)(x, y) in a set D⊆R2D \subseteq \mathbb{R}^2 exactly one real number f(x,y)f(x, y). The set DD is the domain of ff, and the set of all output values is the range.

You will often write z=f(x,y)z = f(x, y) and call xx and yy the independent variables and zz the dependent variable. Evaluating works just like one-variable functions: substitute and simplify. For f(x,y)=x2y−3y+2f(x, y) = x^2 y - 3y + 2,

f(2,−1)=(2)2(−1)−3(−1)+2=−4+3+2=1.f(2, -1) = (2)^2(-1) - 3(-1) + 2 = -4 + 3 + 2 = 1.

The same idea extends to three or more variables. A function g(x,y,z)g(x, y, z) takes a point in space and returns a number, such as the temperature at that point.

Finding the domain

When a function is given only by a formula, its domain is every point where the formula makes sense as a real number. The usual restrictions carry over from single-variable calculus:

  • you cannot divide by zero,
  • the expression under an even root must be ≥0\ge 0,
  • the input of a logarithm must be >0> 0.

The difference is that the domain is now a region in the plane, so describe it with an inequality in xx and yy and, when you can, a sketch.

Worked example: Domain of a square-root function

Find and describe the domain and range of f(x,y)=9−x2−y2f(x, y) = \sqrt{9 - x^2 - y^2}.

The radicand must be nonnegative: 9−x2−y2≥09 - x^2 - y^2 \ge 0, or x2+y2≤9x^2 + y^2 \le 9. The domain is the closed disk of radius 33 centered at the origin, including its boundary circle.

For the range, x2+y2x^2 + y^2 runs from 00 (at the origin) to 99 (on the circle), so 9−x2−y29 - x^2 - y^2 runs from 99 down to 00 and its square root runs from 33 down to 00. The range is [0,3][0, 3].

Worked example: Domain of a logarithm

Find the domain of f(x,y)=ln⁡(x−y)f(x, y) = \ln(x - y).

The logarithm needs x−y>0x - y > 0, which is the same as y<xy < x. The domain is every point strictly below the line y=xy = x. The line itself is not included, because ln⁡0\ln 0 is undefined.

Graphs are surfaces

The graph of f(x,y)f(x, y) is the set of points (x,y,z)(x, y, z) in space with z=f(x,y)z = f(x, y). Above each input point in the xyxy-plane you plot a height, so the graph is a surface.

Some graphs you already know from the quadric surfaces in the first unit. The graph of f(x,y)=9−x2−y2f(x, y) = \sqrt{9 - x^2 - y^2} is the upper half of the sphere x2+y2+z2=9x^2 + y^2 + z^2 = 9. The graph of f(x,y)=x2+y2f(x, y) = x^2 + y^2 is a paraboloid opening upward, and the graph of f(x,y)=6−2x−3yf(x, y) = 6 - 2x - 3y is a plane.

Surfaces are hard to draw by hand, and a single 3D picture hides as much as it shows. That is why the next tool is so useful.

Level curves and contour maps

A topographic map shows a mountain on flat paper by drawing curves of constant elevation. You can do the same for any function of two variables.

Definition

Level curve

The level curves of f(x,y)f(x, y) are the curves f(x,y)=kf(x, y) = k in the xyxy-plane, one for each constant kk in the range of ff. A picture of several level curves is a contour map.

Each level curve is what you get by slicing the surface z=f(x,y)z = f(x, y) with the horizontal plane z=kz = k and dropping the slice straight down into the xyxy-plane. If you draw level curves for equally spaced values of kk, then curves that crowd together mean the surface is steep there, and curves that spread apart mean it is nearly flat.

Worked example: Level curves of an elliptic paraboloid

Sketch level curves of f(x,y)=x2+4y2f(x, y) = x^2 + 4y^2 for k=4k = 4, 1616 and 3636.

Set x2+4y2=kx^2 + 4y^2 = k. For k>0k > 0 this is an ellipse. Dividing by kk gives x2k+y2k/4=1\dfrac{x^2}{k} + \dfrac{y^2}{k/4} = 1, so the ellipse crosses the xx-axis at ±k\pm\sqrt{k} and the yy-axis at ±12k\pm\tfrac{1}{2}\sqrt{k}.

  • k=4k = 4: intercepts x=±2x = \pm 2, y=±1y = \pm 1.
  • k=16k = 16: intercepts x=±4x = \pm 4, y=±2y = \pm 2.
  • k=36k = 36: intercepts x=±6x = \pm 6, y=±3y = \pm 3.
Level curves x² + 4y² = 4, 16, 36 of f(x, y) = x² + 4y².Open in grapher →

The heights 4,16,364, 16, 36 are not equally spaced, but notice that the ellipses spread apart at a steady rate while the heights grow faster and faster. That is the signature of a surface that gets steeper as you move away from the origin, which is exactly what an upward paraboloid does. For k=0k = 0 the level "curve" is the single point (0,0)(0, 0), the bottom of the bowl, and for k<0k < 0 there is no level curve at all.

Worked example: Level curves that are parabolas

Describe the level curves of f(x,y)=y−x2f(x, y) = y - x^2.

Setting y−x2=ky - x^2 = k gives y=x2+ky = x^2 + k: a family of upward parabolas, each a vertical shift of y=x2y = x^2.

Level curves y = x² + k for k = −2, 0, 2, 4.Open in grapher →

Because the curves are identical parabolas shifted by equal amounts, the surface rises at a steady rate as you move straight up in the yy direction.

Tip

To find the level curve through a particular point, first evaluate ff at that point to get kk, then write f(x,y)=kf(x, y) = k.

Three variables: level surfaces

The graph of a function w=g(x,y,z)w = g(x, y, z) would live in four dimensions, so you cannot draw it. Instead, you study its level surfaces g(x,y,z)=kg(x, y, z) = k. For g(x,y,z)=x2+y2+z2g(x, y, z) = x^2 + y^2 + z^2, the level surfaces are spheres centered at the origin with radius k\sqrt{k}. If gg gives the temperature at each point, the level surfaces are surfaces of constant temperature.

Common mistake

Level curves live in the xyxy-plane, not on the surface. A level curve f(x,y)=kf(x, y) = k is an equation in two variables only. Writing zz into it, or treating it as the surface itself, is a common source of confusion. The value kk tells you which height the curve represents.

Practice

Practice 1

Let f(x,y)=x2y−3y+2f(x, y) = x^2 y - 3y + 2. Find f(2,−1)f(2, -1).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Let g(x,y,z)=x2+yzg(x, y, z) = x^2 + yz. Find g(1,2,−3)g(1, 2, -3).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Which set is the domain of f(x,y)=x−y2f(x, y) = \sqrt{x - y^2}?

Practice 4

The range of f(x,y)=16−x2−y2f(x, y) = \sqrt{16 - x^2 - y^2} is an interval [0,M][0, M]. Find MM.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

The level curve x2+4y2=kx^2 + 4y^2 = k of f(x,y)=x2+4y2f(x, y) = x^2 + 4y^2 passes through the point (2,1)(2, 1). Find kk.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

The level curve of f(x,y)=y−x2f(x, y) = y - x^2 at height k=3k = 3 is the graph of y=g(x)y = g(x). Enter g(x)g(x).

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 7

What are the level surfaces x2+y2+z2=kx^2 + y^2 + z^2 = k (with k>0k > 0) of g(x,y,z)=x2+y2+z2g(x, y, z) = x^2 + y^2 + z^2?

Practice 8

The level curve of f(x,y)=ln⁡(y−x)f(x, y) = \ln(y - x) that passes through (2,3)(2, 3) is a line y=h(x)y = h(x). Enter h(x)h(x).

Enter an expression, e.g. 3x^2 - 2x + 1