Derivative Calculator

A derivative measures how fast a function is changing at any point: the exact slope of its graph there. Type your function below and we will differentiate it rule by rule, showing every step with your expression, not a canned textbook example.

Put this calculator on your website for free

Copy one snippet and give your visitors a working Derivative Calculator.

How this derivative calculator works

You type a function, and we differentiate it the way a tutor would at a whiteboard: one rule at a time, in order, with your actual expression in every line. Not a canned example that looks vaguely like your problem. Your function, your steps.

Under the hood, the calculator parses your expression into a tree, then walks that tree applying the standard differentiation rules recursively: the outermost structure first (a product, a quotient, a composition), then each piece inside it. Every rule it applies gets recorded as a step at the moment it is applied, by the same code that produces the answer. That matters more than it sounds: the steps can never disagree with the result, because they are the result. Afterward a conservative simplifier cleans up the algebra (folding constants, dropping multiplications by 1, collecting coefficients) without mangling the expression into something you no longer recognize.

The input syntax is deliberately relaxed. Write 2x instead of 2*x, sin x instead of sin(x), (x+1)(x-2) with no multiplication sign. If something does not parse, the error tells you which character caused the problem and what to try instead. You can also ask for the second or third derivative, and optionally evaluate everything at a specific x value, including pi shorthands like pi/2.

The differentiation rules

Every derivative in single-variable calculus comes from a short list of rules applied in combination. These are the same formulas the calculator cites in its steps, so the table below doubles as a legend for the output. Throughout, u and v are expressions containing x, and u' means the derivative of u.

RuleFormulaWhen it applies
Power ruled/dx[xn] = n·xn-1x raised to any constant, including fractions and negatives
Constant multipled/dx[c·u] = c·u'a constant factor rides along untouched
Sum and differenced/dx[u + v] = u' + v'differentiate term by term
Product ruled/dx[u·v] = u'·v + u·v'two x-containing factors multiplied
Quotient ruled/dx[u/v] = (u'·v - u·v') / v2one x-containing expression divided by another
Chain ruled/dx[f(g(x))] = f'(g(x))·g'(x)any function inside another function
Exponentiald/dx[eu] = eu·u'e raised to an x-containing exponent
General based/dx[au] = au·ln(a)·u'any constant base, like 2x
Natural logd/dx[ln(u)] = u'/ulogarithm base e
Log base 10d/dx[log(u)] = u' / (u·ln(10))common logarithm
Square rootd/dx[√u] = u' / (2√u)same as the power rule with n = 1/2
Sined/dx[sin(u)] = cos(u)·u'all six trig functions are supported; the minus signs belong to the co-functions
Cosined/dx[cos(u)] = -sin(u)·u'
Tangentd/dx[tan(u)] = sec2(u)·u'
Secantd/dx[sec(u)] = sec(u)·tan(u)·u'
Cosecantd/dx[csc(u)] = -csc(u)·cot(u)·u'
Cotangentd/dx[cot(u)] = -csc2(u)·u'
Arcsined/dx[asin(u)] = u' / √(1 - u2)inverse trig; arccosine's derivative is the negative of arcsine's
Arccosined/dx[acos(u)] = -u' / √(1 - u2)
Arctangentd/dx[atan(u)] = u' / (1 + u2)
Hyperbolic sined/dx[sinh(u)] = cosh(u)·u'like trig, but cosh keeps its plus sign
Hyperbolic cosined/dx[cosh(u)] = sinh(u)·u'
Hyperbolic tangentd/dx[tanh(u)] = u' / cosh2(u)

Two functions deserve a special mention. When x appears in both the base and the exponent, as in xx, no single rule above applies; the calculator uses logarithmic differentiation, rewriting uv as ev·ln(u), differentiating that, and rewriting back. And abs(u) gets differentiated as u·u' / |u|, with an honest caveat in the result: the absolute value has a sharp corner wherever u = 0, and no derivative exists there.

Worked example: the product rule

Take f(x) = x2·sin(x). Two factors, each containing x, so the product rule leads. Here is the calculator's actual output for this input, step for step:

f'(x) = 2x·sin(x)+x2·cos(x)

  1. Product rule. d/dx[u·v] = u'·v + u·v' Here u = x2 and v = sin(x). Each factor takes a turn being differentiated.
    d/dx[ x2·sin(x) ] = 2x·sin(x)+x2·cos(x)
  2. Power rule. d/dx[xn] = n·xn-1 Bring the exponent down in front, then lower the exponent by one.
    d/dx[ x2 ] = 2x
  3. Derivative of sine. d/dx[sin(u)] = cos(u)·u'
    d/dx[ sin(x) ] = cos(x)

Now evaluate at x = pi/2, where sin is exactly 1 and cos is exactly 0. The second term vanishes and the first becomes 2·(pi/2)·1, so f'(pi/2) = pi. The calculator reports f'(x) = 3.141593 at x = pi/2 (with f(x) = 2.467401 there). When a derivative lands exactly on pi, it is a good day.

Worked example: the chain rule

