Partial Derivatives

Many real-world phenomena depend on multiple factors simultaneously. For instance, the temperature in a room might vary with its length, width, and height, or a company's profit could depend on production cost and sales volume. When a function has more than one input variable, traditional differentiation only tells us the rate of change with respect to a single variable, assuming all others are constant. Partial derivatives extend this concept, allowing us to analyze how a multivariable function changes when only one of its independent variables varies.

Functions of Multiple Variables

A multivariable function is a function that takes multiple independent variables as input and produces a single output. For example, f(x,y)=x2+3xy−y3f(x,y) = x^2 + 3xy - y^3 is a function of two variables, xx and yy. Its domain is typically a subset of Rn\mathbb{R}^n, where nn is the number of input variables, and its output is a real number. These functions often represent surfaces in 3D space or higher-dimensional hypersurfaces.

Multivariable Function
A function that maps a tuple of real numbers (x1,x2,…,xn)(x_1, x_2, \dots, x_n) to a single real number, f(x1,x2,…,xn)=zf(x_1, x_2, \dots, x_n) = z.
Example: The volume of a cylinder, V(r,h)=πr2hV(r,h) = \pi r^2 h, is a multivariable function of its radius rr and height hh.

The Core Idea: Differentiating Along an Axis

When we compute a partial derivative, we are essentially treating all other independent variables as if they were constants. This transforms the multivariable function into a single-variable function, which we can then differentiate using standard calculus rules. For example, to find the partial derivative of f(x,y)f(x,y) with respect to xx, we hold yy constant and differentiate ff as if it were only a function of xx. This process isolates the impact of one variable's change on the function's output.

💡 Slicing the Surface

Imagine a 3D surface representing f(x,y)f(x,y). When you hold yy constant, you are effectively taking a slice of that surface parallel to the xzxz-plane. The partial derivative with respect to xx then gives you the slope of the tangent line to that specific 2D curve.

Notation for Partial Derivatives

Several notations are used to denote partial derivatives, all conveying the same meaning. The most common is the curly 'd' symbol, ∂\partial. When differentiating f(x,y)f(x,y) with respect to xx, we write ∂f∂x\frac{\partial f}{\partial x} or fxf_x. Similarly, for yy, it's ∂f∂y\frac{\partial f}{\partial y} or fyf_y. If the function is defined as z=f(x,y)z = f(x,y), we might also see ∂z∂x\frac{\partial z}{\partial x} or ∂z∂y\frac{\partial z}{\partial y}. These notations clearly distinguish partial differentiation from ordinary differentiation.

📐 Common Notations

For a function f(x,y)f(x,y):

Partial derivative with respect to xx:

∂f∂x=fx=∂∂xf(x,y)\frac{\partial f}{\partial x} = f_x = \frac{\partial}{\partial x} f(x,y)

Partial derivative with respect to yy:

∂f∂y=fy=∂∂yf(x,y)\frac{\partial f}{\partial y} = f_y = \frac{\partial}{\partial y} f(x,y)

Computing First-Order Partial Derivatives

To compute a partial derivative, simply apply the familiar rules of differentiation (power rule, product rule, chain rule, etc.) while treating all variables other than the one you are differentiating with respect to as constants. For example, if you are finding ∂f∂x\frac{\partial f}{\partial x}, any term involving only yy (or other variables) will be treated as a constant, and its derivative with respect to xx will be zero. Terms like xyxy will be treated as c⋅xc \cdot x, where cc is the constant yy.

pythonPartial Derivative with Respect to x
pythonPartial Derivative with Respect to y
Try It Yourself
Given the function g(u,v)=u2ev+vln⁡(u)g(u,v) = u^2 e^v + v \ln(u), compute its partial derivative with respect to uu. Use SymPy to verify your result.
python
Check Your Understanding
When computing ∂f∂y\frac{\partial f}{\partial y} for f(x,y)=x2+3xy+y2f(x,y) = x^2 + 3xy + y^2, what happens to the x2x^2 term?

Geometric Interpretation: Slices and Slopes

The partial derivative ∂f∂x\frac{\partial f}{\partial x} at a point (x0,y0)(x_0, y_0) represents the slope of the tangent line to the curve formed by intersecting the surface z=f(x,y)z = f(x,y) with the plane y=y0y = y_0. This plane is parallel to the xzxz-plane. Similarly, ∂f∂y\frac{\partial f}{\partial y} at (x0,y0)(x_0, y_0) is the slope of the tangent line to the curve formed by intersecting the surface with the plane x=x0x = x_0, which is parallel to the yzyz-plane. These slopes indicate the instantaneous rate of change in the xx or yy direction, respectively.

