Partial Differentiation Calculator Online Free
Partial Differentiation Calculator (Numeric)
Estimate the partial derivatives of a two-variable function at a point, using central finite differences — free, in your browser, nothing uploaded. This is a numeric approximation, not symbolic differentiation: it evaluates the function at nearby points instead of deriving a formula.
Use x and y, numbers, + – * / ^, brackets, and sin, cos, tan, exp, log, ln, sqrt, abs, pi, e.
Some quantities depend on more than one thing at once. The temperature in a room depends on where you stand and on the time of day. The profit of a business depends on the price it charges and on the amount it sells. The height of a landscape depends on how far east you walk and how far north you walk. When a quantity depends on two variables, asking how fast it changes is ambiguous unless you say which variable you are moving and which you are holding still. Partial differentiation is the tool that makes that question precise: it measures the rate of change in one direction while the other variable is frozen. The partial differentiation calculator at the top of this page estimates those rates numerically, for a function you type in, at a point you choose.
This is a distinction worth getting right, because ordinary differentiation, the kind taught first, only handles functions of a single variable. As soon as a second variable enters, the slope of the function becomes a direction-dependent idea. Walk east across a hillside and the ground may rise steeply; walk north from the same spot and it may fall gently; walk diagonally and you get something in between. A single number cannot capture all of that. Two numbers can capture the east and north slopes, and together they form the gradient, the direction of steepest ascent. Partial derivatives are those two numbers, and they are the starting point for optimisation, for sensitivity analysis, and for much of multivariable calculus. This article explains what they mean, how numeric calculation estimates them, and where its limits lie, so the answers mean something when you read them.
What It Is
A partial derivative is an ordinary derivative taken with one variable moving and all others held constant. For a function f of x and y, the partial derivative with respect to x, written ∂f/∂x, is the rate at which f changes when x increases by a tiny amount and y stays exactly where it is. The partial derivative with respect to y, written ∂f/∂y, is the same idea with the roles reversed: y moves, x stays still. The notation uses a curly ∂, called “partial”, precisely to distinguish this from the ordinary d, which would suggest that everything is moving at once. In practice, computing a partial derivative by hand means treating the other variable as if it were a constant number and differentiating normally, but the calculator on this page does not do that symbolic work at all. Instead, it evaluates the function at points slightly to either side of your chosen point and divides the difference by the distance between them, which is the central finite difference method, explained below.
The central finite difference is simple to state and surprisingly accurate. To estimate ∂f/∂x at a point (x, y), the calculator evaluates f at (x + h, y) and at (x − h, y), where h is a small step, 0.00001 in this tool, and computes (f(x + h, y) − f(x − h, y)) / (2h). That is the slope of the secant line through two points straddling your point, and for a smooth function it is very close to the true tangent slope, because the errors on the two sides largely cancel. The same procedure in y gives ∂f/∂y. This method needs no algebra, no differentiation rules, and no symbolic engine, which is why a browser tool can offer it. For any function you can type, including functions whose symbolic derivative would be tedious to work out. The price of that generality is that the answer is an approximation, good to about four decimal places for smooth functions, and less trustworthy where the function has a corner, a jump, or a point where it is not defined.
Consider the live test function, f(x, y) = x²y + sin(x), at the point (2, 3). By hand, treating y as a constant, the derivative with respect to x is 2xy + cos(x), because the derivative of x²y in x is 2xy and the derivative of sin(x) is cos(x). At (2, 3) that is 2 × 2 × 3 + cos(2), which is 12 − 0.416147, giving 11.583853. Treating x as a constant, the derivative with respect to y is x², because the derivative of x²y in y is x² and sin(x) does not contain y at all, so at (2, 3) it is 4. The calculator, which knows none of that algebra, evaluates the function at nearby points and returns 11.5839 and 4.0000, matching the exact answers to four decimal places. That agreement is the whole point of the tool: numeric evaluation, done carefully, reproduces symbolic results closely enough for checking homework, for exploring a function, and for sensitivity analysis, without requiring you to differentiate by hand first.
How to Use the Calculator
Using the tool takes less than a minute. Follow these steps:
- Enter the function f(x, y) using x and y, numbers, the operators + − * / ^, brackets, and the functions sin, cos, tan, exp, log, ln, sqrt, and abs, plus the constants pi and e. For example, type x^2*y + sin(x).
- Enter the value of x at the point where you want the derivatives, for example 2.
- Enter the value of y at the same point, for example 3.
- Press “Calculate Partial Derivatives”. The tool shows the partial derivative with respect to x and the partial derivative with respect to y, each to four decimal places, plus a note of the method used.
- Read the results as rates: the x derivative is the change in f per unit increase in x, with y fixed, and the y derivative is the change in f per unit increase in y, with x fixed.
A few typing habits will save you errors. Write multiplication explicitly: x*y, not xy, because the tool reads xy as an unknown symbol rather than as x times y. Use brackets to make the order of operations clear, especially around powers and fractions: write (x + y)^2 rather than x + y^2 when you mean the square of the sum, and write 1/(x + y) rather than 1/x + y when you mean the reciprocal of the sum. Remember that log in this tool means the natural logarithm, the same as ln, not the base-ten logarithm. And remember that angles in sin, cos, and tan are in radians, as in most mathematics software, so sin(pi/2) is 1 but sin(90) is not.
Worked Examples
Example 1: x²y + sin(x) at (2, 3), the live test
This is the test used to check the tool, and it is worth seeing the hand calculation beside the numeric one. The function is f(x, y) = x²y + sin(x). The exact partial derivatives are ∂f/∂x = 2xy + cos(x) and ∂f/∂y = x². At (2, 3), ∂f/∂x = 12 + cos(2) = 12 − 0.416147 = 11.583853, and ∂f/∂y = 4. The calculator returns 11.5839 and 4.0000. The small difference in the x derivative, about one part in a million, comes from the finite step size and from rounding to four decimal places; it is not a sign of trouble. What the numbers mean is also worth stating: if you increase x by a small amount from 2 while holding y at 3, f increases by about 11.58 times that small amount, while if you increase y by a small amount while holding x at 2, f increases by about 4 times that small amount. At this point, f is almost three times as sensitive to x as to y, and that sensitivity comparison is often the real reason someone computes partial derivatives in the first place.
Example 2: A product, x times y, at (4, 5)
Take the simplest genuinely two-variable function, f(x, y) = x*y. The exact partial derivatives are ∂f/∂x = y and ∂f/∂y = x, because each variable acts as a constant multiplier for the other. At (4, 5), the derivatives are 5 and 4. The calculator returns 5.0000 and 4.0000. This example is useful because it exposes a common confusion: the partial derivative with respect to x depends on y, and the partial derivative with respect to y depends on x. A partial derivative is not a property of one variable alone; it is a property of the point, and it changes as you move around. Students who treat ∂f/∂x as a fixed number for a function have missed this, and this example, computed at several points, is the quickest cure.
Example 3: A function of one variable in disguise, x² + 3, at any y
Consider f(x, y) = x^2 + 3, which does not contain y at all. The partial derivative with respect to x is 2x, and the partial derivative with respect to y is 0, at every point, because changing y does nothing to f. At (5, 100), the calculator returns 10.0000 and 0.0000. A zero partial derivative is informative, not boring: it tells you that, locally, the quantity is insensitive to that variable, which in a real problem might mean that a control you thought mattered does not, at least near that point. It is also a useful check on the tool: if you enter a function that should not depend on y and the tool returns a non-zero y derivative, you have probably mistyped the function, for example by writing y where you meant something else.
Example 4: An exponential, exp(x*y), at (1, 2)
Take f(x, y) = exp(x*y), the exponential of the product. By hand, ∂f/∂x = y × exp(x*y) and ∂f/∂y = x × exp(x*y), by the chain rule. At (1, 2), exp(2) is about 7.389, so ∂f/∂x is about 14.778 and ∂f/∂y is about 7.389. The calculator returns 14.7781 and 7.3891, again matching to four decimal places. This example matters because exponentials of products appear in growth models, in thermodynamics, and in probability, and their derivatives grow with the function itself, which is why exponential systems are so sensitive to their inputs. A small change in x near (1, 2) changes f almost fifteen times as much, which is the kind of sensitivity that partial derivatives are designed to reveal.
The Gradient and Why It Matters
The two partial derivatives at a point can be combined into a single object, the gradient, written ∇f, which is the vector (∂f/∂x, ∂f/∂y). The gradient points in the direction of steepest increase of the function, and its length measures how steep that increase is. For the live test function at (2, 3), the gradient is approximately (11.5839, 4.0000), which points mostly in the x direction with a smaller y component, and its length is about 12.255. That means that, starting from (2, 3), the fastest way to increase f is to move mostly in x, slightly in y, and that moving one unit in that direction increases f by about 12.255, approximately. The calculator does not display the gradient as a separate output, but you can read it directly off the two numbers it gives, and this article states it here so you can use the tool for gradient-based reasoning without needing a separate gradient calculator.
Gradients matter far beyond textbook exercises. In machine learning, gradient descent adjusts model parameters by stepping in the opposite direction to the gradient, because that is the direction in which the error falls fastest. In economics, partial derivatives of a production function with respect to labour and capital are marginal products: how much extra output one more worker, or one more machine, produces, holding the other input fixed. In physics, the gradient of a potential energy function gives the force, with a minus sign, and the gradient of a temperature field gives the direction heat flows. In each case, the underlying question is the same as the one this calculator answers: if I change this one thing a little, holding everything else still, how much does the outcome change? That question is so common that it is worth having a tool that answers it numerically for any function, even when the symbolic derivative would take a page of algebra.
Central Differences, Accuracy, and the Step Size
The choice of step size h is a genuine trade-off, and it is worth understanding rather than treating the tool as a black box. If h is too large, the secant slope differs from the tangent slope because the function curves over the interval; that is truncation error, and it shrinks as h shrinks. If h is too small, the two function values f(x + h) and f(x − h) are almost equal, and subtracting them loses precision in the computer's floating-point arithmetic; that is round-off error, and it grows as h shrinks. A step of 0.00001, the value this tool uses, sits in a comfortable middle for most smooth functions: small enough that curvature over the interval is negligible, large enough that the difference between the two values is still represented accurately. For the live test, the error is about one part in a million, which is far below the four decimal places the tool displays. For functions with very large derivatives or very rapid variation, the error can be larger, and the honest response is to check the result by trying a nearby point and seeing whether the derivatives change smoothly, or by comparing with a hand calculation when one is available.
There is also a reason the tool uses a central difference, with points on both sides, rather than a forward difference, with points at x and x + h only. A forward difference has an error proportional to h, while a central difference has an error proportional to h squared, because the first-order errors on the two sides cancel. That means halving h improves a central difference roughly fourfold, while it only improves a forward difference twofold. For a tool that must work for functions it has never seen, that extra accuracy for free is valuable, and it is one reason the central difference is the standard choice in numerical differentiation. The tool states its method and step size in its output, so you are never asked to trust an undisclosed approximation.
Limits: What This Tool Does and Does Not Do
This tool estimates partial derivatives numerically by central finite differences. It does not perform symbolic differentiation, so it will not return a formula for ∂f/∂x or ∂f/∂y, only numbers at the point you chose. That is a deliberate scope, not a defect, but it means the tool cannot tell you how a derivative varies across a region, only what it is at individual points; for that, evaluate it at several points and look for the pattern. It handles functions of two variables only, x and y, and it does not handle functions with additional variables, implicit functions, or functions defined by cases. It is less reliable at points where the function has a corner, such as abs(x), a jump, a division by zero, or a logarithm or square root of a negative number, because at such points the very idea of a derivative may fail or the function may not be defined on both sides. The tool reports an error when a value is not finite, rather than inventing a number, and you should treat a suspicious result at a kink with the same caution.
Privacy: Your Numbers Stay in Your Browser
Every number and function you enter into this partial differentiation calculator stays in your browser. Nothing is uploaded to a server, nothing is stored, and there is no account to create. The calculation runs entirely on your own device. That matters even for a mathematics tool, because the functions people enter can be part of coursework, an exam revision session, or a piece of unpublished work, and that work deserves to stay private. Closing the page removes your inputs, and no one else sees them. This browser-only design is the same principle behind the other free tools on Your Smart Kit: a simple tool that does one job well, keeps your data private, and gives an answer you can check.
Frequently Asked Questions
What is a partial derivative?
It is the rate of change of a multivariable function when one variable changes and all others are held constant. For f(x, y), ∂f/∂x measures change in the x direction with y fixed, and ∂f/∂y measures change in the y direction with x fixed.
How is this calculator different from a symbolic differentiator?
A symbolic differentiator returns a formula, such as 2xy + cos(x). This calculator returns numbers at a point, estimated by evaluating the function at nearby points. It works for any function you can type, without algebra, but it cannot give you the general formula.
What does the gradient mean?
The gradient is the vector of partial derivatives, (∂f/∂x, ∂f/∂y). It points in the direction of steepest increase of the function, and its length measures how steep that increase is. The calculator's two outputs are exactly the gradient's components.
Why is my partial derivative zero?
A zero partial derivative means the function does not change, locally, when that variable changes, with the other variable fixed. That can happen because the function genuinely does not contain that variable, or because you are at a stationary point in that direction, such as the top of a hill in the x direction even though the ground still slopes in y.
Can I use this for functions of three variables?
No, as built, this tool handles x and y only. For a function of three variables, you would need to fix the third variable at a value and treat the result as a two-variable function, or use a tool built for three variables.
How accurate is the numeric result?
For smooth functions, agreement with the exact derivative to about four decimal places is typical, as in the live test, where the numeric 11.5839 matches the exact 11.583853. At corners, jumps, or points where the function is undefined, the result is less reliable, and the tool reports an error rather than a number when a value is not finite.
Related Tools on Your Smart Kit
If you found the partial differentiation calculator useful, you may also like the other free calculators on Your Smart Kit, including the piecewise integral calculator for integrating functions defined in pieces, the infinite series calculator for adding terms one by one, and the geometry calculator for working with shapes and angles. Each runs in your browser, free, with no sign-up, and each is built on the same principle: a simple tool that does one job well, keeps your data private, and gives an answer you can check. Try the partial differentiation calculator at the top of this page with your own function, and see how sensitive your quantity really is to each of its inputs.
