Calculus, Linear Algebra & Discrete Math Multivariable & Vector Calculus Clairaut's theorem on the equality of mixed partials

Partial Derivative Calculator (Multivariable)

Type a function of x, y and z and this calculator differentiates it with respect to one variable at a time, holding the others fixed. You get the derivative as an expression, its numeric value at whatever point you choose, the full grid of first and second partials, and a check that the two mixed partials fxy and fyx agree. The differentiation is symbolic — power, product, quotient and chain rules applied to the parsed expression — so nothing is approximated by a finite difference.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Function f(x, y, z)Use * for multiplication, ^ for powers, and sin, cos, tan, exp, ln, log, sqrt, abs, asin, acos, atan, sinh, cosh or tanh for functions. pi and e are recognised constants.x^2*y + sin(y*z)
Differentiate with respect toThe variable you vary. Every other variable is treated as a constant.x
Then differentiate again with respect toChoose a second variable for a second-order or mixed partial; leave it at first order for a plain gradient component.Stop at first order
Evaluate at x =The x-coordinate of the point where the derivative is evaluated.2
Evaluate at y =The y-coordinate of the point where the derivative is evaluated.3
Evaluate at z =The z-coordinate of the point; it is ignored by any function that does not contain z.1

It returns

  • Requested partial derivative at the point — The derivative you selected above, evaluated at (x, y, z).
  • f at the point
  • f_x — partial in x
  • f_y — partial in y
  • f_z — partial in z
  • f_xx — second partial in x
  • f_yy — second partial in y
  • f_xy — mixed partial

The formula

fx=limh0f(x+h,y,z)f(x,y,z)h
2fyx=2fxy

In plain text: ∂f/∂x = lim(h→0) [f(x+h, y, z) − f(x, y, z)] / h

  • fThe function being differentiated (any)
  • ∂f/∂xRate of change of f as x varies, with y and z held fixed (f-units per x-unit)
  • hThe vanishing increment in x (x-units)
  • f_xyDifferentiate in x first, then in y (f-units per x-unit per y-unit)

The limit definition is the definition; the calculator applies the symbolic differentiation rules that follow from it.

Updated Category Multivariable & Vector Calculus Verified against published test cases Reading time 11 min

What a partial derivative measures

A partial derivative answers one question: if you nudge a single input and freeze everything else, how fast does the output move? For a surface z = f(x, y), the partial fx is the slope you would feel walking due east across that surface, and fy is the slope walking due north. Neither on its own is the steepest slope — that is the job of the gradient vector, which packages the partials into a direction.

The freezing is the whole idea. When you differentiate x^2*y with respect to x, the y is a constant multiplier and the answer is 2xy. Differentiate the same expression with respect to y and now x2 is the constant multiplier, giving x2. One expression, two completely different derivatives, because two different things were held still.

That is why partials show up wherever a quantity depends on several things at once. A thermodynamicist writes (∂U/∂V)S and puts the held-constant variable in a subscript, because the same derivative taken at constant temperature is a different number. An economist reads ∂Q/∂p as the response of demand to price with income unchanged. A machine-learning gradient step is nothing but a vector of partials of the loss with respect to each weight.

The rules are the single-variable rules, applied one variable at a time

You already know every rule you need. Treat the other variables as if they were the number 7, then differentiate normally.

Power rule. ∂/∂x of x3y2 is 3x2y2. The y2 rides along untouched.

Product rule. It only applies when both factors contain the variable you are differentiating. In x2·sin(xz), differentiating in x needs the product rule; differentiating in y gives zero because neither factor contains y.

Chain rule. For sin(yz) differentiated in y, the outer derivative is cos(yz) and the inner derivative of yz in y is z, so the answer is z cos(yz). Forgetting that inner factor is the single most common error in a Calculus III exam.

Second and mixed partials. Differentiate twice. fxx means differentiate in x and then in x again; fxy means differentiate in x first and then in y. The notation is genuinely inconsistent across textbooks: the subscript form fxy reads left to right, while the operator form ∂2f/∂yx reads right to left. They mean the same thing. This page uses the subscript order, so fxy is x first.

Clairaut's theorem (also attributed to Schwarz and to Young in different texts) says the order does not matter as long as the second partials are continuous near the point. That is a genuine theorem with a genuine hypothesis, and the calculator reports the largest disagreement it finds so you can see the symmetry rather than assume it.

Worked example: f(x, y, z) = x²y + sin(yz) at the point (2, 3, 1)