Geometric Interpretation of Partial Derivatives
This chart shows a 2D slice of the function f(x,y)=x2+y2f(x,y) = x^2 + y^2 when yy is held constant at y=1y=1, resulting in the curve g(x)=x2+1g(x) = x^2 + 1. The tangent line at x=1x=1 illustrates the value of ∂f∂x\frac{\partial f}{\partial x} at (1,1)(1,1).
Loading chart...
Key Insight: The partial derivative ∂f∂x\frac{\partial f}{\partial x} at (1,1)(1,1) is the slope of the tangent line to the curve g(x)=x2+1g(x) = x^2 + 1 at x=1x=1, which is 22.

Higher-Order Partial Derivatives

Just like with single-variable functions, we can take partial derivatives multiple times. These are called higher-order partial derivatives. For a function f(x,y)f(x,y), we can compute second-order partial derivatives such as ∂2f∂x2\frac{\partial^2 f}{\partial x^2} (or fxxf_{xx}), which means differentiating ff twice with respect to xx. We can also compute ∂2f∂y2\frac{\partial^2 f}{\partial y^2} (or fyyf_{yy}). More interestingly, we can compute mixed partial derivatives, like ∂2f∂y∂x\frac{\partial^2 f}{\partial y \partial x} (or fxyf_{xy}), which means differentiating first with respect to xx, then with respect to yy.

pythonComputing Second-Order Partial Derivatives

Mixed Partial Derivatives and Clairaut's Theorem

A remarkable property of many functions is that the order of differentiation for mixed partial derivatives does not matter. This means that ∂2f∂y∂x\frac{\partial^2 f}{\partial y \partial x} is equal to ∂2f∂x∂y\frac{\partial^2 f}{\partial x \partial y}. This principle is known as Clairaut's Theorem (also Schwarz's Theorem or Young's Theorem). It holds true for functions where the mixed partial derivatives are continuous in an open disk around the point in question. This theorem simplifies many calculations and is a cornerstone in fields like physics and engineering.

📐 Clairaut's Theorem

If f(x,y)f(x,y) is a function such that fxyf_{xy} and fyxf_{yx} are continuous on an open disk DD, then for every point (x,y)(x,y) in DD:

∂2f∂y∂x=∂2f∂x∂y\frac{\partial^2 f}{\partial y \partial x} = \frac{\partial^2 f}{\partial x \partial y}

Or, in subscript notation: fxy=fyxf_{xy} = f_{yx}.

Check Your Understanding
Under what condition are mixed partial derivatives guaranteed to be equal?

The Gradient Vector (Brief Introduction)

The gradient of a multivariable function is a vector that contains all its first-order partial derivatives. For a function f(x,y)f(x,y), the gradient is ∇f(x,y)=⟨∂f∂x,∂f∂y⟩\nabla f(x,y) = \left\langle \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right\rangle. This vector points in the direction of the steepest ascent of the function at a given point, and its magnitude represents the maximum rate of increase. The gradient is a fundamental concept in optimization, machine learning, and physics, as it provides a concise way to understand the overall direction of change for a function.

📐 Gradient Definition

For a function f(x1,x2,…,xn)f(x_1, x_2, \dots, x_n), the gradient vector is:

∇f=⟨∂f∂x1,∂f∂x2,…,∂f∂xn⟩\nabla f = \left\langle \frac{\partial f}{\partial x_1}, \frac{\partial f}{\partial x_2}, \dots, \frac{\partial f}{\partial x_n} \right\rangle

For a function of two variables f(x,y)f(x,y):

∇f(x,y)=⟨∂f∂x,∂f∂y⟩\nabla f(x,y) = \left\langle \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right\rangle

Key Takeaways
  • Partial derivatives measure the rate of change of a multivariable function with respect to one variable, treating all others as constants.

  • Notation like ∂f∂x\frac{\partial f}{\partial x} or fxf_x indicates differentiation with respect to a specific variable.

  • To compute a partial derivative, apply standard differentiation rules while treating other variables as constants.

  • Geometrically, a partial derivative represents the slope of a tangent line to a 2D slice of the function's surface.

  • Higher-order partial derivatives involve differentiating multiple times, either with respect to the same variable (fxxf_{xx}) or different variables (fxyf_{xy}).

  • Clairaut's Theorem states that mixed partial derivatives (fxyf_{xy} and fyxf_{yx}) are equal if they are continuous.

  • The gradient vector, ∇f\nabla f, combines all first-order partial derivatives and points in the direction of the steepest ascent of the function.

← All lessons in Calculus: Derivatives

Ready to keep this from fading?

Bitelrn turns lessons like this into a full course — quizzes, a knowledge map, and spaced review.

Get started free