Now take f(x) = ln(x2+1), a function inside a function. The chain rule handles the nesting: differentiate the outer ln first, then multiply by the derivative of the inside. Again, this is the calculator's real output:

f'(x) = 2x/(x2+1)

  1. Chain rule (derivative of the natural log). d/dx[ln(u)] = u'/u with u = x2+1 Differentiate the outside function first, then multiply by the derivative of the inside, u'.
    d/dx[ ln(x2+1) ] = 2x/(x2+1)
  2. Sum rule. d/dx[u + v] = u' + v' Differentiate each part on its own, then recombine.
    d/dx[ x2+1 ] = 2x
  3. Power rule. d/dx[xn] = n·xn-1 Bring the exponent down in front, then lower the exponent by one.
    d/dx[ x2 ] = 2x
  4. Constant rule. d/dx[c] = 0 This piece has no x in it, so it does not change as x changes.
    d/dx[ 1 ] = 0

At x = 2 the derivative is 2·2/(4+1) = 4/5, and the calculator reports f'(x) = 0.8 (with f(x) = 1.609438). Notice what the steps reveal: the +1 inside the log contributed a step (the constant rule) and then contributed nothing. That is the chain rule working correctly, not a wasted line.

Why the steps are free

Many step-by-step solvers put the working behind a signup, or show you the first step and blur the rest until you subscribe. We think that gets the product exactly backwards. If you wanted only the answer, the back of your textbook already has it; the steps are the entire reason you came. Charging for them is charging for the part that teaches. So here the steps are the product: every rule, every substitution, every order you ask for, with no account and no meter running. If that earns us a bookmark before your next exam, that trade works fine for us.

Common derivatives at a glance

Ten derivatives that cover most homework. Every row below was computed by this calculator, so what you see here is exactly what it will show you:

f(x)f'(x)
x33x2
√(x)1/(2√(x))
1/x-1/x2
ln(x)1/x
exex
2x2x·ln(2)
sin(x)cos(x)
cos(x)-sin(x)
tan(x)sec(x)2
atan(x)1/(x2+1)

What this calculator does not do

An honest boundary line, so you do not waste time typing something it cannot handle. This tool differentiates explicit single-variable functions of x. It does not do implicit differentiation, so it cannot find dy/dx from an equation like x2 + y2 = 25; only x can appear in the function. It does not do partial derivatives, since there is no second variable to hold constant. And it does not integrate; for antiderivatives and definite integrals, our integral calculator runs the machinery in the other direction, steps included.

Within its lane it is thorough: first through third derivatives, all seventeen supported functions, chain rule nesting as deep as you like, and logarithmic differentiation when both the base and exponent contain x. If an expression generates more than 60 steps in one order, the list is trimmed with a note saying exactly how many small steps were folded in; the answer always includes all of them.

Where to go from here

A derivative is a slope, so if you are still building that intuition, the slope calculator shows the same idea for straight lines, where the slope never changes. The mean value theorem calculator connects the two: somewhere on any smooth curve, the instantaneous slope equals the average slope. Setting a derivative to zero to find maxima and minima often leaves you solving a quadratic, which is what the quadratic formula calculator is for. And when you are ready to go backwards from rates to totals, the integral calculator is the other half of calculus.

Frequently asked questions

What is a derivative in simple terms?

A derivative is the exact rate at which a function is changing at a single point, which is the same thing as the slope of its graph there. If f(x) is your position over time, f'(x) is your speed. That is the whole idea; everything else is technique for computing it.

How do I find the derivative of a function?

Break the function into pieces, apply the matching rule to each piece (power, product, quotient, or chain), then simplify. This calculator does exactly that and names each rule as it uses it, so you can follow the working line by line with your own function.

What is the derivative of x^2?

The derivative of x^2 is 2x, by the power rule: bring the exponent down in front, then lower the exponent by one. The same rule gives x^3 a derivative of 3x^2 and x^10 a derivative of 10x^9.

When do I use the chain rule?

Use the chain rule whenever one function sits inside another, like sin(x^2) or ln(x^2+1). Differentiate the outside function first, leave the inside alone, then multiply by the derivative of the inside. A forgotten chain rule is the single most common differentiation mistake.

Does this derivative calculator show steps for free?

Yes. Every step, every rule name, and the reasoning behind each one, with no account and no paywall. The steps are the entire point of the tool, not a premium upsell.

Can it find second and third derivatives?

Yes. Pick second or third derivative and the calculator differentiates again, showing a separate labeled group of steps for each order. The second derivative of sin(x), for example, comes out as -sin(x).

What is the derivative of x^x?

The derivative of x^x is x^x(ln(x)+1). No single rule applies because x sits in both the base and the exponent, so the calculator uses logarithmic differentiation: rewrite x^x as e^(x ln x), differentiate that with the chain rule, then rewrite back into power form.

Why does my answer look different from my textbook's?

Two derivatives can be algebraically equal but written differently; sec^2(x) and 1/cos^2(x) are the same function. This calculator simplifies conservatively so each step stays recognizable. To check that two forms agree, evaluate both at the same x value and compare the numbers.

Related calculators