DigitHelm

Partial Derivative Calculator

Compute partial derivatives of multivariable polynomial functions.

EXAMPLE FUNCTIONS

What Is the Partial Derivative Calculator?

This partial derivative calculator computes ∂f/∂x and ∂f/∂y of any two-variable function f(x,y) at a specified point using central difference numerical differentiation. It also returns the gradient vector, its magnitude, second-order partials, and Hessian discriminant for classifying critical points.

  • First-order partials: ∂f/∂x and ∂f/∂y via central differences with h = 10⁻⁵.
  • Gradient vector: ∇f = (∂f/∂x, ∂f/∂y), direction and magnitude of steepest ascent.
  • Second-order partials: ∂²f/∂x², ∂²f/∂y², and cross-partial ∂²f/∂x∂y (Hessian).
  • Critical point classification: D = fxx·fyy − (fxy)² for min/max/saddle detection.
  • 8 example functions: Quick-load common multivariable functions instantly.

Formula

∂f/∂x ≈ [f(x+h,y) − f(x−h,y)] / (2h)  ·  ∂f/∂y ≈ [f(x,y+h) − f(x,y−h)] / (2h)
∇f = (∂f/∂x)𝒊 + (∂f/∂y)𝒋  ·  |∇f| = √((∂f/∂x)² + (∂f/∂y)²)
QuantityFormulaMeaning
∂f/∂x[f(x+h,y) − f(x−h,y)] / 2hRate of change holding y constant
∂f/∂y[f(x,y+h) − f(x,y−h)] / 2hRate of change holding x constant
|∇f|√((∂f/∂x)² + (∂f/∂y)²)Steepest ascent magnitude
∂²f/∂x²[f(x+h,y) − 2f + f(x−h,y)] / h²Curvature in x direction
Dfxx·fyy − (fxy)²Hessian discriminant for critical points

How to Use

  1. 1Type a function f(x, y) using x and y. Use * for multiplication, ^ for power.
  2. 2Enter the point (x₀, y₀) where you want the derivatives evaluated.
  3. 3Press Enter or click Calculate.
  4. 4Read ∂f/∂x, ∂f/∂y, the gradient vector ∇f, and second-order results.
  5. 5If both first partials are near zero, the critical point type is shown.
  6. 6Click a preset or Clear to start fresh.

Example Calculation

f(x,y) = x² + y² at (1, 1)

Function: x^2 + y^2, Point: (1, 1) ∂f/∂x = 2 (= 2x at x=1) ∂f/∂y = 2 (= 2y at y=1) ∇f(1,1) = (2)𝒊 + (2)𝒋 |∇f| = √(4+4) = 2√2 ≈ 2.828 ∂²f/∂x² = 2, ∂²f/∂y² = 2, ∂²f/∂x∂y = 0 D = 2·2 − 0² = 4 > 0, fxx > 0 → local minimum at (0,0)

Why central differences?

Central difference (f(x+h) − f(x−h)) / 2h has O(h²) error vs O(h) for forward differences. With h = 10⁻⁵, this gives 8–10 correct significant figures for smooth functions.

Understanding Partial Derivative

What Is a Partial Derivative?

A partial derivative measures how f(x,y) changes as one variable changes, holding the other constant. ∂f/∂x is computed by differentiating with respect to x while treating y as a constant. Geometrically, it is the slope of the surface z = f(x,y) along a horizontal slice y = y₀.

The Gradient Vector

The gradient ∇f = (∂f/∂x, ∂f/∂y) points in the direction of steepest ascent. Its magnitude |∇f| gives the steepness. Moving opposite to the gradient (−∇f) descends most steeply, the principle behind gradient descent in machine learning optimisation.

  • ∇f = 0 at all critical points (minima, maxima, saddle points)
  • |∇f| large → steep surface; |∇f| = 0 → flat (critical point)
  • Contour lines are perpendicular to ∇f at every point
  • Directional derivative in direction u: D_u f = ∇f · u (dot product)

Second Derivative Test

ConditionClassification
D > 0 and fxx > 0Local minimum
D > 0 and fxx < 0Local maximum
D < 0Saddle point
D = 0Inconclusive

Frequently Asked Questions

What syntax does this calculator support?

Use x and y as variable names. Operators: +, -, *, /, ^ (power). Functions: sin, cos, tan, asin, acos, atan, exp, ln, log, sqrt, abs, sinh, cosh, tanh. Constants: pi, e.

Valid: x^2 + x*y + y^2 Valid: sin(x) * cos(y) Valid: exp(x + y) Valid: sqrt(x^2 + y^2)

How accurate are the numerical derivatives?

Central differences with h = 10⁻⁵ give O(h²) truncation error ≈ 10⁻¹⁰, providing 8–10 significant figures for smooth functions. Second-order partials are similarly accurate but accumulate more rounding due to division by h². Expect ~6 correct significant figures for second partials.

What does the gradient magnitude tell me?

|∇f| is the maximum rate of change of f at that point. If you imagine f as elevation:

  • ∇f points uphill in the steepest direction
  • −∇f is the steepest descent direction
  • Contour lines (level sets) are perpendicular to ∇f
  • |∇f| = 0 at peaks, valleys, and saddle points

How do I classify a critical point?

Enter the coordinates where ∂f/∂x = ∂f/∂y = 0. The calculator shows the second derivative test result when both first partials are near zero. D = fxx·fyy − (fxy)²: D > 0 and fxx > 0 → minimum; D > 0 and fxx < 0 → maximum; D < 0 → saddle point.

Why does my function return undefined?

Undefined results arise from singularities: x/y at y=0, ln(x) at x≤0, sqrt(x) at x<0, asin(x) for |x|>1. Choose an evaluation point away from the singularity. For ln(x²+y²), avoid (0,0).

What are second-order partial derivatives used for?

  • Critical point classification via the Hessian discriminant D
  • Laplace equation ∂²f/∂x² + ∂²f/∂y² = 0, steady-state heat, potential fields
  • Wave equation ∂²u/∂t² = c²∂²u/∂x²
  • Taylor expansion: f(x+h,y+k) ≈ f + fxh + fyk + ½(fxxh² + 2fxyhk + fyyk²)

What is the mixed partial ∂²f/∂x∂y?

Differentiate f with respect to y first, then x. Clairaut's theorem: for smooth f, ∂²f/∂x∂y = ∂²f/∂y∂x. Computed here using the four-point formula: (f(x+h,y+h) − f(x+h,y−h) − f(x−h,y+h) + f(x−h,y−h)) / (4h²).

Related Calculators