Calculus, Linear Algebra & Discrete Math Derivatives & Differentiation Standard differentiation rules (power, product, quotient, chain)

Derivative Calculator (d/dx, Step by Step)

Type a function of one variable and this calculator differentiates it symbolically, simplifies the result, and evaluates the derivative at whatever point you name. It applies the power, product, quotient and chain rules exactly as you would by hand, shows each order of differentiation as a separate step, and cross-checks the symbolic answer against a central-difference estimate so you can see the two agree. Orders one through four are supported, and the table and graph beside the result let you read the slope off the curve as well as off the algebra.

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)Use ^ for powers, * for multiplication (2*x, 2x and a plain space all work, so x sin(x) is read as a product), and the function names sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh, exp, ln, log (base 10), sqrt, cbrt and abs. The constants pi and e are recognised.x^3 - 5x^2 + 2x - 8
Differentiate with respect toPick the letter you used in the expression; every other letter is treated as a constant.x
Derivative orderHow many times to differentiate. Order 1 is the ordinary slope.1 — first derivative
Evaluate the derivative atThe point where you want a number rather than a formula.2

It returns

  • Derivative at your point — The derivative of the chosen order, evaluated at the point you entered.
  • Derivative, simplified
  • f at your point
  • Symbolic vs numerical check — How far the symbolic answer sits from a central-difference estimate. Near zero means the two methods agree.

The formula

f(x)=limh0f(x+h)f(x)h
ddxxn=nxn1
(fg)=fg+fg
ddxf(g(x))=f(g(x))g(x)

In plain text: f′(x) = lim(h→0) [f(x+h) − f(x)] / h

  • f′(x)Derivative — the instantaneous rate of change of f at x (units of f per unit of x)
  • hWidth of the difference quotient, driven to zero (units of x)
  • xThe point at which the slope is measured (units of x)

The limit is the definition. The power, product, quotient and chain rules are theorems proved from it, and they are what this calculator actually applies.

Updated Category Derivatives & Differentiation Verified against published test cases Reading time 11 min

What the derivative actually measures

The derivative of f at x is the slope of the curve at that single point. You get it by taking the slope of a secant line through two nearby points, [f(x+h) − f(x)] / h, and letting the gap h shrink to zero. If that limit exists, the secant lines settle onto one line — the tangent — and its slope is f′(x).

That definition is the whole subject in one sentence, but nobody differentiates by limits in practice. Every rule you learn is a shortcut proved once from the limit and then reused forever. The power rule handles x^n. The product and quotient rules handle things multiplied or divided. The chain rule handles a function wrapped inside another, which is where most homework errors live.

The derivative matters outside a mathematics class because it converts a description of a quantity into a description of how fast that quantity is changing. Position becomes velocity. Cost becomes marginal cost. Concentration becomes reaction rate. Whenever a model gives you a formula for a level, the derivative gives you the formula for its rate, and the rate is usually the thing you can control.

This calculator differentiates symbolically, meaning it manipulates the formula rather than sampling numbers. That distinction matters: a symbolic derivative is exact and valid at every point in the domain, while a numerical estimate is approximate and only valid where you sampled it. You get both here, which is the point of the check figure. Use the numerical derivative calculator when you have data points and no formula at all.

The four rules this calculator applies, and why they look the way they do

Power rule. d/dx x^n = n·x^(n−1). Multiply by the old exponent, then drop the exponent by one. It holds for every real n, not just positive integers, so sqrt(x) = x^0.5 differentiates to 0.5·x^(−0.5) = 1/(2√x), and 1/x = x^(−1) differentiates to −x^(−2).

Product rule. (fg)′ = f′g + fg′. The shape comes from the limit: when both factors move, the rectangle they define grows on two sides at once, so you get two terms. The most common error in a first calculus course is writing (fg)′ = f′g′, which fails on the simplest possible case — take f = g = x and it returns 1 instead of the correct 2x.

Quotient rule. (f/g)′ = (f′g − fg′)/g². Note the minus sign and the order: the numerator's derivative comes first. If you cannot remember it, rewrite the quotient as f·g^(−1) and use the product and chain rules instead. You get the same answer from rules you trust more.

Chain rule. d/dx f(g(x)) = f′(g(x))·g′(x). Differentiate the outside function, leave the inside untouched, then multiply by the derivative of the inside. Every missed factor of 2 in d/dx sin(2x) = 2cos(2x) is a chain rule somebody forgot to finish.

