Skip to content

Partial Derivative Calculator — Step-by-Step Solutions

The Partial Derivative Calculator computes partial derivatives of functions with multiple variables. It differentiates with respect to your chosen variable while treating all other variables as constants.

Enter a multivariable function (e.g. x^2*y + sin(y)) and specify which variable to differentiate with respect to. The calculator uses symbolic differentiation to give exact results.

Your calculations will appear here

How to Use the Partial Derivative Calculator

  1. Enter a function of two or more variables in the input field. Use standard mathematical notation such as x^2*y + sin(y), exp(x*y), or x*y*z. The calculator accepts polynomials, trigonometric, exponential, and logarithmic functions.
  2. Select the variable you want to differentiate with respect to. You can choose x, y, or z from the dropdown menu.
  3. Choose a calculation mode. "Partial Derivative" computes the first-order partial derivative. "Higher Order" computes second, third, or fourth-order partial derivatives. "Gradient" computes the full gradient vector. "Evaluate at Point" computes the partial derivative and evaluates it at a specific point.
  4. For higher-order mode, select the derivative order (2nd, 3rd, or 4th) from the order dropdown.
  5. For evaluate mode, enter the numeric values for x and y where you want to evaluate the partial derivative.
  6. Results appear instantly as you type, including step-by-step working that shows how each differentiation rule was applied. Use the share button to save or share your calculation via URL.

Formula and Theory

A partial derivative measures how a multivariable function changes when one variable changes while all other variables are held constant. If f(x, y) is a function of two variables, the partial derivative with respect to x, written as a curly-d f / curly-d x, tells you the instantaneous rate of change of f in the x-direction at any given point. The formal definition mirrors the ordinary derivative but fixes all variables except the one being differentiated: curly-d f / curly-d x = lim as h approaches 0 of [f(x+h, y) - f(x, y)] / h.

Several notations are used for partial derivatives, and understanding them is essential when reading textbooks and research papers. The most common is Leibniz notation: curly-d f / curly-d x. Subscript notation writes the same thing as f_x or f_y. The operator notation D_x f is also used, particularly in differential equations. For higher-order derivatives, curly-d squared f / curly-d x squared denotes the second partial with respect to x, while curly-d squared f / (curly-d x curly-d y) denotes a mixed partial derivative.

Geometrically, a partial derivative has a clear visual interpretation. For a function f(x, y) that defines a surface in three-dimensional space, the partial derivative curly-d f / curly-d x at a point (a, b) gives the slope of the tangent line to the curve formed by slicing the surface with the plane y = b. In other words, you freeze y at the value b and look at how the surface rises or falls as x changes. Similarly, curly-d f / curly-d y gives the slope of the tangent line when you slice with the plane x = a. These tangent lines together define the tangent plane to the surface at that point.

The gradient vector, denoted nabla f or grad f, collects all partial derivatives into a single vector: nabla f = (curly-d f / curly-d x, curly-d f / curly-d y) in two dimensions, or (curly-d f / curly-d x, curly-d f / curly-d y, curly-d f / curly-d z) in three dimensions. The gradient always points in the direction of steepest ascent of the function and its magnitude equals the maximum rate of change. This makes it central to optimisation. A directional derivative in any unit vector direction u can be computed as the dot product of the gradient with u: D_u f = nabla f dot u. Level curves (contours) of f are always perpendicular to the gradient.

Higher-order partial derivatives are obtained by differentiating a partial derivative again. The second-order partial curly-d squared f / curly-d x squared measures the concavity of f in the x-direction. Mixed partial derivatives, such as curly-d squared f / (curly-d x curly-d y), measure how the rate of change in one direction varies as the other variable changes. Clairaut's theorem (also called Schwarz's theorem) states that if the mixed partial derivatives are continuous, then the order of differentiation does not matter: curly-d squared f / (curly-d x curly-d y) = curly-d squared f / (curly-d y curly-d x). The Hessian matrix collects all second-order partial derivatives and is used to classify critical points as local maxima, local minima, or saddle points.

