Partial Derivative Calculator
Calculate partial derivatives of multivariable functions with step-by-step examples and visualizations
Results:
Comprehensive Guide to Partial Derivative Calculation Examples
Partial derivatives are fundamental concepts in multivariable calculus that measure how a function changes as one of its input variables changes, while keeping all other variables constant. This guide provides a thorough exploration of partial derivatives with practical examples, applications, and calculation techniques.
1. Understanding Partial Derivatives
For a function of multiple variables f(x₁, x₂, …, xₙ), the partial derivative with respect to the i-th variable is defined as:
∂f/∂xᵢ = lim(h→0) [f(x₁, …, xᵢ+h, …, xₙ) – f(x₁, …, xᵢ, …, xₙ)] / h
Key properties of partial derivatives:
- Treat all variables except the one you’re differentiating with respect to as constants
- Follow the same rules as ordinary derivatives for the variable of interest
- Partial derivatives are not generally commutative (∂²f/∂x∂y ≠ ∂²f/∂y∂x unless the function is smooth)
2. Basic Calculation Examples
Example 1: Find ∂f/∂x and ∂f/∂y for f(x,y) = x²y + sin(y)
- For ∂f/∂x: Treat y as constant → 2xy + 0 = 2xy
- For ∂f/∂y: Treat x as constant → x² + cos(y)
Example 2: Find ∂f/∂z for f(x,y,z) = xz² + y²eᶻ + ln(xy)
- Treat x and y as constants
- Differentiate each term with respect to z:
- xz² → 2xz
- y²eᶻ → y²eᶻ
- ln(xy) → 0 (no z dependence)
- Final result: ∂f/∂z = 2xz + y²eᶻ
3. Higher-Order Partial Derivatives
Second-order partial derivatives involve differentiating a first partial derivative again:
| Notation | Meaning | Example for f(x,y) |
|---|---|---|
| ∂²f/∂x² | Second partial with respect to x | Differentiate ∂f/∂x with respect to x |
| ∂²f/∂y² | Second partial with respect to y | Differentiate ∂f/∂y with respect to y |
| ∂²f/∂x∂y | Mixed partial (first x, then y) | Differentiate ∂f/∂x with respect to y |
| ∂²f/∂y∂x | Mixed partial (first y, then x) | Differentiate ∂f/∂y with respect to x |
Example: For f(x,y) = x²y + sin(xy)
- ∂f/∂x = 2xy + ycos(xy)
- ∂f/∂y = x² + xcos(xy)
- ∂²f/∂x² = 2y – y²sin(xy)
- ∂²f/∂y² = -x³sin(xy)
- ∂²f/∂x∂y = 2x + cos(xy) – xy·sin(xy)
- ∂²f/∂y∂x = 2x + cos(xy) – xy·sin(xy) (equals ∂²f/∂x∂y by Clairaut’s theorem)
4. Applications in Real World
Economic applications (from Federal Reserve research):
| Economic Concept | Partial Derivative Application | Typical Variables |
|---|---|---|
| Marginal Cost | ∂C/∂q (change in cost with output) | C(cost), q(output) |
| Marginal Revenue | ∂R/∂q (change in revenue with output) | R(revenue), q(output) |
| Price Elasticity | (∂Q/∂P)·(P/Q) (sensitivity to price) | Q(quantity), P(price) |
| Production Function | ∂Q/∂L and ∂Q/∂K (labor/capital productivity) | Q(output), L(labor), K(capital) |
5. Numerical Methods for Partial Derivatives
When analytical solutions are difficult, numerical approximation methods are used:
Forward Difference: ∂f/∂x ≈ [f(x+h,y) – f(x,y)]/h
Central Difference: ∂f/∂x ≈ [f(x+h,y) – f(x-h,y)]/(2h)
Error Analysis: Forward difference has O(h) error, central difference has O(h²) error
6. Common Mistakes and How to Avoid Them
- Forgetting to treat other variables as constants
- Wrong: Differentiating x²y as 2x (forgot y)
- Correct: 2xy (y is treated as constant)
- Misapplying the chain rule
- For composite functions like sin(xy), must use:
∂/∂x [sin(xy)] = cos(xy) · y
- For composite functions like sin(xy), must use:
- Assuming mixed partials are always equal
- Only true if ∂²f/∂x∂y and ∂²f/∂y∂x are continuous
- Counterexample: f(x,y) = xy(x²-y²)/(x²+y²) at (0,0)
- Incorrect notation
- df/dx means total derivative (all variables depend on x)
- ∂f/∂x means partial derivative (only x varies)
7. Advanced Topics
Jacobian Matrix: For vector-valued functions F:ℝⁿ→ℝᵐ, the Jacobian is the m×n matrix of all first-order partial derivatives:
J = [∂F₁/∂x₁ ∂F₁/∂x₂ … ∂F₁/∂xₙ]
[∂F₂/∂x₁ ∂F₂/∂x₂ … ∂F₂/∂xₙ]
[… … … …]
[∂Fₘ/∂x₁ ∂Fₘ/∂x₂ … ∂Fₘ/∂xₙ]
Laplace Operator: The divergence of the gradient, used in physics:
∇²f = ∂²f/∂x² + ∂²f/∂y² + ∂²f/∂z²
Applications in Machine Learning:
- Gradient descent optimization (∇f for loss functions)
- Backpropagation in neural networks (chain rule for partials)
- Feature importance analysis (∂output/∂feature)
8. Practice Problems with Solutions
Problem 1: Find ∂f/∂x and ∂f/∂y for f(x,y) = e^(x²y) + ln(x+y)
Solution:
- ∂f/∂x = e^(x²y)·(2xy) + 1/(x+y)
- ∂f/∂y = e^(x²y)·(x²) + 1/(x+y)
Problem 2: Find ∂²z/∂x∂y for z = x³y² + sin(xy)
Solution:
- First find ∂z/∂x = 3x²y² + ycos(xy)
- Then differentiate with respect to y: 6x²y + cos(xy) – xy·sin(xy)
Problem 3: For f(x,y,z) = xz + yz + xyz, find ∂f/∂x, ∂f/∂y, ∂f/∂z at point (1,2,3)
Solution:
- ∂f/∂x = z + yz → at (1,2,3): 3 + 6 = 9
- ∂f/∂y = z + xz → at (1,2,3): 3 + 3 = 6
- ∂f/∂z = x + y + xy → at (1,2,3): 1 + 2 + 2 = 5
9. Visualizing Partial Derivatives
Partial derivatives can be visualized as:
- Slope in a particular direction: The partial derivative ∂f/∂x at a point gives the slope of the tangent line in the x-direction
- Contour maps: The gradient vector (∂f/∂x, ∂f/∂y) points in the direction of steepest ascent
- 3D surfaces: The partial derivatives determine the orientation of the tangent plane at each point
The interactive calculator above generates visualizations of these concepts. For example, when you calculate ∂f/∂x for a function, the chart shows:
- The original function surface
- The tangent lines in the x-direction at various points
- The slope values (partial derivatives) along these lines
10. Historical Context and Key Theorists
The development of partial derivatives was crucial to the advancement of calculus for multiple variables:
- Leonhard Euler (1707-1783): First introduced the notation and concepts for functions of several variables
- Joseph-Louis Lagrange (1736-1813): Developed applications in mechanics and optimization
- Carl Gustav Jacobi (1804-1851): Pioneered the study of determinants that now bear his name (Jacobians)
- Augustin-Louis Cauchy (1789-1857): Formalized the theory of functions of several variables
The American Mathematical Society maintains historical archives showing how partial derivatives became essential in:
- 19th century physics (electromagnetism, thermodynamics)
- 20th century economics (general equilibrium theory)
- 21st century data science (machine learning algorithms)
11. Computational Tools and Software
Modern mathematical software can compute partial derivatives symbolically and numerically:
| Tool | Partial Derivative Features | Example Command |
|---|---|---|
| Wolfram Mathematica | Symbolic and numeric differentiation, visualization | D[x^2*y + Sin[y], x] |
| MATLAB | Symbolic Math Toolbox, gradient functions | diff(‘x^2*y + sin(y)’, ‘x’) |
| Python (SymPy) | Symbolic mathematics library | diff(x**2*y + sin(y), x) |
| R | Numerical differentiation packages | grad(function(x) x[1]^2*x[2], c(1,2)) |
12. Further Learning Resources
For advanced topics:
- “Advanced Calculus” by Taylor and Mann – Rigorous treatment of functions of several variables
- “Mathematical Methods for Physics and Engineering” by Riley, Hobson, and Bence – Applications in physical sciences
- “Calculus on Manifolds” by Spivak – Theoretical foundations of multivariable calculus