Derivative Calculator

Differentiate any function and see every step, from the power rule to the chain rule.

Derivative Calculator

What Is a Derivative?

The derivative of a function f(x) measures how fast the function's output changes as its input changes — geometrically, it's the slope of the line tangent to the curve at a given point. If f(x) describes a position over time, f'(x) describes velocity; if f(x) describes revenue as a function of price, f'(x) tells you how revenue responds to a small price change. This rate-of-change interpretation is what makes derivatives the starting point for almost everything else in calculus, from optimization to related rates to differential equations.

Formally, the derivative is defined as a limit: f'(x) = limh→0 [f(x+h) − f(x)] / h. That definition is important conceptually, but in practice almost nobody differentiates by plugging into the limit directly. Instead, mathematicians developed a set of shortcut rules — the power rule, product rule, quotient rule, and chain rule — that let you differentiate almost any function built from polynomials, trig functions, exponentials, and logarithms in a few mechanical steps. This calculator applies exactly those rules, in the same order you'd use by hand, and shows each one.

How to Use This Derivative Calculator

Type any function of x into the input box using standard notation: ^ for exponents, * or simple juxtaposition for multiplication (both 3*x and 3x work), and function names like sin(x), cos(x), tan(x), exp(x), ln(x), log(x) (base 10), and sqrt(x). Click Differentiate and the calculator will:

  • Parse your function into a structured expression tree, the same way a computer algebra system would.
  • Apply differentiation rules recursively — working from the outermost operation inward, exactly like the chain rule requires.
  • Simplify the result into clean, readable notation.
  • Optionally evaluate f'(x) at a specific x-value if you fill in the "Evaluate at" field — useful for finding the slope of the tangent line at a point.
  • Graph f(x) and f'(x) together, so you can visually confirm that f'(x) is positive where f(x) is increasing and negative where f(x) is decreasing.

Derivative Rules Reference

RuleFunctionDerivative
Power rulexnn·xn−1
Constant multiplec·f(x)c·f'(x)
Sum/difference rulef(x) ± g(x)f'(x) ± g'(x)
Product rulef(x)·g(x)f'(x)g(x) + f(x)g'(x)
Quotient rulef(x)/g(x)[f'(x)g(x) − f(x)g'(x)] / g(x)²
Chain rulef(g(x))f'(g(x))·g'(x)
Exponentialexex
Natural logln(x)1/x
Sinesin(x)cos(x)
Cosinecos(x)−sin(x)

Worked Example

Consider f(x) = x·sin(x). This requires the product rule, since it's a product of two functions that both depend on x: u = x and v = sin(x). The product rule states d/dx[uv] = u'v + uv'. Here u' = 1 and v' = cos(x), so:

f'(x) = (1)(sin(x)) + (x)(cos(x)) = sin(x) + x·cos(x)

Try entering x*sin(x) above to see the calculator produce and simplify this exact result, then compare it against the graph — notice how f'(x) crosses zero exactly where f(x) has a local maximum or minimum.

Common Mistakes to Avoid

  • Forgetting the chain rule inside a composed function. d/dx[sin(3x)] is 3cos(3x), not cos(3x) — the derivative of the inner function (3x) must be multiplied in.
  • Misapplying the power rule to non-polynomial bases. d/dx[2x] is 2x·ln(2), not x·2x−1 — the power rule only applies when the exponent is constant and the base is the variable.
  • Dropping a term in the product rule. d/dx[uv] needs both u'v and uv' — a very common slip is computing only one of the two terms.
  • Sign errors with cos and sin. d/dx[cos(x)] = −sin(x) (note the negative sign), which is easy to drop under time pressure.

Real-World Applications of Derivatives

Derivatives are how physics turns position into velocity and velocity into acceleration — if s(t) is an object's position over time, s'(t) is its velocity and s''(t) is its acceleration. This is why the earliest motivation for calculus, going back to Newton, was describing motion: the derivative gives you an instantaneous rate at a single moment, something earlier mathematics couldn't express cleanly. The same idea extends to any quantity that changes continuously over time, from the current flowing through a circuit to the rate a chemical reaction proceeds.

In economics and business, derivatives describe marginal quantities: marginal cost is the derivative of the total cost function, telling a company how much producing one more unit will actually cost at the current production level, rather than the average cost across all units. Marginal revenue works the same way, and setting marginal revenue equal to marginal cost — both derivatives — is the standard calculus-based approach to finding a profit-maximizing production quantity. In biology, population growth models use derivatives to express how fast a population is changing at a given population size, which is the starting point for logistic growth models. In engineering, derivatives quantify sensitivity: how much a bridge's stress changes per unit of added load, or how much a control system's output changes per unit change in its input — information that's essential for both design and safety margins.

Frequently Asked Questions

What's the difference between a derivative and an antiderivative?

A derivative measures a function's instantaneous rate of change and is found by differentiation. An antiderivative reverses that process — it's a function whose derivative gives you back the original function — and is found by integration. If f'(x) = 2x, then an antiderivative of 2x is x² (plus any constant). Use the Integral Calculator for antiderivatives.

Can this calculator handle implicit functions like x² + y² = 25?

Not this one — this tool differentiates explicit functions of a single variable, y = f(x). For equations that mix x and y, like a circle equation, use the dedicated Implicit Differentiation Calculator, which solves for dy/dx directly.

Why does my answer look different from the calculator's, even though it's mathematically the same?

Derivatives can often be written in several algebraically equivalent forms — for example, 1/cos(x)² and sec(x)² are the same value. This calculator doesn't rewrite results in terms of secant, cosecant, or cotangent, so if your textbook uses those, the forms may look different while still being correct.

How do I find the second derivative?

Differentiate the result again. If you need f''(x) directly, with concavity analysis built in, use the Second Derivative Calculator instead.

Does this calculator show every algebra step, or just the final rule applied?

It shows the specific differentiation rule used and the resulting expression at each stage of building the derivative, then the final simplified form. It intentionally doesn't show every micro-step of arithmetic simplification, since that would make results harder to read for complex expressions — the goal is to show you which rule to apply, not to replace your own algebra practice.