Introduction to Partial Derivatives: Learn It 1

  • Calculate the partial derivatives of a function of two variables
  • Calculate the partial derivatives of a function of more than two variables
  • Find higher-order partial derivatives of a function of two variables

Derivatives of a Function of Two Variables

In single-variable calculus, the derivative represents an instantaneous rate of change of [latex]y[/latex] with respect to [latex]x[/latex]. We write this using Leibniz notation as [latex]dy/dx[/latex], where [latex]y[/latex] is the dependent variable and [latex]x[/latex] is the independent variable.

For a function [latex]z=f(x,y)[/latex] of two variables, both [latex]x[/latex] and [latex]y[/latex] are independent variables and [latex]z[/latex] is the dependent variable. This immediately raises two questions: How do we adapt Leibniz notation for two variables? What does the derivative even mean when we have two inputs? The answer lies in partial derivatives.

partial derivatives

Let [latex]f(x, y)[/latex] be a function fo two variables.

[latex]\\[/latex]

The partial derivative of [latex]f[/latex] with respect to [latex]x[/latex], written as [latex]\frac{\partial f}{\partial x}[/latex] or [latex]f_x[/latex], is defined as

[latex]\dfrac{\partial f}{\partial x}=\underset{h\to 0}{\text{lim}}\dfrac{f(x+h,y)-f(x,y)}{h}[/latex].

The partial derivative of [latex]f[/latex] with respect to [latex]y[/latex], written as [latex]\frac{\partial f}{\partial y}[/latex] or [latex]f_y[/latex], is defined as

[latex]\dfrac{\partial f}{\partial y}=\underset{k\to 0}{\text{lim}}\dfrac{f(x,y+k)-f(x,y)}{k}[/latex].

This definition reveals two key differences from single-variable derivatives. First, the notation changes—we use the symbol [latex]\partial[/latex] instead of [latex]d[/latex]. This rounded “[latex]d[/latex]” is called “partial,” so [latex]\partial f/\partial x[/latex] is read as “the partial of [latex]f[/latex] with respect to [latex]x[/latex].”

Second, we now have two different derivatives we can compute, one with respect to each independent variable. Depending on which variable we choose, we get entirely different partial derivatives.

Use the definition of the partial derivative as a limit to calculate [latex]\partial f/\partial x[/latex] and [latex]\partial f/\partial y[/latex] for the function

[latex]f(x, y)=x^{2}-3xy+2y^{2}-4x+5y-12[/latex].

Computing Partial Derivatives

The key idea when calculating partial derivatives is simple: treat all independent variables except the one you’re differentiating with respect to as constants. Then differentiate as you would with a single-variable function.

Why does this work? When we fix [latex]y[/latex] and define [latex]g(x)=f(x,y)[/latex] as a function of [latex]x[/latex] only, we get:

[latex]g'(x)=\underset{h\to 0}{\text{lim}}\dfrac{g(x+h)-g(x)}{h}=\underset{h\to 0}{\text{lim}}\dfrac{f(x+h,y)-f(x,y)}{h}=\dfrac{\partial f}{\partial x}[/latex].

The same reasoning applies for the partial derivative with respect to [latex]y[/latex]. Fix [latex]x[/latex] and define [latex]h(y)=f(x,y)[/latex] as a function of [latex]y[/latex] only:

[latex]h'(y)=\underset{k\to 0}{\text{lim}}\dfrac{h(y+k)-h(y)}{k}=\underset{k\to 0}{\text{lim}}\dfrac{f(x,y+k)-f(x,y)}{k}=\dfrac{\partial f}{\partial y}[/latex].

All the differentiation rules you learned in single-variable calculus still apply.

To find [latex]\dfrac{\partial f}{\partial x}[/latex]: Treat [latex]y[/latex] as a constant and differentiate with respect to [latex]x[/latex].

To find [latex]\dfrac{\partial f}{\partial y}[/latex]: Treat [latex]x[/latex] as a constant and differentiate with respect to [latex]y[/latex].

Calculate [latex]\partial f/\partial x[/latex] and [latex]\partial f/\partial y[/latex] for the following functions by holding the opposite variable constant then differentiating:

  1. [latex]f(x, y)=x^{2}-3xy+2y^{2}-4x+5y-12[/latex].
  2. [latex]g(x, y)=\sin{(x^{2}y-2x+4)}[/latex]

Geometric Interpretation

How should we interpret partial derivatives geometrically? Recall that the graph of a function of two variables is a surface in [latex]\mathbb{R}^{3}[/latex]. If we remove the limit from the definition of the partial derivative with respect to [latex]x[/latex], we’re left with the difference quotient:

[latex]\dfrac{f(x+h,y)-f(x,y)}{h}[/latex].

This looks just like the difference quotient for a single-variable derivative, except [latex]y[/latex] is along for the ride as a constant. Figure 1 shows a surface described by [latex]z=f(x,y)[/latex].

A complicated curve in xyz space with a secant line through the points (x, y, f(x, y)) and (x + h, y, f(x + h, y)).
Figure 1. Secant line passing through the points [latex]\small{(x,y,f(x,y))}[/latex] and [latex]\small{(x+h,y,f(x+h,y))}[/latex].

In Figure 1, [latex]h[/latex] is positive. When we graph the points [latex]f(x, y)[/latex] and [latex]f(x+h, y)[/latex], the slope of the secant line connecting them is:

[latex]\dfrac{f(x+h,y)-f(x,y)}{h}[/latex].

This secant line runs parallel to the [latex]x[/latex]-axis. The slope represents an average rate of change of [latex]f[/latex] as we move parallel to the [latex]x[/latex]-axis. As [latex]h[/latex] approaches zero, the secant line’s slope approaches the tangent line’s slope.

If we instead change [latex]y[/latex] by an increment [latex]h[/latex] (while holding [latex]x[/latex] fixed), the secant line—and resulting tangent line—would be parallel to the [latex]y[/latex]-axis.

Therefore:

  • [latex]\dfrac{\partial f}{\partial x}[/latex] gives the slope of the tangent line to the surface parallel to the [latex]x[/latex]-axis at the point [latex](x, y, f(x, y))[/latex]
  • [latex]\dfrac{\partial f}{\partial y}[/latex] gives the slope of the tangent line to the surface parallel to the [latex]y[/latex]-axis at the point [latex](x, y, f(x, y))[/latex]

Think of partial derivatives as slopes in specific directions:

  • [latex]\dfrac{\partial f}{\partial x}[/latex]: slope when moving parallel to the [latex]x[/latex]-axis
  • [latex]\dfrac{\partial f}{\partial y}[/latex]: slope when moving parallel to the [latex]y[/latex]-axis

What about slopes in other directions? We’ll need directional derivatives for that, which we’ll discuss later.

You can also estimate partial derivatives using contour maps.

Use a contour map to estimate [latex]\partial g/\partial x[/latex] at the point [latex](\sqrt{5}, 0)[/latex] for the function

[latex]g(x, y)=\sqrt{9-x^{2}-y^{2}}[/latex].