Skip to content

Derivative Calculator with Step-by-Step Rules

Differentiate any function of x symbolically, with the rules used at each step.

Your details

E.g. x^2*sin(x), e^(3x), sqrt(x+1), |x|. 2x and 3sin(x) work. Angles in radians.

Derivative

Results update as you type

Derivative

2x·sin(x) + x²·cos(x)

Value at x = a
-9.8696044
Tangent line at x = a
y = −9.869604x + 31.006277

Step-by-step solution
  1. Function read as: f(x) = x²·sin(x)
  2. Product rule: d/dx [x²·sin(x)] = 2x·sin(x) + x²·cos(x)
  3. Power rule: d/dx [x²] = 2x
  4. Trigonometric rule: d/dx [sin(x)] = cos(x)
  5. f′(x) = 2x·sin(x) + x²·cos(x)
  6. Evaluate at x = a: f′(π) ≈ −9.8696044
  7. Tangent line: y = f(a) + f′(a)·(x − a) → y = −9.869604x + 31.006277

A derivative tells you how fast a function changes at each point: the slope of its graph, a velocity, a marginal cost. This derivative calculator differentiates a function of xx symbolically, so you get a formula rather than a single number, and it lists the rule applied at each stage — power, product, quotient and chain rules, plus the standard derivatives of exponentials, logarithms, trigonometric, inverse trigonometric and hyperbolic functions.

Type the function the way you would write it on paper: x^2*sin(x), e^(3x), ln(x^2+1) or (x^2+1)/(x-1). Implicit multiplication such as 2x or 3sin(x) is understood, and |x| works for the absolute value. The answer is simplified — constants are folded, factors of 0 and 1 disappear, like terms are combined and quotients are put over a common denominator when that is shorter — so it reads like a textbook answer.

You can also ask for the second or third derivative, evaluate the result at a point x=ax = a and read the equation of the tangent line there. That makes the tool useful for checking homework, preparing for an exam or verifying a hand calculation in physics, engineering or economics.

How to use this calculator

  1. Enter the function in the Function f(x) field. Use ^ for powers, * or nothing for multiplication, and brackets around function arguments: sin(2x), sqrt(x+1).
  2. Choose f′, f″ or f‴ for the first, second or third derivative.
  3. Optionally type a point in Evaluate at x = a — a number or a constant such as pi/4. Leave it empty if you only want the formula.
  4. Read the simplified derivative at the top. Open the steps to see which rule was applied to each part of the expression, outermost first.
  5. For the first derivative at a point, the calculator also gives the tangent line y=f(a)+f′(a)(x−a)y = f(a) + f'(a)(x - a).

All angles are in radians, log is the base-10 logarithm and ln the natural logarithm.

The formula

The derivative is defined as the limit of the difference quotient:

f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}

In practice nobody uses the limit for every function. A handful of rules covers almost everything:

Rule Formula
Power (xn)′=n xn−1(x^n)' = n\,x^{n-1}
Constant multiple (c f)′=c f′(c\,f)' = c\,f'
Sum (f+g)′=f′+g′(f + g)' = f' + g'
Product (fg)′=f′g+fg′(f g)' = f' g + f g'
Quotient (fg)′=f′g−fg′g2\left(\frac{f}{g}\right)' = \frac{f' g - f g'}{g^2}
Chain (f(g(x)))′=f′(g(x)) g′(x)\big(f(g(x))\big)' = f'(g(x))\,g'(x)

Combined with a short table — (ex)′=ex(e^x)' = e^x, (ln⁡x)′=1/x(\ln x)' = 1/x, (sin⁡x)′=cos⁡x(\sin x)' = \cos x, (cos⁡x)′=−sin⁡x(\cos x)' = -\sin x, (tan⁡x)′=1/cos⁡2x(\tan x)' = 1/\cos^2 x, (arctan⁡x)′=1/(1+x2)(\arctan x)' = 1/(1+x^2) — these rules let the calculator break any expression into pieces it knows. For a variable exponent such as xxx^x it uses logarithmic differentiation: (fg)′=fg (g′ln⁡f+gf′/f)(f^g)' = f^g\,(g' \ln f + g f'/f).

