Multivariable Calculus Chapter 4 of 9

Chapter 4: Partial Derivatives

Functions of several variables, level curves, limits, partial derivatives, tangent planes and the chain rule.

All chapters
On this page
4.1

Functions of several variables

In single variable calculus, you studied functions that take a single number \(x\) and output a number \(y = f(x)\). The graph of such a function is a curve in a two dimensional plane. Now we step up to functions that take multiple inputs. A function of two variables, written as \(f(x,y)\), takes an ordered pair of numbers \((x,y)\) from a subset of the plane and assigns a single output number \(z = f(x,y)\).

Geometrically, think of \(x\) and \(y\) as coordinates on the flat ground, and \(z\) as the height above the ground. As you move the point \((x,y)\) around, the height \(f(x,y)\) changes. The collection of all points \((x,y,f(x,y))\) in three dimensional space forms a surface, which is the graph of the function. For example, the function \(f(x,y) = x^2 + y^2\) gives the height of a bowl resting on the origin.

Because drawing three dimensional surfaces on flat paper or screens is hard, we often use level curves. A level curve is a slice of the surface made by cutting it with a flat horizontal plane at height \(z = k\), and then looking straight down from above to project those slices onto the \(xy\) plane. Each curve corresponds to a constant value of \(k\). Weather maps use this exact idea: contour lines on a topographic map are level curves of elevation, where every point along a single line has the exact same height above sea level.

We can also extend this to three variables. A function \(f(x,y,z)\) takes a point in three dimensional space and assigns a number to it. We cannot easily draw the graph of a function of three variables because it would live in four dimensions. Instead, we use level surfaces. For a fixed constant \(k\), the equation \(f(x,y,z) = k\) defines a surface in three dimensional space. Think of temperature inside a room: at any point \((x,y,z)\) there is a temperature, and the points sharing the exact same temperature form a three dimensional bubble or surface inside the room.

4.2

Limits and continuity

In single variable calculus, when you take the limit of a function as \(x\) approaches a number \(a\), the variable \(x\) can only approach \(a\) from two directions, from the left or from the right. For a function of two variables \(f(x,y)\), the point \((x,y)\) can approach a target point \((a,b)\) from infinitely many directions in the plane. Imagine standing on a flat plane and walking toward a destination marker from the north, south, east, west, or along a spiral path. For a limit to exist, the function values must settle down to the exact same target number no matter what path you take to get there.

Definition: Limit of a function of two variables

We write \[\lim_{(x,y)\to(a,b)} f(x,y) = L\] if we can make the values of \(f(x,y)\) as close to \(L\) as we want by taking the point \((x,y)\) sufficiently close to, but not equal to, the point \((a,b)\), along any possible path.

If you approach the point \((a,b)\) along two different paths and find two different limiting values, the limit does not exist.

Example 4.1: Limit does not exist

Show that \(\lim_{(x,y)\to(0,0)} \frac{x^2 y}{x^4 + y^2}\) does not exist.

Solution.

First, let us approach the origin along the horizontal line \(y = 0\).

Substituting \(y = 0\) into the expression gives \(\frac{x^2(0)}{x^4 + 0} = 0\).

Taking the limit as \(x\) approaches \(0\) along this path gives \(0\).

Next, let us approach the origin along the parabola \(y = x^2\).

Substituting \(y = x^2\) into the expression gives \(\frac{x^2(x^2)}{x^4 + (x^2)^2} = \frac{x^4}{x^4 + x^4}\).

Simplifying this fraction gives \(\frac{x^4}{2x^4} = 1/2\) for all non-zero \(x\).

Taking the limit as \(x\) approaches \(0\) along this path gives \(1/2\).

Since the limit along \(y = 0\) is \(0\) and along \(y = x^2\) it is \(1/2\), the two paths yield different values.

Therefore, the limit does not exist.

Continuity for a multivariable function is defined just like in single variable calculus. A function \(f(x,y)\) is continuous at a point \((a,b)\) if the function is defined at that point, the limit as \((x,y)\) approaches \((a,b)\) exists, and the limit equals the function value at that point.