Everything else is a lookup: sin′ = cos, cos′ = −sin, tan′ = sec², (e^x)′ = e^x, (ln x)′ = 1/x. The calculator carries the same table, applies the chain rule around it, then collects like terms so the printed answer matches what a careful hand simplification gives.

Worked example: differentiating x³ − 5x² + 2x − 8 at x = 2

Take the default expression, f(x) = x³ − 5x² + 2x − 8, and differentiate it once.

  1. Split the sum. The derivative of a sum is the sum of the derivatives, so handle each term separately.
  2. First term. d/dx x³ = 3·x² = 3x².
  3. Second term. The constant multiple rides along: d/dx (−5x²) = −5·(2x) = −10x.
  4. Third term. d/dx (2x) = 2·1 = 2.
  5. Fourth term. The derivative of the constant −8 is 0, because a constant function has no slope anywhere.
  6. Assemble. f′(x) = 3x² − 10x + 2.
  7. Evaluate at x = 2. 3(2)² − 10(2) + 2 = 12 − 20 + 2 = −6.

So at x = 2 the curve is falling at six units of f per unit of x. Check it against the function value: f(2) = 8 − 20 + 4 − 8 = −16, so the tangent line there is y = −16 − 6(x − 2). Nudging x to 2.01 predicts −16.06, and the true value is f(2.01) = −16.0599 to four decimal places. That one-unit-in-the-fourth-place gap is the tangent line doing its job.

Now a product-rule case. For f(x) = x² sin x, the product rule gives f′(x) = 2x·sin x + x²·cos x. At x = 1 that is 2(0.8414710) + 1(0.5403023) = 1.6829420 + 0.5403023 = 2.2232443. That is the second test vector this calculator ships with, and you can reproduce every digit with a scientific calculator in radian mode.

How to read the number the calculator returns

The sign tells you direction. A positive derivative means f is increasing at that point, a negative one means it is decreasing, and zero means the tangent is horizontal — a candidate maximum, minimum or saddle. Zeros of f′ are exactly the critical points you hunt for in an optimisation problem, and the critical points calculator finds them for you.

The magnitude tells you steepness, in units. A derivative is never a bare number in an applied problem: it carries the units of f divided by the units of x. If f is metres and x is seconds, f′ = −6 means six metres per second downward, not "minus six".

The second derivative tells you bend. Set the order to 2 and you get f″, whose sign gives concavity: positive is concave up, negative is concave down. That is the whole content of the second derivative test, and it is what separates a maximum from a minimum once f′ has already hit zero.

The check figure should be tiny. The calculator differentiates a second time by finite differences and reports the gap. On a smooth stretch it lands near 1e−9. A visibly non-zero gap is a signal rather than a bug: it appears at corners such as abs(x) at zero, at vertical tangents such as cbrt(x) at zero, and near poles such as 1/x at zero — precisely the places where the derivative genuinely fails to exist or blows up.

Derivatives worth knowing by heart

The standard table. Every entry composes with the chain rule: replace x by u and multiply the result by u′.
f(x)f′(x)Note
x^nn·x^(n−1)Any real n
sqrt(x)1/(2·sqrt(x))The n = 1/2 case
1/x−1/x²The n = −1 case
e^xe^xIts own derivative
a^xa^x·ln aReduces to e^x when a = e
ln x1/xx > 0
log x (base 10)1/(x·ln 10)ln 10 = 2.302585
sin xcos xRadians only
cos x−sin xRadians only
tan xsec² xUndefined at odd multiples of π/2
asin x1/sqrt(1 − x²)Needs |x| < 1
atan x1/(1 + x²)Defined everywhere
sinh xcosh xNo sign flip, unlike sin

Trigonometric derivatives are stated for radians. In degrees every one of them picks up a factor of π/180, which is why calculus is done in radians.

Mistakes that turn a correct method into a wrong answer

  • Dropping the inside derivative. d/dx sin(3x) is 3cos(3x), not cos(3x). Whenever the argument of a function is anything other than a bare variable, the chain rule owes you a factor.
  • Differentiating a product factor by factor. (fg)′ is not f′g′. Test any suspicious rule on f = g = x: if it does not return 2x, discard it.
  • Reversing the quotient rule numerator. It is (f′g − fg′), not (fg′ − f′g). Getting it backwards flips the sign of every slope you compute.
  • Working in degrees. The rule sin′ = cos is only true in radians. A trigonometric derivative computed in degree mode is wrong by a factor of about 57.3.
  • Treating a parameter as a variable. If your expression contains a letter other than the one you selected, this calculator treats it as a constant, exactly as a hand calculation would. Check the differentiation variable before trusting the answer.
  • Differentiating at a point where f is undefined. ln x has derivative 1/x, but neither f nor f′ means anything at x = 0 or below. The calculator returns a blank rather than a fabricated number.

