Learn

Partial Differentiation

Contents

Profit depends on price and on how many are sold, so it is a function of two variables. Partial differentiation is calculus for functions like these. Every rule of ordinary differentiation still applies. What changes is the geometry: the graph is a surface, and a surface has a different slope in each direction.

What is a function of two variables?

A function of two variables takes a pair of numbers (x, y) and gives back one number, written f(x, y). The input is a point in a plane, not a position on a line, and the output is a height above that point. So the graph is a surface. See Functions of two variables and Surfaces in three dimensions.

The output is a height above each point, so the graph is a surface, not a curve. Full lesson: Functions of Two Variables
z = x² + y² is lowest at the origin and rises in every direction: a bowl. Full lesson: Surfaces in Three Dimensions

A level curve is a slice of the surface at one fixed height. Cut the bowl z = x² + y² at height 4 and the slice is the circle x² + y² = 4, which has radius 2. See Level curves.

That is a contour map. Each step is 4 units, so closely spaced rings mean steep ground. Full lesson: Level Curves

Do limits still work with two variables?

Yes. On a line there are two ways to approach a point. On a plane there are infinitely many paths in, and the limit must give the same value along every one of them.

On a plane there are infinitely many ways to approach a point, along any path you like. Full lesson: Limits of Functions of Two Variables

Two paths that give different values prove there is no limit. Two paths that agree prove nothing. See Limits of functions of two variables.

Continuity means the same as it did for one variable: the limit at a point exists and equals the value of the function there. See Continuity in two variables.

Picture a sheet with a rip or a step in it. Those are the points that fail. Full lesson: Continuity in Two Variables

What is a partial derivative?

A partial derivative is the rate of change of f in one direction, with the other variable held constant. To find ∂f/∂x, treat y as a constant and differentiate with respect to x as usual. The symbol is used instead of d to show that other variables exist and are being held constant. See The partial derivative.

Fix y and walk only in the x direction. That slice is an ordinary curve again. Full lesson: The Partial Derivative

No new rules are needed. The usual rules apply, with the other variables treated as numbers. A term that does not contain your variable is a constant, so its derivative is 0. See Computing partial derivatives.

Differentiate with respect to x: y is held constant and stays as a factor. Full lesson: Computing Partial Derivatives

Let f = x²y + y³. Then ∂f/∂x = 2xy, because y is a constant factor and is a constant. And ∂f/∂y = x² + 3y², because is a constant factor and differentiates to 3y².

A term that does not contain the variable you differentiate with respect to is a constant, so it vanishes. Full lesson: Computing Partial Derivatives

Now you

f = x² + 6y. What is ∂f/∂x?

f = 3x²y. What is ∂f/∂y?

What about second derivatives?

A partial derivative is itself a function of x and y, so it can be differentiated again. There are four second partial derivatives: twice in x, twice in y, x then y, and y then x. The last two are the mixed partial derivatives. See Higher partial derivatives.

Differentiate once in each and you measure how the slope in x changes as you move in y. Full lesson: Higher Partial Derivatives

The mixed derivative theorem says the order does not matter, provided both mixed partials are continuous. Take f = x²y³. Then ∂f/∂x = 2xy³, and differentiating that in y gives 6xy². Also ∂f/∂y = 3x²y², and differentiating that in x gives 6xy². See The mixed derivative theorem.

Try it: 2xy³ differentiated in y, and 3x²y² differentiated in x, both give 6xy². Full lesson: The Mixed Derivative Theorem

Now you

f = x³y³. What is ∂²f/∂x∂y?

f = x²y³. Is ∂²f/∂x∂y equal to ∂²f/∂y∂x?

How does the chain rule work here?

Suppose x and y both depend on time t. Then z = f(x, y) changes because x is changing and because y is changing. The total rate of change adds one term per variable: the partial derivative of z with respect to that variable, times how fast it changes.

dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt).

Add one term per variable: the partial derivative of z, times how fast that variable changes. Full lesson: The Chain Rule for Partial Derivatives