Work it by hand, then check it against the calculator defaults.

  1. Differentiate in x. The term sin(yz) contains no x, so it dies. The term x2y gives 2xy. So fx = 2xy, and at (2, 3, 1) that is 2 × 2 × 3 = 12.
  2. Differentiate in y. The first term gives x2. The second needs the chain rule: the outer derivative of sin is cos(yz), the inner derivative of yz in y is z. So fy = x2 + z cos(yz) = 4 + 1 × cos(3) = 4 − 0.98999250 = 3.01000750 (cos 3 radians, not degrees).
  3. Differentiate in z. Only the sine term survives: fz = y cos(yz) = 3 × (−0.98999250) = −2.96997749.
  4. Second partial in x. Differentiate fx = 2xy in x again: fxx = 2y = 6.
  5. Mixed partial. Differentiate fx = 2xy in y: fxy = 2x = 4. Now go the other way: fy = x2 + z cos(yz), and differentiating that in x gives 2x = 4 as well. The two orders agree, exactly as Clairaut promises.
  6. Second partial in y. Differentiate fy = x2 + z cos(yz) in y: the constant x2 dies and the chain rule gives −z2 sin(yz) = −1 × sin(3) = −0.14112001.
  7. Function value. f(2, 3, 1) = 4 × 3 + sin(3) = 12 + 0.14112001 = 12.14112001.

Every one of those seven numbers appears in the results panel above when you load the page, so you can mark your own working line by line.

How to read the numbers you get back

Sign is the first thing to read. A positive fx means f increases as x increases from this point; a negative one means it decreases. The size tells you the rate per unit of x, in whatever units f carries.

All first partials zero marks a critical point. That is where maxima, minima and saddles live. Which one you have is decided by the second partials through the discriminant D = fxxfyyfxy2: if D > 0 and fxx > 0 you have a local minimum, if D > 0 and fxx < 0 a local maximum, and if D < 0 a saddle. When D = 0 the test is silent and tells you nothing either way. At the default point the partials are not zero, so no classification applies there.

Units matter more than students expect. If f is pressure in kilopascals and x is temperature in kelvin, then fx is in kPa per K. A second partial fxx is in kPa per K squared. Reporting a partial without its units is reporting half an answer.

The mixed partial has a plain meaning: it is how much the x-slope changes when you move in y. A zero mixed partial means the two variables act independently on the slope, which is exactly the case for any function that splits as g(x) + h(y).

Common functions and their partials

Each row is differentiated in x and in y with the other variable held constant. Verify any row by typing it into the calculator.
f(x, y)f_xf_yf_xy
x^2*y2xy2x
x*yyx1
x^3*y^23x²y²2x³y6x²y
x^2 + y^22x2y0
sin(x*y)y cos(xy)x cos(xy)cos(xy) − xy sin(xy)
exp(x*y)y e^(xy)x e^(xy)(1 + xy) e^(xy)
ln(x*y)1/x1/y0
x/y1/y−x/y²−1/y²
sqrt(x^2 + y^2)x/√(x²+y²)y/√(x²+y²)−xy/(x²+y²)^(3/2)

The f_xy column differentiates in x first and then in y. Every entry is symmetric in the sense that differentiating in the other order gives the same expression.

Mistakes that cost marks

  • Dropping the inner derivative. ∂/∂y of sin(yz) is z cos(yz), not cos(yz). The chain rule does not switch off just because you are holding another variable constant.
  • Differentiating the held variable anyway. In x2y3 differentiated in x, the y3 is a constant. It does not become 3y2.
  • Reading the operator notation backwards.2f/∂yx is x first, then y — the operator nearest f acts first. The subscript form fxy is the opposite reading order for the same object.
  • Assuming Clairaut always applies. It needs continuity of the second partials near the point. The textbook counterexample xy(x²−y²)/(x²+y²) has f_xy = −1 and f_yx = +1 at the origin, and that function is not one this calculator can be given because the expression is undefined there.
  • Working in degrees. Every trigonometric function here takes radians, which is the only convention under which d(sin u)/du = cos u holds.
  • Evaluating at a point outside the domain. ln(x) at x = −2 or 1/z at z = 0 has no value, and neither does its derivative; the calculator reports that rather than inventing a number.

Symbolic, not numeric

This calculator differentiates the parsed expression using the same rules you would use on paper, then evaluates the resulting expression at your point. It does not use a finite difference such as [f(x+h) − f(x−h)]/2h, so there is no step-size error to tune and no cancellation noise at small h. If you want the finite-difference approach — because your function comes from data or a black-box simulation rather than a formula — use the numerical derivative calculator instead.