What this calculator does not do

It differentiates one variable at a time. If your expression contains two variables, everything except the one you select is frozen — that is a partial derivative, and if you want it labelled and explained as one, use the partial derivative calculator instead. If the variables are tangled in an equation you cannot solve for y, you need implicit differentiation.

It also has no rule for functions outside the standard library listed in the table above. Feed it a gamma function or a Bessel function and it says so, then falls back to a numerical estimate rather than inventing a formula.

Simplification is deliberate but modest: the calculator folds constants, cancels zeros and ones, and collects identical terms, but it does not factor, expand or apply trigonometric identities. So 2sin(x)cos(x) stays as it is rather than becoming sin(2x). Both are correct; only one is prettier, and guessing which form your instructor wants is not something software should do.

Finally, a symbolic derivative says nothing about where the derivative is valid. d/dx abs(x) = x/abs(x) is right for every x except zero, where no derivative exists at all. The check figure is your warning light for that case.

Where differentiation sits among the tools next to it

Differentiation is one half of calculus; antidifferentiation is the other, and the Fundamental Theorem is the statement that they undo each other. If you want to sanity-check an integral, differentiate the answer and see whether the integrand comes back — this site's integral calculator does exactly that automatically.

Once you have f′, several standard jobs open up. The tangent line calculator turns the slope into a line and a linear approximation. L'Hôpital's rule uses derivatives to resolve limits of the form 0/0. Newton's method uses the derivative to chase a root. Taylor series stack derivatives of every order to approximate a function by a polynomial.

For a function known only from measurements there is no formula to differentiate, and you fall back to finite differences on the data. That is a different trade: exact arithmetic on approximate data, rather than approximate arithmetic on an exact formula. Noise in the data is amplified by differentiation, which is why smoothing usually comes first in a laboratory context.

Frequently asked questions

How do I type a function into this calculator?

Write it the way you would in a programming language: ^ for powers, * for multiplication, and parentheses around any function argument. Implicit multiplication works too, so 2x, 3sin(x) and x(x+1) are all read correctly. Available functions are sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh, exp, ln, log (base 10), sqrt, cbrt and abs, plus the constants pi and e.

Is log natural or base 10 here?

ln(x) is the natural logarithm and log(x) is base 10. Textbooks disagree about log, so this calculator fixes the convention rather than guessing: use ln whenever you mean the natural log. Their derivatives differ by a constant factor — d/dx ln x = 1/x while d/dx log x = 1/(x·ln 10), about 0.4343/x.

Why does the derivative of my trigonometric function look wrong?

Almost always because you are comparing it against a degree-mode result. Every derivative rule for sine, cosine and tangent assumes radians; in degrees, d/dx sin x is (π/180)·cos x, roughly 0.01745·cos x. This calculator works in radians throughout, so pi/2 means 90 degrees.

What does the symbolic-versus-numerical check number mean?

It is the absolute gap between the symbolic derivative and a central-difference estimate made at your evaluation point. On a smooth function it sits around 1e−9, which is floating-point noise. A large value tells you the function is not smooth there — a corner, a vertical tangent, or a nearby pole — and that the derivative at that exact point may not exist even though the formula prints fine.

Can it handle a fourth derivative?

Yes, up to order four. Each order is computed by differentiating the previous one symbolically and then simplifying, and every intermediate result appears in the steps so you can check your own work at each stage. Beyond order four the expressions for most non-polynomial functions grow faster than they inform, which is why the selector stops there.

Why is my answer written differently from my textbook's?

Because many algebraically equal forms exist and the calculator picks one mechanically. It collects like terms and folds constants but never applies trigonometric identities or factoring, so it may print 2·cos(x)·sin(x) where a book writes sin(2x). Substitute a couple of numeric values into both forms; if they agree, the two answers are the same derivative.

What is a typical value for the derivative of a well-behaved function?

There is no typical value — it depends entirely on the units you are working in. What matters is the sign and the comparison across points. Reading the table beside the result is usually more informative than any single number, because it shows whether the slope is growing or shrinking as you move along the curve, which is the shape information the second derivative formalises.

Does the calculator differentiate with respect to a variable that does not appear?

Yes, and it returns zero, which is the correct answer. If you differentiate x^3 with respect to t, nothing in the expression depends on t, so the rate of change is zero. If that surprises you, you probably meant to select a different variable in the dropdown.

References