Partial derivatives have wide-ranging applications across science, engineering, economics, and computing. In physics, thermodynamic quantities such as entropy, pressure, and temperature are related through partial derivatives (Maxwell relations). In electromagnetism, Maxwell's equations involve partial derivatives of electric and magnetic fields. In economics, marginal cost is the partial derivative of total cost with respect to quantity, while marginal utility is the partial derivative of a utility function with respect to the quantity of a good consumed. In machine learning and artificial intelligence, gradient descent is the primary optimisation algorithm: it computes the gradient (vector of partial derivatives) of a loss function with respect to model parameters and updates those parameters in the direction of steepest descent. Backpropagation in neural networks is fundamentally a chain of partial derivative calculations using the multivariable chain rule.

Worked Examples

Example 1: Simple polynomial: partial with respect to x

Problem: Find curly-d f / curly-d x of f(x, y) = x^2*y + 3x*y^2

Solution: Treat y as a constant. Differentiate each term with respect to x: d/dx(x^2*y) = 2x*y (power rule, y is constant), d/dx(3x*y^2) = 3y^2 (y^2 is constant).

Answer: curly-d f / curly-d x = 2xy + 3y^2

Example 2: Simple polynomial: partial with respect to y

Problem: Find curly-d f / curly-d y of f(x, y) = x^2*y + 3x*y^2

Solution: Treat x as a constant. Differentiate each term with respect to y: d/dy(x^2*y) = x^2 (x^2 is constant), d/dy(3x*y^2) = 6xy (power rule, 3x is constant).

Answer: curly-d f / curly-d y = x^2 + 6xy

Example 3: Trigonometric function

Problem: Find curly-d f / curly-d x of f(x, y) = sin(x*y)

Solution: Apply the chain rule. The outer function is sin(u) with u = x*y. The derivative of sin(u) is cos(u). The derivative of u = x*y with respect to x is y (treating y as constant). So curly-d f / curly-d x = cos(x*y) * y.

Answer: curly-d f / curly-d x = y*cos(xy)

Example 4: Exponential function

Problem: Find curly-d f / curly-d x of f(x, y) = e^(x^2 + y^2)

Solution: Apply the chain rule. Let u = x^2 + y^2. Then d/dx[e^u] = e^u * du/dx. Since du/dx = 2x (y^2 is constant), we get curly-d f / curly-d x = 2x * e^(x^2 + y^2).

Answer: curly-d f / curly-d x = 2x * e^(x^2 + y^2)

Example 5: Three variables

Problem: Find curly-d f / curly-d y of f(x, y, z) = x*y*z + x^2*z

Solution: Treat x and z as constants. d/dy(x*y*z) = x*z (x*z is constant factor). d/dy(x^2*z) = 0 (no y present). So curly-d f / curly-d y = xz.

Answer: curly-d f / curly-d y = xz

Example 6: Second-order mixed partial derivative

Problem: Find curly-d^2 f / (curly-d x curly-d y) of f(x, y) = x^3*y^2 + 2x*y

Solution: First compute curly-d f / curly-d y = 2x^3*y + 2x (treat x as constant). Then differentiate this result with respect to x: d/dx(2x^3*y) = 6x^2*y, d/dx(2x) = 2. So the mixed partial is 6x^2*y + 2. Note: by Clairaut's theorem, differentiating in the opposite order gives the same result.

Answer: curly-d^2 f / (curly-d x curly-d y) = 6x^2*y + 2

Example 7: Real-world: temperature gradient

Problem: The temperature at point (x, y) on a metal plate is T(x, y) = 100 - x^2 - 2*y^2. Find the rate of temperature change in the x-direction at the point (1, 2).

Solution: Compute curly-d T / curly-d x = -2x. Evaluate at (1, 2): curly-d T / curly-d x at (1, 2) = -2(1) = -2. This means the temperature decreases at a rate of 2 degrees per unit distance in the x-direction.

Answer: curly-d T / curly-d x at (1, 2) = -2

Example 8: Real-world: economic marginal analysis

Problem: A firm's profit function is P(q1, q2) = 50*q1 + 80*q2 - q1^2 - 2*q2^2 - q1*q2, where q1 and q2 are quantities of two products. Find the marginal profit with respect to q1.

Solution: The marginal profit with respect to q1 is the partial derivative curly-d P / curly-d q1. Treat q2 as constant: d/dq1(50*q1) = 50, d/dq1(-q1^2) = -2*q1, d/dq1(-q1*q2) = -q2, and the other terms have zero derivative. So curly-d P / curly-d q1 = 50 - 2*q1 - q2.

