Derivative Calculator

Type a function of x to get its derivative with every rule shown step by step. For example, the derivative of x2sin(3x) is 2x·sin(3x) + 3x2·cos(3x).

  • Free
  • No sign-up
  • Shows the working
  • Works on phones

Use x as the variable. Write powers with ^, like x^3 or e^(2x). Trig uses radians.

Try:
Derivative
d/dx[x2sin(3x)]
f′(x) = 2x·sin(3x) + 3x2·cos(3x)
f(1)
0.14112
Slope f′(1)
−2.687737
Tangent line at x = 1
y = −2.6877x + 2.8289
−5−4−3−2−112345−30−20−101020304050
f(x)f′(x)tangent line

Step by step

  1. Product rule: (uv)′ = u′v + uv′ with u = x2 and v = sin(3x).
  2. Power rule: bring the power down and subtract 1. d/dx[x2] = 2x2 − 1 = 2x
  3. Chain rule: sin(3x) is an outer function of u = 3x. By the trig rule, d/du[sin(u)] = cos(u), so multiply by u′.
  4. Constant multiple rule: keep the constant and differentiate the rest. d/dx[3x] = 3·d/dx[x] = 3
  5. Power rule: d/dx[x] = 1.
  6. Put the chain rule together: d/dx[sin(3x)] = 3cos(3x)
  7. Put the product rule together: d/dx[x2sin(3x)] = 2x·sin(3x) + x2·3cos(3x) = 2x·sin(3x) + 3x2·cos(3x)

How to use the derivative calculator

  1. Type your function using x, for example 3x^2 + sin(x), or tap the helper keys.
  2. Read the derivative f′(x) and the rules used at each step.
  3. Turn on Second derivative if you also need f″(x).
  4. Enter a value in At x = to get the slope and the tangent line at that point.

What is a derivative?

The derivative of a function tells you its instantaneous rate of change, which is the slope of the tangent line at each point. If f(x) gives the position of a car, f′(x) gives its speed. It is defined as a limit:

f′(x) = lim (h → 0) of [f(x + h) − f(x)] ÷ h

In practice you rarely use the limit. Instead you apply a small set of rules, which is exactly what this calculator does and shows. For the default example, the slope of x2sin(3x) at x = 1 is about -2.6877.

Derivative rules

RuleFunctionDerivative
Constantc0
Powerxnnxn−1
Constant multiplec·f(x)c·f′(x)
Sum and differencef ± gf′ ± g′
Productf·gf′g + fg′
Quotientf/gf′g − fg′/g2
Chainf(g(x))f′(g(x))·g′(x)
Sine and cosinesin x, cos xcos x, −sin x
Tangenttan xsec2 x
Exponentialex, axex, ax ln a
Logarithmln x, loga x1/x, 1/x ln a
Inverse trigsin−1 x, tan−1 x1/√(1 − x2), 1/1 + x2

Worked examples

Power rule: 4x3 − 5x2 + 7x − 2

Bring each power down and subtract 1 from it. The constant −2 has derivative 0. The result is 12x2 − 10x + 7.

Product rule: x3ln(x)

Let u = x³ and v = ln(x), so u′ = 3x² and v′ = 1/x. Then u′v + uv′ = 3x² ln(x) + x³ · 1/x, which simplifies to x2 + 3x2·ln(x).

Quotient rule: x2 + 1/x − 1

Let u = x² + 1 and v = x − 1, so u′ = 2x and v′ = 1. The quotient rule gives [2x(x − 1) − (x² + 1)] ÷ (x − 1)², which simplifies to x2 − 2x − 1/(x − 1)2.

Chain rule: √3x2 + 1

The outer function is √u with u = 3x² + 1. The derivative of √u is 1/(2√u), and u′ = 6x. Multiplying gives 3x/√3x2 + 1.

Common derivatives

f(x)f′(x)
x55x4
1/x−1/x2
√x1/2√x
sin(2x)2cos(2x)
cos(x2)−2x·sin(x2)
tan(x)sec2(x)
e−x−e−x
2x2x·ln(2)
ln(3x)1/x
log(x)1/x·ln(10)
tan−1(x)1/x2 + 1
xexex + x·ex

Common mistakes

  • Forgetting the chain rule. The derivative of sin(3x) is 3cos(3x), not cos(3x). Always multiply by the derivative of the inside.
  • Multiplying derivatives for a product. (fg)′ is f′g + fg′, not f′g′. For x² sin x, the answer is 2x sin x + x² cos x.
  • Mixing up the quotient rule order. The top is u′v − uv′. Swapping the terms flips the sign of the answer.
  • Using the power rule on eˣ. The power rule needs a constant power. eˣ has x in the power, so its derivative is eˣ, not x·eˣ⁻¹.
  • Working in degrees. Trig derivatives only work in radians.

To check a numerical answer, plug values into the scientific calculator. For straight lines, the slope calculator finds the slope between two points, and the quadratic formula calculator finds where f′(x) = 0 when the derivative is a quadratic.

Frequently asked questions

What is a derivative?

A derivative measures how fast a function is changing. The derivative f′(x) gives the slope of the tangent line to y = f(x) at each x. For example, the derivative of x² is 2x, so at x = 3 the curve y = x² is rising with slope 6.

How do I enter functions into the derivative calculator?

Use x as the variable and type the function the way you would write it: x^3 for x³, sqrt(x) for √x, e^(2x) for e²ˣ, and sin(x), ln(x) or arctan(x) for functions. Multiplication can be implied, so 3x^2 sin(x) works. Put exponents with more than one term in brackets, like e^(3x).

When do I use the product rule vs the chain rule?

Use the product rule when two functions of x are multiplied, like x² · sin(x). Use the chain rule when one function is inside another, like sin(x²), where x² sits inside sine. Many problems need both: x² sin(3x) uses the product rule, and differentiating sin(3x) inside it uses the chain rule.

Why is the derivative of a constant 0?

A constant never changes, so its rate of change is 0. The graph of y = 5 is a flat horizontal line with slope 0 everywhere. That is why the +5 in 3x² + 5 disappears when you differentiate.

What is the derivative of e^x and ln(x)?

The derivative of eˣ is eˣ, which makes it the only function (apart from multiples of it) that equals its own derivative. The derivative of ln(x) is 1/x for x > 0. With the chain rule, e^(3x) becomes 3e^(3x) and ln(x² + 1) becomes 2x/(x² + 1).

Does the calculator use degrees or radians for trig?

Radians. The rule d/dx[sin x] = cos x is only true when x is in radians, so calculus always uses radians. If you need trig values in degrees, use the scientific calculator in DEG mode.

How do I find the equation of a tangent line?

Find the slope m = f′(a), find the point (a, f(a)), then use y − f(a) = m(x − a). Type a value in the "At x =" box and the calculator gives f(a), the slope and the tangent line in y = mx + b form. The slope calculator can help you check a line through two points.

Last reviewed November 27, 2026 by the ChalkStation team.