Partial Derivatives- Multivariable Calculus Explained
What Partial Derivatives Actually Are
Partial derivatives are what you get when a function has more than one variable and you want to see how it changes when you tweak just one of them. That's it. Nothing fancy.
Regular calculus handles functions like f(x) = x². One input, one output. Real life doesn't work that way. Temperature depends on pressure and altitude. Profit depends on price and quantity. When your function has multiple variables, regular derivatives don't cut it anymore.
You need partial derivatives.
The Core Idea
Say you have f(x, y) = x²y + 3y. This function responds to changes in both x and y. A partial derivative lets you isolate the effect of changing x while pretending y is frozen, and vice versa.
When you take a partial derivative with respect to x, you treat every y as if it were a constant number. Same deal when taking it with respect to y.
This sounds weird at first. But it's just a tool. You isolate variables to understand their individual effects.
Notation You'll See
Different textbooks use different notation. Here's what you're dealing with:
- fₓ — "f sub x" means the partial derivative of f with respect to x
- ∂f/∂x — the Leibniz notation, reads "partial f partial x"
- ∂z/∂x — if your function outputs z
- Dₓf — the differential operator notation
All four mean the same thing. Don't get spooked by the ∂ symbol — it's just a curved d. It tells you "this is a partial derivative, not a regular one."
How to Actually Compute Them
Partial with Respect to x
Take f(x, y) = x³ + 2xy² + y.
To find ∂f/∂x:
- Derivative of x³ with respect to x is 3x² — treat x as the variable
- Derivative of 2xy² with respect to x: y² is a constant, so it's 2y²
- Derivative of y with respect to x: y is treated as constant, so it's 0
Result: ∂f/∂x = 3x² + 2y²
Partial with Respect to y
Same function. Now freeze x.
- Derivative of x³ with respect to y: x³ is constant, so 0
- Derivative of 2xy² with respect to y: x is constant, so 4xy
- Derivative of y with respect to y: 1
Result: ∂f/∂y = 4xy + 1
Notice how each variable gets its own derivative. You handle one at a time.
What This Actually Means
Geometrically, a function of two variables traces out a surface in 3D space. A partial derivative gives you the slope of a tangent line in one direction only.
∂f/∂x at a point tells you: if you move in the x-direction only, how steep is the surface right there?
∂f/∂y at a point tells you: if you move in the y-direction only, how steep is the surface right there?
You're slicing the 3D surface with a plane (where y is fixed or x is fixed) and looking at the resulting 2D curve's slope.
Regular Derivative vs Partial Derivative
| Feature | Regular Derivative (dy/dx) | Partial Derivative (∂f/∂x) |
|---|---|---|
| Variables | One input variable | Two or more input variables |
| Rate of change | Along single dimension | In one direction, holding others fixed |
| Notation | d/dx | ∂/∂x |
| Result | A number or function | A function of all variables |
| Chain rule | Standard chain rule | Multiple chain rules possible |
Higher-Order Partial Derivatives
Once you have ∂f/∂x, you can take its partial derivative again. This gives you second-order partials.
From f(x, y) = x³ + 2xy² + y we got:
- ∂f/∂x = 3x² + 2y²
- ∂f/∂y = 4xy + 1
Now take second derivatives:
- ∂²f/∂x² = ∂/∂x(3x² + 2y²) = 6x
- ∂²f/∂y² = ∂/∂y(4xy + 1) = 4x
- ∂²f/∂x∂y = ∂/∂y(3x² + 2y²) = 4y (partial w.r.t y of the ∂f/∂x result)
- ∂²f/∂y∂x = ∂/∂x(4xy + 1) = 4y (same result here)
That last point matters. For "nice" functions, ∂²f/∂x∂y = ∂²f/∂y∂x. The order of taking partials doesn't matter. Mathematicians call this Clairaut's theorem (if the mixed partials are continuous).
Where Partial Derivatives Actually Show Up
Partial derivatives aren't just homework problems. They show up everywhere:
- Economics — marginal utility with respect to price vs quantity
- Physics — heat equation, wave equation, Maxwell's equations
- Machine learning — gradient descent uses partial derivatives for every weight and bias
- Engineering — stress and strain calculations across multiple dimensions
- Chemistry — reaction rates varying with temperature, pressure, and concentration
Any system where multiple factors influence an outcome needs partial derivatives to untangle the effects.
Getting Started: Your First Partial Derivative Problem
Problem: Find all first-order partial derivatives of f(x, y) = 4x²y³ + 2xy + 5
Step 1: Identify your variables. Here: x and y.
Step 2: Find ∂f/∂x. Treat y like a constant number.
- 4x²y³ → derivative is 8xy³ (y³ is constant)
- 2xy → derivative is 2y (x becomes 1)
- 5 → derivative is 0 (constant)
Result: ∂f/∂x = 8xy³ + 2y
Step 3: Find ∂f/∂y. Treat x like a constant number.
- 4x²y³ → derivative is 12x²y² (x² is constant)
- 2xy → derivative is 2x (y becomes 1)
- 5 → derivative is 0
Result: ∂f/∂y = 12x²y² + 2x
Step 4: Check your work. You should have two partial derivatives — one for each variable.
Mistakes People Actually Make
- Forgetting to treat other variables as constants — This is the most common error. Every variable you're not differentiating with respect to is frozen.
- Dropping variables entirely — The partial derivative still depends on all variables, not just the one you differentiated with respect to.
- Confusing the notation — ∂/∂x is not the same as d/dx. The curly d means partial.
- Forgetting the product rule — When you have x times y, you still need the product rule for that term when it's the variable of differentiation.
The Gradient: A Quick Note
When you have all first-order partial derivatives together, you get a vector called the gradient:
∇f = (∂f/∂x, ∂f/∂y)
The gradient points in the direction of steepest ascent. In machine learning, this is what drives gradient descent — you follow the negative gradient downhill to find minimums.
Understanding partial derivatives is the prerequisite for understanding gradients. Get comfortable with the basics first.