Partial Derivative Calculator

Compute partial derivatives, mixed partials, and gradients with AI-powered step-by-step solutions

Drag & drop or click to add images or PDF

Math Input
partial of x^2*y + sin(y) w.r.t. x
second partial of e^(xy) w.r.t. x then y
gradient of f(x,y,z) = x^2+y^2+z^2
partial of ln(x^2+y^2) with respect to x

What is a Partial Derivative?

A partial derivative measures how a multivariable function changes with respect to one variable while holding the others fixed. For f(x,y)f(x, y):

fx=limh0f(x+h,y)f(x,y)h\frac{\partial f}{\partial x} = \lim_{h \to 0} \frac{f(x+h, y) - f(x, y)}{h}

The notation \partial (curly d) distinguishes partial derivatives from ordinary derivatives ddx\frac{d}{dx}. Equivalent notations include fxf_x, xf\partial_x f, DxfD_x f.

Geometric meaning: fx(a,b)\frac{\partial f}{\partial x}(a, b) is the slope of the surface z=f(x,y)z = f(x,y) at (a,b)(a,b) in the xx-direction — the tangent line lies in the plane y=by = b.

Why this matters: gradient descent, optimization, error propagation, and most of vector calculus rest on partial derivatives. The gradient f=(fx,fy,fz)\nabla f = (f_x, f_y, f_z) points in the direction of steepest ascent.

How to Compute Partial Derivatives

Rule 1: Treat Other Variables as Constants

To find fx\frac{\partial f}{\partial x}, treat y,z,y, z, \ldots as constants and differentiate ff as a single-variable function of xx.

Example: f(x,y)=x2y+3yf(x, y) = x^2 y + 3y

  • fx=2xy\frac{\partial f}{\partial x} = 2xy (the 3y3y vanishes since it has no xx)
  • fy=x2+3\frac{\partial f}{\partial y} = x^2 + 3 (x2x^2 acts as a coefficient)

Rule 2: Chain Rule and Product Rule Still Apply

For f(x,y)=sin(xy)f(x, y) = \sin(xy):

fx=cos(xy)y\frac{\partial f}{\partial x} = \cos(xy) \cdot y

The yy inside the parenthesis is treated as a constant coefficient when differentiating xyxy with respect to xx.

Higher-Order Partials

fxx=2fx2,fxy=2fyxf_{xx} = \frac{\partial^2 f}{\partial x^2}, \quad f_{xy} = \frac{\partial^2 f}{\partial y \partial x}

Clairaut's theorem (mixed partials): if ff has continuous second partials, then fxy=fyxf_{xy} = f_{yx}. Order of differentiation doesn't matter.

Gradient and Directional Derivative

The gradient is the vector of all first partials:

f=(fx,fy,fz)\nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z}\right)

The directional derivative in direction u\mathbf{u} (unit vector) is:

Duf=fuD_\mathbf{u} f = \nabla f \cdot \mathbf{u}

Maximized when u\mathbf{u} points along f\nabla f — this is the steepest ascent direction.

Chain Rule (Multivariable)

If z=f(x,y)z = f(x, y) and x=x(t),y=y(t)x = x(t), y = y(t):

dzdt=fxdxdt+fydydt\frac{dz}{dt} = \frac{\partial f}{\partial x}\frac{dx}{dt} + \frac{\partial f}{\partial y}\frac{dy}{dt}

Common Mistakes to Avoid

  • Differentiating the wrong variable: Always identify which variable is 'live' and which are held constant. Underlining the live variable in your scratch work helps.
  • Forgetting the chain rule: xsin(xy)=ycos(xy)\frac{\partial}{\partial x}\sin(xy) = y\cos(xy), not just cos(xy)\cos(xy).
  • Confusing notation: fxyf_{xy} means differentiate first w.r.t. xx, then yy (some books reverse this — check the convention).
  • Wrong gradient direction: f\nabla f points in the direction of steepest ascent, not motion. To minimize, move opposite to f\nabla f.
  • Mixing partial and total derivatives: When xx and yy both depend on tt, use the chain rule — not f/t\partial f/\partial t, which is zero if ff has no explicit tt.

Examples

Step 1: For f/x\partial f/\partial x: treat yy as constant. f/x=2xy+0=2xy\partial f/\partial x = 2xy + 0 = 2xy
Step 2: For f/y\partial f/\partial y: treat xx as constant. f/y=x2+3y2\partial f/\partial y = x^2 + 3y^2
Answer: fx=2xyf_x = 2xy, fy=x2+3y2f_y = x^2 + 3y^2

Step 1: First partials: fx=yexyf_x = y e^{xy}, fy=xexyf_y = x e^{xy}
Step 2: fxx=/x(yexy)=yyexy=y2exyf_{xx} = \partial/\partial x (y e^{xy}) = y \cdot y \cdot e^{xy} = y^2 e^{xy}
Step 3: fyy=/y(xexy)=xxexy=x2exyf_{yy} = \partial/\partial y (x e^{xy}) = x \cdot x \cdot e^{xy} = x^2 e^{xy}
Step 4: fxy=/y(yexy)=exy+yxexy=(1+xy)exyf_{xy} = \partial/\partial y (y e^{xy}) = e^{xy} + y \cdot x \cdot e^{xy} = (1 + xy)e^{xy}
Step 5: Verify Clairaut: fyx=/x(xexy)=exy+xyexy=(1+xy)exyf_{yx} = \partial/\partial x (x e^{xy}) = e^{xy} + x \cdot y \cdot e^{xy} = (1 + xy)e^{xy}
Answer: fxx=y2exyf_{xx} = y^2 e^{xy}, fyy=x2exyf_{yy} = x^2 e^{xy}, fxy=fyx=(1+xy)exyf_{xy} = f_{yx} = (1+xy)e^{xy}

Step 1: f/x=2x\partial f/\partial x = 2x, f/y=2y\partial f/\partial y = 2y, f/z=2z\partial f/\partial z = 2z
Step 2: f=(2x,2y,2z)\nabla f = (2x, 2y, 2z)
Step 3: Evaluate at (1,2,2)(1, 2, 2): f(1,2,2)=(2,4,4)\nabla f(1,2,2) = (2, 4, 4)
Answer: f(1,2,2)=(2,4,4)\nabla f(1,2,2) = (2, 4, 4)

Frequently Asked Questions

An ordinary derivative df/dx applies to single-variable functions. A partial derivative ∂f/∂x applies to multivariable functions and measures the rate of change with respect to one variable while holding the others fixed.

If a function f(x,y) has continuous second-order partial derivatives, then the mixed partials are equal: f_xy = f_yx. The order of differentiation doesn't matter in that case.

The gradient is a vector pointing in the direction of the steepest ascent of f at a point. Its magnitude is the maximum rate of change at that point. It's also perpendicular to level curves and level surfaces of f.

Gradient descent uses the gradient (vector of partials) of the loss function with respect to model parameters. The algorithm updates parameters in the negative gradient direction to minimize loss.

Related Solvers

Derivative CalculatorIntegral CalculatorLimit Calculator
Try AI-Math for Free

Get step-by-step solutions to any math problem. Upload a photo or type your question.

Start Solving