Where partial derivatives lead next

The partials are the raw material for almost everything in multivariable calculus. Stack them into a vector and you have the gradient, whose direction is the steepest ascent and whose length is the steepest slope; the directional derivative in any unit direction u is just the dot product ∇f · u. Stack the partials of a vector field into a matrix and you have the Jacobian, whose determinant is the local volume-scaling factor used in every change-of-variables integral — see the Jacobian determinant calculator. Take the partials of a vector field and combine them one way and you get the divergence; combine them another way and you get the curl.

Second partials assemble into the Hessian matrix, whose eigenvalues classify critical points in any number of variables — the two-variable discriminant test above is just the two-by-two determinant of that matrix. If you want those eigenvalues, the eigenvalue calculator takes the Hessian directly.

If your function has only one variable, none of this machinery is needed: use the ordinary derivative calculator or the second derivative calculator. And if what you actually need is to integrate over a region rather than differentiate at a point, start with the double integral calculator.

Key terms

Partial derivative
The derivative of a multivariable function with respect to one variable, with all other variables held constant. Written ∂f/∂x or fx.
Mixed partial
A second derivative taken in two different variables, such as fxy. Equal to fyx wherever both are continuous.
Gradient
The vector (fx, fy, fz). It points in the direction of fastest increase and its length is the largest directional derivative at the point.
Hessian
The matrix of all second partials. Its determinant in two variables is the discriminant D = fxxfyy − fxy², used to classify critical points.
Clairaut's theorem
If the second partials of f are continuous on an open set, then fxy = fyx there. Also known as Schwarz's theorem.

Frequently asked questions

What does it mean to hold a variable constant?

It means you treat that variable as a fixed number while differentiating, exactly as you would treat the 7 in 7x. Geometrically, holding y and z constant slices the graph of f with a plane, and the partial derivative in x is the ordinary slope of the curve where that plane cuts the surface. Nothing about the function changes; only your choice of which direction to move in does.

Is f_xy the same as f_yx?

Yes, wherever the second partials are continuous near the point — that is Clairaut's theorem, also called Schwarz's theorem. The calculator computes both orders independently and reports the largest disagreement it finds, which is zero for every ordinary algebraic or trigonometric expression. Counterexamples exist, but they are piecewise-defined functions with a singular point, not something you can type into this box.

How do I write the function so the calculator understands it?

Use * for multiplication, ^ for powers, and parentheses freely: x^2*y + sin(y*z). Implicit multiplication such as 2x or 3xy is accepted, and so are the functions sin, cos, tan, exp, ln, log (base 10), sqrt, abs, asin, acos, atan, sinh, cosh and tanh. The symbols pi and e are constants, so a variable cannot be named e. If something is mistyped you get an explicit parse warning rather than a silent wrong answer.

Why is one of my partial derivatives exactly zero?

Because that variable does not appear in the function. The derivative of x²y with respect to z is zero, and this is a real, correct answer rather than a failure — the function is flat in the z direction. Zero also appears legitimately at a critical point, where every first partial vanishes at once.

What is a normal size for a partial derivative?

There is no normal size, because the value carries units: f-units per unit of the variable you differentiated in. What is meaningful is the comparison between partials at the same point. If f_x is 12 and f_y is 3, then f responds four times more strongly to a nudge in x than the same nudge in y, and that ratio is what tells you which variable dominates near the point.

Can I get the gradient from this calculator?

Yes — the gradient is just the three first partials read together, and all three appear in the results and in the table of every derivative. If you want the gradient formatted as a vector, with its magnitude and unit direction, use the gradient vector calculator instead. If you want the rate of change along a specific direction rather than along an axis, use the directional derivative calculator.

Does it work for functions of only two variables?

Yes. Write f in terms of x and y only and leave z out of the expression. The z-partials will come back as zero, which is the correct derivative of a function that is constant in z. The z evaluation point is then ignored entirely, so you can leave it at any value.

Why does my answer differ from my textbook by a factor involving pi?

Almost always because the textbook worked in degrees while every trigonometric function here works in radians. The derivative rule d(sin u)/du = cos u is only true in radians; in degrees an extra factor of pi/180 appears. Convert your evaluation point to radians before entering it — 30 degrees is 0.5235988.

What do I do when the calculator says the function is undefined at the point?

Move the point. A message like that means a denominator hit zero, a logarithm was handed a non-positive number, or a square root was handed a negative one. The symbolic derivative expression is still shown in the table, so you can read the formula and evaluate it anywhere else in the domain.

References