🧮 Maths & science

Partial derivative calculator

Type a function of two or more variables and choose which one to differentiate by.

Free · no signup Runs in your browser

Use ^ for powers and * for multiplication. Functions: sin, cos, tan, exp, ln, log, sqrt.

Partial derivative—

    What is a partial derivative?

    The derivative of a multivariable function with respect to one variable while every other variable is held constant. For f(x,y) = x²y, the partial with respect to x is 2xy, because y is treated as a fixed number. The only difference from an ordinary derivative is what you agree to hold still.

    Treat the other variables as numbers

    The whole technique reduces to one instruction: pretend every variable except the one you are differentiating by is a constant, then differentiate normally.

    In f(x,y) = x²y, differentiating by x means treating y exactly as you would treat the number 7. The derivative of 7x² is 14x, so the derivative of x²y is 2xy. Differentiating the same function by y instead means treating x² as a constant, so the answer is simply x².

    Everything else — product rule, quotient rule, chain rule — carries over from single-variable calculus completely unchanged.

    Why this one is free

    The best-known tools in this space put the answer in front of you and then paywall the steps, which is the part you actually need if you are learning.

    This calculator is symbolic rather than numeric: it parses your expression into a tree, applies the differentiation rules to that tree, and simplifies the result. There is no account, no subscription and no step gate.

    It also reports the mixed partial where a second variable exists, because that is the standard follow-up question and Clairaut's theorem makes it a useful check on your own working.

    The rules it applies

    Identical to single-variable calculus, with everything else held constant.

    • constant ∂/∂x (c) = 0
    • power ∂/∂x (xⁿ) = n·x^(n−1)
    • sum ∂/∂x (u + v) = ∂u/∂x + ∂v/∂x
    • product ∂/∂x (u·v) = u'·v + u·v'
    • quotient ∂/∂x (u/v) = (u'·v − u·v') / v²
    • chain ∂/∂x f(u) = f'(u) · ∂u/∂x
    • trig ∂/∂x sin u = cos u · u'
    • ∂/∂x cos u = −sin u · u'
    • exp and log ∂/∂x eᵘ = eᵘ · u'
    • ∂/∂x ln u = u' / u

    Clairaut's theorem says that for a function whose second partials are continuous, the mixed partials are equal: differentiating by x then y gives the same result as y then x. That makes the mixed partial a free check on your working — if your two orders disagree, one of them is wrong.

    The gradient collects all the first partials into a vector. It points in the direction of steepest increase, which is the fact that makes partial derivatives the engine behind gradient descent and therefore behind most machine learning.

    Worked example: f(x,y) = x²y + sin(xy)

    Finding both first partials of a function that needs the product and chain rules together.

    1. ∂/∂x of x²y, holding y constant2xy
    2. ∂/∂x of sin(xy), chain rulecos(xy) · y
    3. So ∂f/∂x2xy + y·cos(xy)
    4. ∂/∂y of x²y, holding x constantx²
    5. ∂/∂y of sin(xy)cos(xy) · x

    ∂f/∂x = 2xy + y·cos(xy) and ∂f/∂y = x² + x·cos(xy).

    The chain rule supplies the inner derivative each time: differentiating xy by x gives y, and by y gives x. That inner factor is the step most commonly dropped.

    What the calculator supports

    • Operators + − * / ^ and brackets
    • Functions sin, cos, tan, exp, ln, log and sqrt
    • Implicit multiplication, so xy and 2x are understood
    • Any variable names you like, not only x and y
    • First and second derivatives, plus the mixed partial where a second variable exists

    Inverse trigonometric, hyperbolic and special functions are deliberately outside the grammar. Keeping the supported set explicit is what allows the tool to be a few kilobytes rather than a megabyte.

    Assumptions and limits

    • The expression must parse — an error message names the problem rather than guessing
    • Simplification is basic, so a correct answer may not be in its tidiest possible form
    • Implicit differentiation and constrained optimisation are not covered
    • Results are symbolic, not evaluated at a point

    Terms on this page

    Partial derivative
    The rate of change with respect to one variable while all others are held constant. Written with a curly ∂ rather than a straight d.
    Gradient
    The vector of all first partial derivatives. It points in the direction of steepest increase, which is what gradient descent follows.
    Mixed partial
    Differentiating by one variable then another. Clairaut's theorem says the order does not matter for well-behaved functions.
    Chain rule
    When differentiating a function of a function, multiply by the derivative of the inner part. It is the step most often dropped.

    Common questions

    How do partial derivatives differ from ordinary ones?

    Only in what is held constant. When differentiating by x, every other variable is treated as a fixed number, so the same product, quotient and chain rules apply unchanged. The curly ∂ symbol signals that other variables exist and are being held still.

    What is a mixed partial derivative?

    The result of differentiating by one variable and then a different one, written ∂²f/∂y∂x. Clairaut's theorem says the order does not matter for well-behaved functions, so it makes a useful check — if your two orders disagree, you have made an error.

    How do I write my function?

    Use * or juxtaposition for multiplication and ^ for powers, so x^2*y and x^2 y both work. Functions take brackets, as in sin(x*y). The tool reports a parse error naming the problem if it cannot read something.

    What is the gradient?

    The vector of all first partial derivatives. It points in the direction in which the function increases fastest, and its length is the rate of that increase. This is the quantity gradient descent follows downhill.

    Can it do second derivatives?

    Yes. Choose second order to get ∂²f/∂x², and the mixed partial is shown automatically whenever the function contains more than one variable.

    Where these numbers come from

    Last verified 2026-08-01 The method on this page is checked against the sources above at least once a year. Spotted something out of date? Tell us and we will fix it.

    🧮 Maths and science calculators

    Homework tools that explain the method rather than just handing over an answer.

    See all 30 calculators in this section