Derivative Calculator
Differentiate f(x) to get f′(x) (and optionally f″(x)), evaluate the derivative at a specific point to find an instantaneous slope, or build the full tangent line equation at a point — with a distinct visual for every mode and full step-by-step rule application.
Background
The derivative f′(x) measures the instantaneous rate of change of f(x) — equivalently, the slope of the line tangent to the curve at each point. This calculator applies the standard differentiation rules (power, sum/difference, product, quotient, and chain) to build f′(x) symbolically, then simplifies the result. Evaluating f′(x) at a specific x = a gives the exact slope at that one point, which is also exactly the slope needed to write the equation of the tangent line there.
How to use this calculator
- Pick a mode: differentiate f(x) directly, evaluate the derivative at a specific point, or find the tangent line equation there.
- Type your function using ^ for powers and standard function names. Implicit multiplication is supported.
- For the last two modes, enter the point x = a where you want the slope or tangent line.
- Click Differentiate to see the result, the matching visual, and the full step-by-step rule application.
How this calculator works
Your function is parsed into an expression tree, then differentiated by structurally applying the sum, product, quotient, power, and chain rules based on each operation it finds — the same process you'd do by hand, just applied automatically and consistently.
The raw result is then simplified: constant coefficients are combined, terms like x·0 or x+0 are removed, and clean identities like ln(e) = 1 or sin(0) = 0 are folded in — without ever turning symbolic constants like π or e into decimals.
Evaluating f′(a) simply substitutes a into the already-differentiated formula — it's ordinary substitution, not a new rule.
The tangent line at x = a always has the form y = f(a) + f′(a)·(x−a): the point (a, f(a)) it must pass through, and the slope f′(a) it must match.
Near x = a, the tangent line is the best possible straight-line approximation of the curve — the further you move from a, the more the line and the curve tend to separate.
Formulas & Equations Used
Power rule: d/dx(x^n) = n·x^(n−1)
Sum/Difference: (u ± v)′ = u′ ± v′
Product rule: (uv)′ = u′v + uv′
Quotient rule: (u/v)′ = (u′v − uv′)/v²
Chain rule: (g(h(x)))′ = g′(h(x))·h′(x)
Common derivatives: (sin x)′=cos x, (cos x)′=−sin x, (ln x)′=1/x, (e^x)′=e^x, (a^x)′=a^x·ln(a)
Tangent line: y = f(a) + f′(a)·(x − a)
Example Problems & Step-by-Step Solutions
Example 1 — Chain rule
Differentiate f(x) = sin(3x²).
Step: Outer sin(u), inner u=3x², u′=6x. f′(x)=cos(u)·u′.
Result: f′(x) = 6x·cos(3x²).
Example 2 — Quotient rule
Differentiate f(x) = (x²+1)/(x−3).
Step: u=x²+1, v=x−3, u′=2x, v′=1. Apply (u′v−uv′)/v².
Result: f′(x) = (2x(x−3) − x² − 1)/(x−3)².
Example 3 — Slope at a point
If f(x) = x³ − 3x, find f′(1).
Step: f′(x) = 3x² − 3. f′(1) = 3(1) − 3.
Result: f′(1) = 0 — the tangent line is perfectly flat there.
Example 4 — Tangent line
Find the tangent line to f(x) = x² at x = 2.
Step: f(2)=4, f′(x)=2x so f′(2)=4. y = 4 + 4(x−2).
Result: y = 4x − 4.
Example 5 — A famous small-angle result
Find the tangent line to f(x) = sin(x) at x = 0.
Step: f(0)=0, f′(x)=cos(x) so f′(0)=1. y = 0 + 1(x−0).
Result: y = x — this is exactly why sin(x) ≈ x for small x.
Example 6 — General exponent rule
Differentiate f(x) = x^x.
Step: Both the base and exponent depend on x, so f′(x) = x^x·(ln(x) + 1).
Result: f′(x) = x^x·(ln(x) + 1).
Frequently Asked Questions
Why does f′(x) sometimes look more complicated than f(x)?
Product, quotient, and chain rules all introduce extra terms. Simplifying combines what can be combined, but for some functions the honest derivative is genuinely more complex than the original.
What does f′(a) actually tell me?
It's the exact slope of the curve at that single point — positive means the function is increasing there, negative means decreasing, and exactly 0 means the tangent line is flat (often, but not always, a peak or valley).
Why is the tangent line only a good approximation "near" the point?
The tangent line matches f(x)'s value and slope at x = a exactly, but has no way to match how the curve bends. The further you move from a, the more that curvature causes the line and the curve to drift apart.
Does this calculator do implicit differentiation?
No — it focuses on explicit functions f(x), which covers the large majority of introductory differentiation problems and keeps every output predictable.
Why does x^x need a different rule than x^n or a^x?
The power rule assumes a constant exponent, and the exponential rule assumes a constant base. When both the base and the exponent depend on x, neither rule alone applies, so a more general formula is needed instead.
Why might the graph have gaps?
If f(x) is undefined at some x-values — division by zero, or ln(x) for x ≤ 0, for example — the plotted line breaks at that spot instead of connecting across it, since the function (and its slope) genuinely doesn't exist there.