Answer: curly-d P / curly-d q1 = 50 - 2q1 - q2

Frequently Asked Questions

What is the difference between a partial derivative and an ordinary derivative?
An ordinary derivative applies to functions of a single variable and measures the total rate of change. A partial derivative applies to functions of two or more variables and measures the rate of change with respect to one variable while holding all other variables constant. The notation uses a curly d (the partial symbol) instead of a straight d to signal this distinction.
When do you use partial derivatives in real life?
Partial derivatives appear whenever a quantity depends on multiple inputs. In physics, they describe how temperature, pressure, or electromagnetic fields change in space and time. In economics, marginal cost and marginal revenue are partial derivatives. In engineering, stress and strain in materials are expressed through partial derivatives. In machine learning, every training step of a neural network computes partial derivatives of a loss function via backpropagation.
What is the gradient and how does it relate to partial derivatives?
The gradient of a function f is the vector whose components are all the partial derivatives of f. For a function of two variables, the gradient is (curly-d f / curly-d x, curly-d f / curly-d y). The gradient points in the direction of greatest increase of the function, and its magnitude equals the maximum rate of change at that point. It is perpendicular to the level curves (contour lines) of the function.
What is Clairaut's theorem (symmetry of mixed partials)?
Clairaut's theorem states that if the second-order mixed partial derivatives of a function are continuous, then the order of differentiation does not matter. That is, curly-d^2 f / (curly-d x curly-d y) = curly-d^2 f / (curly-d y curly-d x). This is almost always satisfied for functions encountered in practice. It is also known as Schwarz's theorem in some textbooks.
How are partial derivatives used in machine learning?
Machine learning models are trained by minimising a loss function that depends on thousands or millions of parameters (weights). Gradient descent computes the partial derivative of the loss with respect to each parameter, forming the gradient vector. The parameters are then updated in the opposite direction of the gradient to reduce the loss. In neural networks, the backpropagation algorithm efficiently computes all these partial derivatives using the chain rule applied layer by layer.
Can partial derivatives be negative?
Yes. A negative partial derivative means the function is decreasing in that direction at the given point. For example, if curly-d f / curly-d x < 0 at a point, then f decreases as x increases (with y held constant). The sign of a partial derivative tells you whether the function is locally increasing or decreasing along that variable's axis.
What is a mixed partial derivative?
A mixed partial derivative involves differentiating with respect to two or more different variables in succession. For example, curly-d^2 f / (curly-d x curly-d y) means first differentiating f with respect to y, then differentiating the result with respect to x. Mixed partials measure how the slope in one direction changes as you move in another direction. They appear in the off-diagonal entries of the Hessian matrix.
How do you find critical points using partial derivatives?
A critical point of f(x, y) occurs where both partial derivatives are zero simultaneously: curly-d f / curly-d x = 0 and curly-d f / curly-d y = 0. To classify the critical point, compute the Hessian determinant D = f_xx * f_yy - (f_xy)^2. If D > 0 and f_xx > 0, it is a local minimum. If D > 0 and f_xx < 0, it is a local maximum. If D < 0, it is a saddle point. If D = 0, the test is inconclusive.
What is the chain rule for partial derivatives?
When a function depends on variables that are themselves functions of other variables, the multivariable chain rule is needed. For example, if z = f(x, y) where x = x(t) and y = y(t), then dz/dt = (curly-d f / curly-d x)(dx/dt) + (curly-d f / curly-d y)(dy/dt). More generally, if x and y depend on two parameters s and t, the chain rule gives curly-d z / curly-d s = (curly-d f / curly-d x)(curly-d x / curly-d s) + (curly-d f / curly-d y)(curly-d y / curly-d s).
What is the Hessian matrix?
The Hessian matrix is the square matrix of all second-order partial derivatives of a function. For f(x, y), the Hessian is a 2x2 matrix with f_xx in the top-left, f_xy in the top-right, f_yx in the bottom-left, and f_yy in the bottom-right. It generalises the second derivative test to multiple dimensions and is used to classify critical points, analyse curvature, and in Newton's method for optimisation.

Related Calculus Calculators

Related Articles