Draw the dependence as a tree, multiply along each branch, then add the branches. With one variable there is one branch, and the formula is the ordinary chain rule. See The chain rule for partial derivatives.

Now you

Each term multiplies ∂z/∂x by

dz/dt =

What is the gradient vector?

The gradient vector ∇f has the two partial derivatives as its components: ∇f = (∂f/∂x, ∂f/∂y). At each point it points in the direction of steepest ascent, and its length is the slope in that direction. See The gradient vector.

That gradient vector points in the steepest uphill direction from where you stand. Full lesson: The Gradient Vector

The slope in any other direction is a directional derivative. To find it, take the dot product of the gradient with a unit vector pointing in that direction. At right angles to the gradient the dot product is 0, so the slope is 0. That is why the gradient is perpendicular to the level curve through the point. See Directional derivatives.

At right angles to the gradient the slope is zero — that is why contours are level. Full lesson: Directional Derivatives

The flat plane that rests on a surface at a point is the tangent plane. The two partial derivatives give its tilt in the x and y directions, and that fixes it. See Tangent planes.

A surface is approximated near a point by a flat plane resting on it. Full lesson: Tangent Planes

Now you

∇f = (15, 20) and the unit step u = (0.6, 0.8). What is the slope along u?

Walking at right angles to the gradient, the slope is

How do you find maxima and minima on a surface?

A stationary point is a point where the surface is level in both directions at once, so both partial derivatives are 0. Solve ∂f/∂x = 0 and ∂f/∂y = 0 together to find them.

Level means level in both directions at once, so both partial derivatives must be zero. Full lesson: Stationary Points of a Surface

Then classify each one. A saddle point is level too, yet it rises in one direction and falls in another, so it is neither a maximum nor a minimum. Because a saddle is possible, the second-derivative test in two variables uses all three second partial derivatives. See Stationary points of a surface.

A saddle is level too, yet it rises one way and falls the other: neither a maximum nor a minimum. Full lesson: Stationary Points of a Surface
What the test showsWhat the point is
Curving up in every directionLocal minimum
Curving down in every directionLocal maximum
Up one way, down anotherSaddle point

Now you

A surface is stationary where

f = x² + y² − 2x − 4y. Where is it stationary?

What if the variables are constrained?

Often the variables must satisfy a condition, called a constraint. Write the constraint as g(x, y) = 0 and look for the largest or smallest value of f along that curve.

Find the smallest value of f, but only along a fixed path — a constraint. Full lesson: Lagrange Multipliers

If the gradient of f pointed across the curve at an angle, you could still move along the curve and increase f. So at the best point, the gradient of f is parallel to the gradient of g. The method of Lagrange multipliers turns that into equations: set ∇f = λ∇g, and solve the two component equations together with g = 0. The number λ measures how much the optimum changes when the constraint is loosened by one unit. See Lagrange multipliers.

So at the best point the two gradients must be parallel, differing only by a multiplier λ. Full lesson: Lagrange Multipliers

How do you integrate over a surface?

Integrate twice, once in each variable.

Under a curve the slices made an area. Under a surface the slices make a volume. Full lesson: The Volume Under a Surface

First hold y constant and integrate in x, which gives the area of one cross-section, A(y) = ∫ f(x, y) dx. Then integrate those areas in y: V = ∫ A(y) dy. The inner integral treats y as a constant, the same discipline as a partial derivative. See The volume under a surface.

Stack the slice areas along y: V = ∫ A(y) dy — an integral of integrals, two signs. Full lesson: The Volume Under a Surface

The mistakes worth naming

Learn this properly in the app

Each lesson linked above is in Math Challenge. The single-variable rules that carry over are in the rules of differentiation, the optimization ideas are in applications of differentiation, and the vector language is in vectors.

Your turn

Three to try — tap what you get.

∂/∂x of x²y

∂/∂y of x²y

Taking ∂f/∂x, you treat y as

Math ChallengePractice that adapts to you, the whole lesson ladder, and your progress saved.
Start with Math Challenge

Mr. Chalk Practice this lesson in the app