4.3

Partial derivatives

When you have a function of several variables, you want to know how fast the output changes when you vary just one input at a time, holding all other inputs completely still. This leads to the partial derivative. Geometrically, if you stand on a surface and look strictly along a direction parallel to the \(x\) axis, ignoring any sideways motion in \(y\), the slope of the surface in that exact direction is the partial derivative with respect to \(x\).

Definition: Partial derivative

The partial derivative of \(f(x,y)\) with respect to \(x\) at the point \((a,b)\) is defined as \[\frac{\partial f}{\partial x}(a,b) = \lim_{h\to 0} \frac{f(a+h, b) - f(a,b)}{h}\] provided the limit exists. To calculate this in practice, you treat \(y\) as a constant number and differentiate \(f(x,y)\) normally with respect to \(x\).

Similarly, the partial derivative with respect to \(y\), written as \(\frac{\partial f}{\partial y}\), is found by treating \(x\) as a constant and differentiating with respect to \(y\). Alternative notations include \(f_x\), \(f_y\), or \(D_1 f\).

Because partial derivatives are themselves functions of \(x\) and \(y\), you can take their derivatives again. This gives second order partial derivatives. You can differentiate with respect to \(x\) twice, getting \(\frac{\partial^2 f}{\partial x^2}\) or \(f_{xx}\). You can also take mixed partial derivatives, where you differentiate with respect to \(x\) and then with respect to \(y\), written as \(\frac{\partial^2 f}{\partial y \partial x}\) or \(f_{xy}\).

Theorem: Equality of mixed partials

If the second order partial derivatives \(f_{xy}\) and \(f_{yx}\) are continuous on an open disc around a point \((a,b)\), then the order in which you take the partial derivatives does not matter. That is, \[f_{xy}(a,b) = f_{yx}(a,b)\]

4.4

Tangent planes and linear approximation

In single variable calculus, a differentiable function is locally approximated by a straight tangent line. In multivariable calculus with two variables, a differentiable function is locally approximated by a flat tangent plane. Being able to take partial derivatives at a point does not automatically guarantee that the function is smooth or that a tangent plane exists. The surface must not have sharp corners, tears, or vertical cliffs.

Definition: Differentiability

A function \(f(x,y)\) is differentiable at \((a,b)\) if the change \(\Delta z = f(a+dx, b+dy) - f(a,b)\) can be written in the form \[\Delta z = f_x(a,b)dx + f_y(a,b)dy + \epsilon_1 dx + \epsilon_2 dy\] where \(\epsilon_1\) and \(\epsilon_2\) approach zero as the step sizes \((dx, dy)\) approach zero.

If the partial derivatives \(f_x\) and \(f_y\) are continuous near the point \((a,b)\), the function is guaranteed to be differentiable there. Once we know a function is differentiable, we can build its tangent plane.

Definition: Tangent plane

If \(f(x,y)\) has continuous partial derivatives at \((a,b)\), the equation of the tangent plane to the surface \(z = f(x,y)\) at the point \((a, b, f(a,b))\) is \[z - f(a,b) = f_x(a,b)(x - a) + f_y(a,b)(y - b)\]

We use this tangent plane for linear approximation. When \((x,y)\) is very close to \((a,b)\), the height of the tangent plane is extremely close to the height of the actual curved surface. We write the linear approximation as \(f(x,y) \approx f(a,b) + f_x(a,b)(x-a) + f_y(a,b)(y-b)\).

Example 4.2: Tangent plane

Find the tangent plane to \(z = x^2 y^3\) at \((2, 1, 4)\).

Solution.

Let \(f(x,y) = x^2 y^3\). The point of tangency is \((a,b) = (2,1)\) and the height is \(f(2,1) = (2^2)(1^3) = 4\).

First, compute the partial derivative with respect to \(x\): \(f_x(x,y) = 2x y^3\).

Evaluate \(f_x\) at the point \((2,1)\): \(f_x(2,1) = 2(2)(1^3) = 4\).