Worked example

Product rule. For f(x)=x2sin⁡xf(x) = x^2 \sin x, take u=x2u = x^2 and v=sin⁡xv = \sin x. Then u′=2xu' = 2x, v′=cos⁡xv' = \cos x and

f′(x)=2xsin⁡x+x2cos⁡xf'(x) = 2x\sin x + x^2\cos x

At x=πx = \pi: sin⁡π=0\sin\pi = 0 and cos⁡π=−1\cos\pi = -1, so f′(π)=−π2≈−9.8696044f'(\pi) = -\pi^2 \approx -9.8696044. Since f(π)=0f(\pi) = 0, the tangent line is y=−9.869604x+31.006277y = -9.869604x + 31.006277 — exactly what the calculator shows with its default input.

Chain rule. For e3xe^{3x} the inner function is 3x3x, whose derivative is 3, so (e3x)′=3e3x(e^{3x})' = 3e^{3x}, and the value at x=0x = 0 is 3.

Quotient rule. For x2+1x−1\frac{x^2+1}{x-1} the calculator returns x2−2x−1(x−1)2\frac{x^2 - 2x - 1}{(x-1)^2}.

Second derivative. For x3−2xx^3 - 2x: f′(x)=3x2−2f'(x) = 3x^2 - 2, f′′(x)=6xf''(x) = 6x and f′′(1.5)=9f''(1.5) = 9.

What the steps show

The steps follow the structure of your expression from the outside in. A line such as Product rule: d/dx [x²·sin(x)] = 2x·sin(x) + x²·cos(x) means the outermost operation is a product; the next lines differentiate each factor. Power rule + chain rule appears when a power has an inner function, as in (x2+1)3(x^2+1)^3, whose derivative is 6x(x2+1)26x(x^2+1)^2.

Very long expressions show the first ten rule applications and a count of the rest, so the list stays readable. The integral calculator performs the reverse operation, and the limit calculator uses these derivatives for L’Hôpital’s rule.

Where derivatives are used

  • Slopes and tangents: f′(a)f'(a) is the slope of the curve at x=ax = a; compare it with the average slope from the average rate of change calculator.
  • Optimisation: maxima and minima occur where f′(x)=0f'(x) = 0; the sign of f′′f'' tells which is which.
  • Physics: velocity is the derivative of position, acceleration the derivative of velocity.
  • Economics: marginal cost and marginal revenue are derivatives of the cost and revenue functions.

Frequently asked questions

How do I type powers, roots and exponentials?

Use ^ for powers (x^3, (x+1)^2), sqrt(x) or x^(1/2) for square roots, and e^(2x) or exp(2x) for exponentials. Fractional and negative exponents are allowed: x^(-1/2) is 1/√x.

Are angles in degrees or radians?

Radians. Calculus formulas such as (sin x)′ = cos x only hold in radians. If your angle is in degrees, multiply it by pi/180 first, e.g. sin(pi*x/180).

Why does my answer look different from the textbook?

Equivalent forms are common: 1/cos(x)² is sec²(x), and 2sin(x)·cos(x) equals sin(2x). Evaluate both versions at the same point with the x = a field and they will match.

Can it do implicit or partial derivatives?

Not directly: the calculator works with one variable, x. For a partial derivative treat the other variables as constants (type their numeric values). For implicit differentiation, differentiate both sides with respect to x and solve for dy/dx.

What is the derivative of |x|?

For x ≠ 0 it is x/|x|, which equals 1 for positive x and −1 for negative x. At x = 0 the graph has a corner and the derivative does not exist.

Sources

Last updated:

More Math calculators

People also use