Learning Objectives
By the end of this section, you will be able to:
- Define partial derivatives as rates of change with respect to one variable while holding others constant
- Compute partial derivatives using standard differentiation rules
- Interpret partial derivatives geometrically as slopes of tangent lines on surfaces
- Calculate higher-order partial derivatives and understand Clairaut's theorem
- Apply partial derivatives in physics, engineering, and machine learning contexts
- Connect partial derivatives to gradients and optimization algorithms
The Big Picture: Rates of Change in Multiple Directions
"The partial derivative answers: How fast is this quantity changing if I only adjust one input while freezing all the others?"
In single-variable calculus, the derivative tells us how fast changes as changes. But what happens when a function depends on multiple variables?
Consider the temperature at position and time . You might ask:
- How does temperature change as I move east (increasing x)?
- How does temperature change as I move north (increasing y)?
- How does temperature change as time passes (increasing t)?
Each question isolates one variable while holding the others fixed. The answers are partial derivatives.
Where Partial Derivatives Appear
Physics
- Heat equation: temperature diffusion
- Wave equation: vibrating strings
- Maxwell's equations: electromagnetism
- Fluid dynamics: Navier-Stokes equations
Machine Learning
- Gradient descent: optimize loss functions
- Backpropagation: train neural networks
- Sensitivity analysis: feature importance
- Jacobians: coordinate transformations
Economics
- Marginal cost and revenue
- Utility maximization
- Production functions
- Price elasticity
Engineering
- Stress-strain analysis
- Control systems
- Signal processing
- Thermodynamics
Historical Context: The Birth of Multivariable Calculus
Partial derivatives emerged in the 18th century as mathematicians tackled problems involving multiple changing quantities. Leonhard Euler (1707–1783) was among the first to systematically use partial derivatives, particularly in his work on fluid dynamics and the calculus of variations.
Joseph-Louis Lagrange (1736–1813) extended these ideas to mechanics, using partial derivatives to reformulate Newton's laws in terms of energy. His Mécanique Analytique (1788) laid the groundwork for modern physics.
Alexis Clairaut (1713–1765) proved the famous theorem bearing his name: that mixed partial derivatives are equal (under continuity conditions). This result simplifies countless calculations in applied mathematics.
The Notation
The "∂" symbol (a rounded "d") was introduced by Adrien-Marie Legendre in 1786 to distinguish partial derivatives from ordinary derivatives. This notation, refined by Carl Jacobi, became standard by the mid-19th century.
Definition of Partial Derivatives
Definition: Partial Derivative
Let be a function of two variables. The partial derivative of f with respect to x at is:
Similarly, the partial derivative of f with respect to y at is:
Key insight: When computing , we treat as a constant. When computing , we treat as a constant.
This is exactly like taking an ordinary derivative, but with some variables "frozen" at fixed values.
Notation for Partial Derivatives
There are several common notations for partial derivatives. All of the following mean "the partial derivative of f with respect to x":
| Notation | Name | Common Usage |
|---|---|---|
| ∂f/∂x | Leibniz notation | General, emphasizes the variable |
| fₓ | Subscript notation | Quick, common in applied math |
| f₁ | Numeric subscript | When variables are numbered (x₁, x₂, ...) |
| ∂ₓf | Operator notation | Emphasizes partial differentiation as an operator |
| Dₓf | D notation | Alternative operator notation |
For evaluated partial derivatives:
- or — at the point (a, b)
- — subscript notation at a point
Choosing Notation
Use when you want to emphasize which variable is changing. Use for compactness in longer expressions. Be consistent within a single problem.
Geometric Interpretation
The partial derivative at a point has a beautiful geometric meaning. Imagine the surface :
- Fix y = b: This creates a vertical plane parallel to the xz-plane.
- Intersect with surface: The plane cuts the surface, creating a curve.
- The partial derivative: is the slope of this curve at the point.
Similarly, is the slope of the curve obtained by slicing the surface with a plane parallel to the yz-plane (fixing x).
Geometric Summary
- : Slope in the x-direction (walking east on the surface)
- : Slope in the y-direction (walking north on the surface)
- Together, these determine the tangent plane to the surface
Interactive 3D Visualizer
Explore partial derivatives on various surfaces. The red line shows the tangent in the x-direction (slope = ), and the green line shows the tangent in the y-direction (slope = ).
Rate of change when moving in the x-direction, keeping y constant. The slope of the red curve at the point.
Rate of change when moving in the y-direction, keeping x constant. The slope of the green curve at the point.
Partial derivatives give the slope along coordinate axes. Together, they define the tangent plane to the surface.
What to Explore
- Move the point around — watch how partial derivatives change
- Try the saddle surface — partials have opposite signs!
- Find points where both partials are zero — these are critical points
- Toggle the slices — see the 1D curves whose slopes give the partials
Computing Partial Derivatives
To compute a partial derivative, simply apply standard differentiation rules while treating other variables as constants.
The Key Rule
When computing , treat y (and all other variables) as constants.
Example 1: Polynomial
Find the partial derivatives of .
∂f/∂x: Treat y as constant.
∂f/∂y: Treat x as constant.
Example 2: Exponential
Find the partial derivatives of .
∂f/∂x: Use chain rule, with y as a constant coefficient.
∂f/∂y: Use chain rule, with x as a constant coefficient.
Example 3: Trigonometric
Find the partial derivatives of .
∂f/∂x: Chain rule with inner function .
∂f/∂y: Chain rule with inner function.
Step-by-Step Calculator
Work through several examples with guided step-by-step solutions. Click through each step to see how to compute partial derivatives for different types of functions.
Computing ∂f/∂x (derivative with respect to x)
Key Rule
When computing ∂f/∂x, treat all other variables as constants. Apply standard differentiation rules (power rule, chain rule, product rule, etc.) just as you would for a function of one variable.
Higher-Order Partial Derivatives
Just as we can take second derivatives in single-variable calculus, we can take second partial derivatives — and there are more options!
Second Partial Derivatives
For , there are four second partial derivatives:
| Notation | Meaning |
|---|---|
| ∂²f/∂x² or fₓₓ | Differentiate with respect to x twice |
| ∂²f/∂y² or f_yy | Differentiate with respect to y twice |
| ∂²f/∂x∂y or f_xy | Differentiate with respect to y, then x |
| ∂²f/∂y∂x or f_yx | Differentiate with respect to x, then y |
Example
Find all second partial derivatives of .
First partials:
Second partials:
Notice: !
Clairaut's Theorem: Equality of Mixed Partials
Clairaut's Theorem
If is a function defined on a disk containing , and if and are both continuous on , then:
In other words: The order of differentiation does not matter (provided the mixed partials are continuous).
Why This Matters
Clairaut's theorem dramatically simplifies computations. Instead of computing both and , we can compute whichever is easier and know they're equal. For a function of variables, this reduces the number of independent second partials from to .
Partial Derivatives, Contours, and the Gradient
The partial derivatives combine to form the gradient vector:
The gradient has two remarkable properties:
- Direction of steepest ascent: The gradient points in the direction where increases most rapidly.
- Perpendicular to contours: The gradient is always perpendicular to level curves (contour lines).
Explore this relationship in the interactive contour plot below:
Rate of change in x-direction. Points right when increasing, left when decreasing.
Rate of change in y-direction. Points up when increasing, down when decreasing.
The gradient vector combines both partials. It always points perpendicular to contour lines.
Applications in Physics
The Heat Equation
Temperature distribution in a rod satisfies:
This says the rate of temperature change at a point is proportional to the "curvature" of the temperature profile (how much hotter or colder it is than its neighbors).
The Wave Equation
Vibrations of a string satisfy:
This relates acceleration () to curvature ().
Electromagnetism
Maxwell's equations involve partial derivatives of electric and magnetic fields:
Applications in Machine Learning
Partial derivatives are the foundation of machine learning optimization. Every time a neural network trains, it computes thousands of partial derivatives.
Loss Functions and Gradients
A neural network has a loss function depending on all weights. To minimize the loss, we compute the gradient:
Gradient Descent
To minimize , we update weights in the opposite direction of the gradient:
where is the learning rate.
Backpropagation = Chain Rule for Partial Derivatives
The famous backpropagation algorithm is simply the chain rule applied to compute all partial derivatives efficiently:
Why "Back" Propagation?
We propagate derivatives backward through the network: starting from the loss, we compute how the loss changes with respect to each layer's output, then with respect to each weight.
Python Implementation
Computing Partial Derivatives Numerically
The Gradient and Gradient Descent
Higher-Order Partial Derivatives
Common Pitfalls
Pitfall 1: Forgetting to Hold Variables Constant
When computing , every is a constant, not a variable! Don't use product rule on terms like — just write .
Pitfall 2: Confusing Notation Order
In , we differentiate with respect to first, then . The variable closest to is applied first. (Mnemonic: read from right to left, or "inside-out".)
Pitfall 3: Assuming All Functions Have Equal Mixed Partials
Clairaut's theorem requires continuity of the mixed partials. Counterexamples exist for discontinuous functions! Always verify continuity if in doubt.
Pro Tip: Checking Your Work
After computing partial derivatives, verify by: (1) substituting simple values like ; (2) checking units/dimensions match; (3) confirming for smooth functions.
Test Your Understanding
Find ∂f/∂x for:
Summary
Partial derivatives extend the concept of rate of change to functions of multiple variables. They are computed by treating all other variables as constants.
Key Formulas
| Concept | Formula | Meaning |
|---|---|---|
| Definition | ∂f/∂x = lim[f(x+h,y) - f(x,y)]/h | Rate of change in x-direction |
| Gradient | ∇f = (∂f/∂x, ∂f/∂y) | Vector of all partial derivatives |
| Clairaut | ∂²f/∂x∂y = ∂²f/∂y∂x | Mixed partials are equal (if continuous) |
| Chain Rule | ∂f/∂t = (∂f/∂x)(dx/dt) + (∂f/∂y)(dy/dt) | Composition with parameter |
| Gradient Descent | x ← x - α∇f | Optimization update |
Key Takeaways
- Partial derivatives measure rate of change with respect to one variable while others stay fixed
- Geometrically, they give slopes of tangent lines in coordinate directions
- The gradient points toward steepest ascent and is perpendicular to contours
- Clairaut's theorem lets us interchange the order of differentiation for smooth functions
- In machine learning, partial derivatives power gradient descent and backpropagation
- PDEs (heat, wave, Maxwell's equations) are expressed using partial derivatives
Coming Next: In the next section, we'll explore Tangent Planes and Linear Approximations. Just as the derivative gives a linear approximation in 1D, partial derivatives define a tangent plane that best approximates a surface near a point.