Introduction to Partial Derivatives
Partial derivatives are a fundamental concept in multivariable calculus that extend the idea of ordinary derivatives to functions of several variables. While ordinary derivatives measure how a function changes with respect to one variable, partial derivatives measure how a multivariable function changes when only one variable is allowed to vary, while all other variables are held constant.
Why Partial Derivatives Matter:
- Essential for understanding surfaces and functions in higher dimensions
- Foundation for optimization in multiple variables
- Crucial for gradient descent algorithms in machine learning
- Used extensively in physics, engineering, and economics
- Key component of vector calculus and differential equations
In this comprehensive guide, we'll explore partial derivatives from basic definitions to advanced applications, with interactive examples and practical tools to help you master this essential mathematical concept.
Simple Example: Consider a function f(x,y) = x² + y² that represents a paraboloid. The partial derivative with respect to x tells us how the function changes as we move in the x-direction, while keeping y fixed. Similarly, the partial derivative with respect to y tells us about changes in the y-direction.
Formal Definition of Partial Derivatives
The partial derivative of a function f(x,y) with respect to x at a point (a,b) is defined as:
Similarly, the partial derivative with respect to y is:
This definition extends naturally to functions of three or more variables. For a function f(x₁, x₂, ..., xₙ), the partial derivative with respect to xᵢ is:
Partial derivatives treat all variables except one as constants. This reduces the problem to ordinary differentiation with respect to a single variable.
Example: For f(x,y) = 3x²y + sin(xy)
To find ∂f/∂x, treat y as constant:
∂f/∂x = d/dx[3x²y] + d/dx[sin(xy)] = 6xy + y·cos(xy)
To find ∂f/∂y, treat x as constant:
∂f/∂y = d/dy[3x²y] + d/dy[sin(xy)] = 3x² + x·cos(xy)
Confirm your learning by applying it in realistic scenarios using the partial derivative calculator.
Notation and Symbols
Several notations are used for partial derivatives, each with its own advantages in different contexts:
| Notation | Description | Example | Common Use |
|---|---|---|---|
| ∂f/∂x | Leibniz notation | ∂(x²y)/∂x = 2xy | General mathematics, physics |
| fₓ | Subscript notation | fₓ(x,y) for ∂f/∂x | Compact writing, multiple derivatives |
| D₁f | Operator notation | D₁f means derivative w.r.t first variable | Abstract mathematics, functional analysis |
| ∇f | Gradient notation | ∇f = ⟨fₓ, fᵧ⟩ | Vector calculus, optimization |
| ∂ₓf | Partial operator notation | ∂ₓ(x²y) = 2xy | Physics, differential equations |
The symbol ∂ (called "partial" or "del") is used specifically for partial derivatives, while d is used for ordinary derivatives. This distinction is crucial for clarity in multivariable calculus.
Notation Practice
How to Calculate Partial Derivatives
Calculating partial derivatives follows the same rules as ordinary differentiation, with the key difference being that you treat all other variables as constants.
Basic Rules
Power Rule: ∂/∂x(xⁿ) = n·xⁿ⁻¹
Constant Multiple: ∂/∂x(c·f) = c·∂f/∂x
Sum Rule: ∂/∂x(f+g) = ∂f/∂x + ∂g/∂x
Product Rule: ∂/∂x(f·g) = (∂f/∂x)·g + f·(∂g/∂x)
Quotient Rule: ∂/∂x(f/g) = [(∂f/∂x)·g - f·(∂g/∂x)]/g²
Step-by-Step Process
- Identify which variable you're differentiating with respect to
- Treat all other variables as constants
- Apply ordinary differentiation rules
- Simplify the result
- Repeat for other variables if needed
Common Functions
Exponential: ∂/∂x(eˣʸ) = y·eˣʸ
Logarithm: ∂/∂x(ln(xy)) = 1/x
Trigonometric: ∂/∂x(sin(xy)) = y·cos(xy)
Polynomial: ∂/∂x(x³y²) = 3x²y²
Problem: Find ∂f/∂x and ∂f/∂y for f(x,y) = x³y² + eˣʸ + ln(x/y)
Solution:
∂f/∂x = 3x²y² + y·eˣʸ + 1/x
∂f/∂y = 2x³y + x·eˣʸ - 1/y
Explanation: For ∂f/∂x, treat y as constant. For ∂f/∂y, treat x as constant. Remember that ln(x/y) = ln(x) - ln(y).
Strengthen your understanding by practicing real examples with the partial derivative calculator.
Geometric Interpretation
Partial derivatives have a beautiful geometric interpretation that helps visualize their meaning:
Geometric Visualization
Partial Derivative Visualization
Imagine a 3D surface z = f(x,y)
• ∂f/∂x is the slope in the x-direction
• ∂f/∂y is the slope in the y-direction
• Together they define the tangent plane
Geometric Meaning:
- ∂f/∂x(a,b): Slope of the tangent line to the curve formed by intersecting the surface z = f(x,y) with the plane y = b
- ∂f/∂y(a,b): Slope of the tangent line to the curve formed by intersecting the surface z = f(x,y) with the plane x = a
- Tangent Plane: The plane that best approximates the surface near (a,b), given by: z = f(a,b) + fₓ(a,b)(x-a) + fᵧ(a,b)(y-b)
Example: For f(x,y) = x² + y² at point (1,1):
∂f/∂x = 2x, so at (1,1): fₓ = 2
∂f/∂y = 2y, so at (1,1): fᵧ = 2
Tangent plane equation: z = 2 + 2(x-1) + 2(y-1) = 2x + 2y - 2
This plane touches the paraboloid at (1,1,2) and approximates it nearby.
The Gradient Vector
The gradient is a vector that collects all the first-order partial derivatives of a function. For a function f(x,y), the gradient is:
For a function of n variables, f(x₁, x₂, ..., xₙ), the gradient is:
Direction of Steepest Ascent
The gradient vector points in the direction of the greatest rate of increase of the function. Its magnitude gives the rate of increase in that direction.
Example: For f(x,y) = x² + y², ∇f = ⟨2x, 2y⟩. At (1,1), ∇f = ⟨2,2⟩ points away from the origin, which is the direction of steepest ascent.
Directional Derivatives
The directional derivative Dᵤf in direction of unit vector u is:
Dᵤf = ∇f · u
This measures the rate of change of f in direction u.
Maximum: When u points in the direction of ∇f
Minimum: When u points opposite to ∇f
Optimization
At local maxima or minima (critical points), the gradient is zero:
∇f = 0 ⇒ ∂f/∂x = 0 and ∂f/∂y = 0
This gives a system of equations to solve for critical points.
Used in gradient descent algorithms for optimization.
Gradient Calculator
Challenge your problem-solving skills with applied exercises using the partial derivative calculator.
Real-World Applications
Partial derivatives are used extensively across science, engineering, economics, and technology:
Machine Learning
Gradient Descent: Optimizes neural network parameters by following the negative gradient of the loss function.
Backpropagation: Uses chain rule of partial derivatives to compute gradients through network layers.
Loss Function: L(θ) = Σ(yᵢ - f(xᵢ;θ))², where θ are parameters to optimize.
∂L/∂θ tells how to adjust parameters to reduce error.
Physics & Engineering
Heat Equation: ∂u/∂t = α∇²u describes heat diffusion
Maxwell's Equations: ∇·E = ρ/ε₀, ∇×E = -∂B/∂t
Fluid Dynamics: Navier-Stokes equations use partial derivatives
Stress Analysis: Partial derivatives of displacement fields
Economics
Marginal Analysis: ∂Profit/∂Labor = marginal product of labor
Utility Functions: ∂U/∂xᵢ = marginal utility of good i
Production Functions: Q = f(K,L), ∂Q/∂K = marginal product of capital
Optimization: Maximizing profit or minimizing cost subject to constraints
Chemistry
Thermodynamics: ∂U/∂T at constant V = heat capacity at constant volume
Reaction Rates: ∂[A]/∂t = rate of change of concentration
Diffusion: Fick's laws use partial derivatives
Quantum Chemistry: Schrödinger equation solutions
def gradient_descent(X, y, theta, alpha, iterations):
for i in range(iterations):
# Compute partial derivatives of cost function
predictions = X.dot(theta)
errors = predictions - y
gradient = X.T.dot(errors) / len(y) # ∂J/∂θ
theta = theta - alpha * gradient # Update parameters
return theta
Chain Rule for Partial Derivatives
The chain rule extends to partial derivatives, allowing us to differentiate composite functions of several variables. For z = f(x,y) where x = g(t) and y = h(t):
For z = f(x,y) where x = g(s,t) and y = h(s,t):
∂z/∂t = (∂f/∂x)(∂x/∂t) + (∂f/∂y)(∂y/∂t)
Example 1: z = x²y, x = sin(t), y = cos(t)
dz/dt = (2xy)(cos(t)) + (x²)(-sin(t)) = 2sin(t)cos²(t) - sin³(t)
Example 2: z = eˣʸ, x = st, y = s+t
∂z/∂s = (yeˣʸ)(t) + (xeˣʸ)(1) = eˣʸ(ty + x)
∂z/∂t = (yeˣʸ)(s) + (xeˣʸ)(1) = eˣʸ(sy + x)
A helpful way to remember the chain rule is using a tree diagram:
z depends on x and y
x depends on s and t
y depends on s and t
To find ∂z/∂s: Sum over all paths from z to s:
(z→x→s) + (z→y→s) = (∂z/∂x)(∂x/∂s) + (∂z/∂y)(∂y/∂s)
Chain Rule Calculator
If you want practical experience, try real-world cases with the partial derivative calculator.
Higher-Order Partial Derivatives
Just as with ordinary derivatives, we can take partial derivatives of partial derivatives. For a function f(x,y), we have:
| Notation | Meaning | Example for f(x,y)=x³y² |
|---|---|---|
| fₓₓ or ∂²f/∂x² | Second partial w.r.t x | 6xy² |
| fᵧᵧ or ∂²f/∂y² | Second partial w.r.t y | 2x³ |
| fₓᵧ or ∂²f/∂y∂x | First x, then y | 6x²y |
| fᵧₓ or ∂²f/∂x∂y | First y, then x | 6x²y |
Clairaut's Theorem (Equality of Mixed Partials):
If fₓᵧ and fᵧₓ are continuous on an open set, then they are equal: fₓᵧ = fᵧₓ
This means the order of differentiation doesn't matter for most well-behaved functions.
The Laplacian ∇²f is an important second-order differential operator:
∇²f = ∂²f/∂x² + ∂²f/∂y² + ∂²f/∂z² (in 3D)
Used in Laplace's equation (∇²f = 0), Poisson's equation, heat equation, wave equation, and Schrödinger equation.
Example: For f(x,y) = sin(x)cos(y)
fₓ = cos(x)cos(y), fᵧ = -sin(x)sin(y)
fₓₓ = -sin(x)cos(y), fᵧᵧ = -sin(x)cos(y)
fₓᵧ = -cos(x)sin(y), fᵧₓ = -cos(x)sin(y)
Note that fₓᵧ = fᵧₓ as expected from Clairaut's theorem.
Laplacian: ∇²f = fₓₓ + fᵧᵧ = -2sin(x)cos(y)
Track your progress by practicing with the partial derivative calculator.
Practice Problems
Solution:
∂f/∂x = 6xy³ - 2y + y·eˣʸ
∂f/∂y = 9x²y² - 2x + x·eˣʸ
Explanation: Treat y as constant when differentiating with respect to x, and x as constant when differentiating with respect to y.
Solution:
∂f/∂x = 2x/(x² + y²)
∂f/∂y = 2y/(x² + y²)
At (1,2): ∂f/∂x = 2/5, ∂f/∂y = 4/5
∇f(1,2) = ⟨2/5, 4/5⟩ = ⟨0.4, 0.8⟩
Solution:
∂z/∂x = 2x, ∂z/∂y = 2y
dx/dt = -sin(t), dy/dt = cos(t)
dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt)
= (2cos(t))(-sin(t)) + (2sin(t))(cos(t))
= -2sin(t)cos(t) + 2sin(t)cos(t) = 0
This makes sense because z = cos²(t) + sin²(t) = 1, a constant!
Solution:
fₓ = 3x²eʸ, fᵧ = x³eʸ
fₓₓ = 6xeʸ, fᵧᵧ = x³eʸ
fₓᵧ = 3x²eʸ, fᵧₓ = 3x²eʸ
Note that fₓᵧ = fᵧₓ as expected.
Partial Derivative Practice Tool
Test your understanding with random problems and check your answers.