Next, compute the partial derivative with respect to \(y\): \(f_y(x,y) = 3x^2 y^2\).

Evaluate \(f_y\) at the point \((2,1)\): \(f_y(2,1) = 3(2^2)(1^2) = 3(4)(1) = 12\).

Substitute the point and these partial derivatives into the tangent plane formula:

\(z - 4 = 4(x - 2) + 12(y - 1)\).

Expand the right side: \(z - 4 = 4x - 8 + 12y - 12\).

Simplify to find the final equation of the tangent plane: \(z = 4x + 12y - 16\).

4.5

The chain rule

The chain rule in single variable calculus tells us how to differentiate a composite function, such as \(f(g(x))\). In multivariable calculus, composite functions arise when the variables inside a function are themselves functions of other variables. For instance, suppose the temperature \(z\) on a metal plate depends on position \(x\) and \(y\), so \(z = f(x,y)\). If an ant walks across the plate, its position \((x,y)\) changes over time \(t\), meaning \(x = x(t)\) and \(y = y(t)\). If we want to know how fast the temperature changes from the ant's perspective as time passes, we need the multivariable chain rule.

Theorem: Chain rule, intermediate variables

Suppose that \(z = f(x,y)\) is a differentiable function of \(x\) and \(y\), and that \(x = x(t)\) and \(y = y(t)\) are differentiable functions of \(t\). Then \(z\) is a differentiable function of \(t\), and \[\frac{dz}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt}\]

Think of this formula using a tree diagram. To get from \(z\) to \(t\), there are two separate branches through \(x\) and \(y\). You calculate the rate along each branch by multiplying derivatives, and then you add the two branches together. If there are more variables, you simply add more branches.

Example 4.3: Chain rule calculation

If \(z = x^2 + xy\) with \(x = r\cos\theta\) and \(y = r\sin\theta\), find \(\partial z / \partial r\) at \(r = 2\), \(\theta = 0\).

Solution.

Write out the chain rule formula for the derivative with respect to \(r\):

\[\frac{\partial z}{\partial r} = \frac{\partial z}{\partial x}\frac{\partial x}{\partial r} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial r}\]

Compute the partial derivatives of \(z\) with respect to its intermediate variables:

\(\frac{\partial z}{\partial x} = 2x + y\) and \(\frac{\partial z}{\partial y} = x\).

Compute the partial derivatives of \(x\) and \(y\) with respect to \(r\):

\(\frac{\partial x}{\partial r} = \cos\theta\) and \(\frac{\partial y}{\partial r} = \sin\theta\).

Substitute these into the chain rule expression:

\[\frac{\partial z}{\partial r} = (2x + y)\cos\theta + x\sin\theta\]

Find the values of \(x\) and \(y\) when \(r = 2\) and \(\theta = 0\):

\(x = 2\cos(0) = 2\) and \(y = 2\sin(0) = 0\).

Substitute \(x = 2\), \(y = 0\), \(r = 2\), and \(\theta = 0\) into the derivative expression:

\[\frac{\partial z}{\partial r} = (2(2) + 0)\cos(0) + (2)\sin(0)\]

Evaluate the trigonometric terms: \(\cos(0) = 1\) and \(\sin(0) = 0\).

Calculate the final numerical value: \((4)(1) + (2)(0) = 4\).

4.6

Practice

Practice 1: try it first

Find \(f_{xy}\) for \(f = x^2 y^3\).

Show the answer

\(6 x y^{2}\)

Practice 2: try it first

Use differentials to estimate the change in \(V = \pi r^2 h\) at \(r = 3\), \(h = 5\) when \(r\) rises by \(0.1\) and \(h\) falls by \(0.2\).

Show the answer

\(dV = 1.2\pi\)

Practice 3: try it first

For \(x^2 + y^2 + z^2 = 14\) find \(\partial z / \partial x\) at \((1, 2, 3)\).

Show the answer

\(-1/3\)

Want a hint instead of an answer? Practise this chapter with the tutor.