Partial Derivative Calculator
Compute ∂f/∂x, ∂f/∂y, second-order and mixed partial derivatives, gradient vectors, and directional derivatives for any multivariable function — with complete step-by-step working showing every rule applied.
⚠️ Use * for multiplication, ^ for powers. Use log(x) for natural log.
Partial Derivative Result
Select Second Derivative Type:
Second Order Partial Derivative
✓ Clairaut's Theorem Verified:
Gradient Vector
Directional Derivative D_û f
What Is a Partial Derivative — Definition and Notation
This partial derivative calculator computes ∂f/∂x, ∂f/∂y, second-order and mixed partial derivatives, the gradient vector ∇f, and directional derivatives for any multivariable function. Every calculation shows complete step-by-step working identifying exactly which differentiation rule applies at each stage — so you learn from every result rather than just reading the answer.
A partial derivative measures how a multivariable function changes when one variable changes while all others are held constant. For a function f(x,y) that represents a surface in 3D space, the partial derivative ∂f/∂x at point (x₀, y₀) is the slope of the surface in the x-direction at that point, and ∂f/∂y is the slope in the y-direction — they can be completely different values at the same point.
The notation ∂f/∂x (read "partial f partial x") uses the symbol ∂ (called "del" or "partial") to distinguish from ordinary derivatives. Alternative notations all mean the same thing: fₓ, f_x, Dₓf. The subscript fₓ means "partial derivative of f with respect to x." The formal limit definition shows what ∂f/∂x truly means — y is held completely fixed:
From the Definition — f(x,y) = x²y
- ∂f/∂x = lim(h→0) [(x+h)²y − x²y] / h
- = lim(h→0) [x²y + 2xhy + h²y − x²y] / h
- = lim(h→0) [2xhy + h²y] / h
- = lim(h→0) [2xy + hy] = 2xy ✓
- Shortcut: treat y as constant → d/dx(x²y) = y · d/dx(x²) = y · 2x = 2xy ✓
How to Find Partial Derivatives — Step-by-Step Rules
The Golden Rule: When finding ∂f/∂x, treat every variable except x as a constant. Apply all normal single-variable differentiation rules exactly as you would for d/dx, but carrying y (and z, t, etc.) along as constant multipliers or additive constants.
Power Rule: ∂/∂x(xⁿ) = nxⁿ⁻¹
y is treated as a constant coefficient. Example: f = x³y² → ∂f/∂x = 3x²y²
Constant Rule: ∂/∂x(yⁿ) = 0
Pure y terms are constants with respect to x. Example: f = y⁴ + 7 → ∂f/∂x = 0
Sum Rule: ∂/∂x(f + g) = ∂f/∂x + ∂g/∂x
Differentiate term by term. Example: f = x² + xy + y² → ∂f/∂x = 2x + y
Product Rule: ∂/∂x(f·g) = (∂f/∂x)·g + f·(∂g/∂x)
When both factors contain x. Example: f = x²·sin(y) → ∂f/∂x = 2x·sin(y) (sin(y) is constant w.r.t. x)
Chain Rule: ∂/∂x(f(g(x,y))) = f'(g) · ∂g/∂x
Differentiate the outer function, keep inner unchanged, multiply by derivative of inner. Example: f = sin(x²y) → ∂f/∂x = cos(x²y) · 2xy
Example 1 — Polynomial: f(x,y) = 3x²y + 2xy³ − 7y²
- ∂f/∂x = 6xy + 2y³ − 0 = 6xy + 2y³ (power rule term by term; 7y² is constant w.r.t. x)
- ∂f/∂y = 3x² + 6xy² − 14y (power rule w.r.t. y; x² is constant w.r.t. y)
Example 2 — Trig: f(x,y) = sin(x)cos(y)
- ∂f/∂x = cos(x)cos(y) — [cos(y) is constant w.r.t. x]
- ∂f/∂y = sin(x)(−sin(y)) = −sin(x)sin(y)
Example 3 — Exponential: f(x,y) = e^(x²y)
- Chain rule: ∂f/∂x = e^(x²y) · ∂(x²y)/∂x = e^(x²y) · 2xy = 2xye^(x²y)
- ∂f/∂y = e^(x²y) · x² = x²e^(x²y)
Example 4 — Logarithm: f(x,y) = ln(x² + y²)
- Chain rule: ∂f/∂x = 1/(x²+y²) · 2x = 2x/(x²+y²)
- ∂f/∂y = 2y/(x²+y²)
Example 5 — Three Variables: f(x,y,z) = x²yz + xz²
- ∂f/∂x = 2xyz + z²
- ∂f/∂y = x²z
- ∂f/∂z = x²y + 2xz
Second Order Partial Derivatives and the Hessian Matrix
Second order partial derivatives are obtained by differentiating a partial derivative one more time. For f(x,y) there are four second-order partial derivatives:
- fₓₓ = ∂²f/∂x² — differentiate twice with respect to x
- f_yy = ∂²f/∂y² — differentiate twice with respect to y
- fₓᵧ = ∂²f/∂x∂y — differentiate with respect to x first, then y
- f_yx = ∂²f/∂y∂x — differentiate with respect to y first, then x
Clairaut's Theorem (Symmetry of Mixed Partials): For any smooth function with continuous second partial derivatives: ∂²f/∂x∂y = ∂²f/∂y∂x. The order of differentiation does not matter for well-behaved functions. Our calculator verifies this automatically.
The Hessian Matrix collects all second partial derivatives and is used to classify critical points:
det(H) = fₓₓ · f_yy − (fₓᵧ)²
| Condition | Classification |
|---|---|
| det(H) > 0 AND fₓₓ > 0 | Local Minimum |
| det(H) > 0 AND fₓₓ < 0 | Local Maximum |
| det(H) < 0 | Saddle Point |
| det(H) = 0 | Inconclusive |
Worked Example: f(x,y) = x³ + y³ − 3xy
- ∂f/∂x = 3x² − 3y = 0 → y = x²
- ∂f/∂y = 3y² − 3x = 0 → x = y²
- Solving: x = (x²)² = x⁴ → x(x³−1) = 0 → x = 0 or x = 1
- Critical points: (0,0) and (1,1)
- fₓₓ = 6x, f_yy = 6y, fₓᵧ = −3
- At (0,0): det(H) = 0·0 − 9 = −9 < 0 → saddle point
- At (1,1): det(H) = 6·6 − 9 = 27 > 0, fₓₓ = 6 > 0 → local minimum
The Gradient Vector — ∇f and Its Geometric Meaning
The gradient is a vector that collects all first partial derivatives:
- The gradient ∇f points in the direction of steepest increase of the function
- The magnitude |∇f| gives the rate of steepest increase — how fast the function rises
- The gradient is perpendicular to the level curves of f at every point
- Moving in direction −∇f gives steepest descent — the basis of gradient descent in machine learning
Connection to physics: The negative gradient of potential energy gives force: F = −∇U. For gravity: Fgravity = −∂(mgh)/∂h = −mg (downward). This directly links partial differentiation to Newtonian mechanics.
Example: f(x,y) = x² + 2xy + y², at point (1,2)
- ∂f/∂x = 2x + 2y
- ∂f/∂y = 2x + 2y
- ∇f = ⟨2x+2y, 2x+2y⟩
- At (1,2): ∇f = ⟨6, 6⟩
- |∇f| = √(36+36) = 6√2 ≈ 8.485
- Direction of steepest ascent: θ = atan2(6,6) = 45°
Directional Derivative — Rate of Change in Any Direction
The directional derivative D_û f measures how f changes in any arbitrary direction û (a unit vector):
- Maximum directional derivative = |∇f| — achieved in direction of gradient
- Minimum directional derivative = −|∇f| — achieved opposite to gradient
- Zero directional derivative — achieved perpendicular to gradient (along level curves)
Applications of Partial Derivatives in Science and Engineering
Thermodynamics — Heat Equation
The heat equation ∂T/∂t = α∇²T relates how temperature T changes with time (partial derivative ∂T/∂t) and position (the Laplacian ∇²T involves second partial derivatives ∂²T/∂x², ∂²T/∂y², ∂²T/∂z²). Every heat transfer calculation — from designing a heat sink to modelling climate systems — uses partial derivatives.
Fluid Mechanics — Navier-Stokes Equations
The Navier-Stokes equations describing fluid flow are systems of partial differential equations involving ∂v/∂t, ∂v/∂x, ∂v/∂y, ∂v/∂z. Every computational fluid dynamics (CFD) simulation — from aircraft aerodynamics to blood flow modelling — solves these equations numerically using discrete partial derivatives.
Economics — Marginal Analysis
If profit P(q₁, q₂) depends on quantities of two products, ∂P/∂q₁ is the marginal profit from product 1 — how much extra profit from producing one more unit while holding product 2 constant. Partial derivatives are the mathematical foundation of microeconomic optimization and Lagrangian multiplier methods.
Machine Learning — Gradient Descent
Neural networks are trained by computing the gradient ∇L of the loss function L with respect to all weights: w ← w − α∇L. The entire field of deep learning — GPT, image recognition, speech synthesis — depends on efficiently computing millions of partial derivatives per second using backpropagation (chain rule applied millions of times).
Electromagnetism — Maxwell's Equations
Maxwell's equations governing light and electromagnetism use partial derivatives throughout: ∂E/∂t, ∂B/∂t, ∇×E, ∇·B. Solving these equations explains how radio waves travel, how light bends in lenses, and how wireless communications work.
Structural Engineering — Finite Element Analysis
Beam deflection under load is described by partial differential equations. The stress tensor σᵢⱼ involves partial derivatives of displacement fields. Every finite element analysis (FEA) simulation uses partial derivatives to compute stress, strain, and deformation — from bridge design to aircraft fuselages.
Common Mistakes When Calculating Partial Derivatives
Mistake 1 — Differentiating the Wrong Variable
For f = x²y³, when finding ∂f/∂x:
- ❌ Wrong: treating y³ as if it involves x → 2x · 3y² = 6xy²
- ✅ Correct: y³ is a constant multiplier → ∂f/∂x = 2xy³
Mistake 2 — Forgetting the Chain Rule
For f = sin(x²y), finding ∂f/∂x:
- ❌ Wrong: ∂f/∂x = cos(x²y) — missing the inner derivative
- ✅ Correct: ∂f/∂x = cos(x²y) · 2xy — must multiply by ∂(x²y)/∂x = 2xy
Mistake 3 — Forgetting y as a Coefficient
For f = xy, finding ∂f/∂x:
- ❌ Wrong: ∂f/∂x = 1 (treating xy like just x)
- ✅ Correct: ∂f/∂x = y (y is a constant coefficient when differentiating w.r.t. x)
Mistake 4 — Confusing ∂²f/∂x² with (∂f/∂x)²
- ∂²f/∂x² means differentiate twice — apply the derivative operator twice to f
- (∂f/∂x)² means square the first derivative — completely different result
- For f = x³: ∂²f/∂x² = 6x, but (∂f/∂x)² = (3x²)² = 9x⁴
Mistake 5 — Wrong Order for Mixed Partials (when Clairaut's Theorem Fails)
Clairaut's Theorem states fₓᵧ = f_yx for smooth functions. This holds for virtually all functions you encounter in practice. It can fail at points where the second partial derivatives are discontinuous — a theoretically important but rare exception requiring specially constructed pathological functions.
Worked Examples
1. f(x,y) = 4x³y² − 2xy + 5y³
- ∂f/∂x: Power rule on 4x³y² → 12x²y². Product rule on 2xy → 2y. 5y³ is constant → 0.
- ∂f/∂x = 12x²y² − 2y
- ∂f/∂y: 4x³ is constant → 8x³y. 2x is constant → 2x. Power rule on 5y³ → 15y².
- ∂f/∂y = 8x³y − 2x + 15y²
2. f(x,y) = e^(x²+y²)
- Chain rule: ∂f/∂x = e^(x²+y²) · ∂(x²+y²)/∂x = e^(x²+y²) · 2x = 2x·e^(x²+y²)
- ∂f/∂y = e^(x²+y²) · 2y = 2y·e^(x²+y²)
3. f(x,y) = x·sin(y) + y·cos(x)
- ∂f/∂x: d/dx(x·sin(y)) = sin(y) [sin(y) is constant]. d/dx(y·cos(x)) = y·(−sin(x)) = −y·sin(x).
- ∂f/∂x = sin(y) − y·sin(x)
- ∂f/∂y = x·cos(y) + cos(x)
4. f(x,y) = ln(xy)
- Rewrite: ln(xy) = ln(x) + ln(y)
- ∂f/∂x = 1/x + 0 = 1/x
- ∂f/∂y = 1/y
5. f(x,y,z) = x²y + yz³ + xz
- ∂f/∂x = 2xy + 0 + z = 2xy + z
- ∂f/∂y = x² + z³
- ∂f/∂z = 0 + 3yz² + x = 3yz² + x
6. f(x,y) = x²y³ — All Four Second Partial Derivatives
- ∂f/∂x = 2xy³, ∂f/∂y = 3x²y²
- ∂²f/∂x² = 2y³ (differentiate 2xy³ w.r.t. x)
- ∂²f/∂y² = 6x²y (differentiate 3x²y² w.r.t. y)
- ∂²f/∂x∂y = 6xy² (differentiate 2xy³ w.r.t. y)
- ∂²f/∂y∂x = 6xy² (differentiate 3x²y² w.r.t. x)
- ✓ Clairaut's Theorem verified: ∂²f/∂x∂y = ∂²f/∂y∂x = 6xy²
7. f(x,y) = x³ − 3x + 2y² — Critical Points via Hessian
- ∂f/∂x = 3x² − 3 = 0 → x² = 1 → x = ±1
- ∂f/∂y = 4y = 0 → y = 0
- Critical points: (1,0) and (−1,0)
- fₓₓ = 6x, f_yy = 4, fₓᵧ = 0, det(H) = 6x·4 − 0 = 24x
- At (1,0): det(H) = 24 > 0, fₓₓ = 6 > 0 → local minimum
- At (−1,0): det(H) = −24 < 0 → saddle point
8. f(x,y) = sin(x)·eʸ — Gradient at (π/2, 0)
- ∂f/∂x = cos(x)·eʸ, ∂f/∂y = sin(x)·eʸ
- ∇f = ⟨cos(x)·eʸ, sin(x)·eʸ⟩
- At (π/2, 0): ∇f = ⟨cos(π/2)·e⁰, sin(π/2)·e⁰⟩ = ⟨0, 1⟩
- |∇f| = 1. Direction: 90° (straight up)
9. f(x,y) = x/(x²+y²) — Quotient Rule for ∂f/∂x
- Quotient rule: ∂f/∂x = [1·(x²+y²) − x·(2x)] / (x²+y²)²
- = [x²+y² − 2x²] / (x²+y²)²
- = (y²−x²) / (x²+y²)²
10. f(x,y) = (x+y)^10 — Chain Rule for ∂f/∂x
- Let u = x + y. f = u^10.
- Chain rule: ∂f/∂x = 10u⁹ · ∂u/∂x = 10(x+y)⁹ · 1
- ∂f/∂x = 10(x+y)⁹
Frequently Asked Questions
Related Calculators
∂/∂x(xⁿ) = nxⁿ⁻¹y terms stay as constants
∂/∂x(c) = 0Pure y terms vanish
∂(f+g)/∂x = ∂f/∂x + ∂g/∂xDifferentiate term by term
∂(fg)/∂x = f'g + fg'When both factors have x
∂f(g)/∂x = f'(g)·∂g/∂xOuter × derivative of inner
| f(x,y) | ∂f/∂x |
|---|---|
| xⁿyᵐ | nxⁿ⁻¹yᵐ |
| sin(x) | cos(x) |
| cos(x) | −sin(x) |
| eˣ | eˣ |
| ln(x) | 1/x |
| tan(x) | sec²(x) |
| e^(xy) | y·e^(xy) |
| sin(xy) | y·cos(xy) |
Share This Tool
Share the Partial Derivative Calculator!