Derivative Calculator (with steps)
Type a function and see its derivative with every rule written out: product, quotient, chain, trig, exponential and log. Get the second or nth derivative, partial derivatives, the slope at any point, the tangent line and a graph.
Type x^2 for x², sqrt(x) for √x, e^x, ln(x) and sin(x). You can leave out × (2x, x sin x). log(x) is base 10.
Gives the slope there and the tangent line. Fractions and π work.
Other letters are held fixed (a partial derivative).
How your derivative is worked out
Your function, step by step: read it, pick the rule, apply it, then find the slope at your point.
- 1
Read your function
f(x) = x²·sin(x)is a productu = x², v = sin(x)
- 2
Product rule
(uv)′ = u′v + uv′(x²)′ = 2x(sin(x))′ = cos(x)
- 3
Apply and tidy up
f′(x) = 2x·sin(x)+ x²·cos(x)
- 4
Slope at x = π
f′(π) = −π²≈ −9.8696y = π³ − π²·x
Read more: the rules, the formula, a worked example and tangent lines
The derivative of a function measures how fast it changes: the slope of its graph at each point. It is written f′(x), dy/dx or d/dx f(x). The calculator breaks your function into pieces, picks the rule for each piece, differentiates the pieces and tidies the result. Partial derivatives do the same for one letter while the others stay fixed.
The formula
derivative f′(x) = limit as h → 0 of (f(x + h) − f(x)) ÷ h
power rule: d/dx xⁿ = n·xⁿ⁻¹
product rule: (u·v)′ = u′·v + u·v′
quotient rule: (u ÷ v)′ = (u′·v − u·v′) ÷ v²
chain rule: d/dx f(g(x)) = f′(g(x)) × g′(x)
tangent line at x = a: y = f(a) + f′(a) × (x − a)
Worked example
Differentiate f(x) = x²·sin(x) and find the tangent line at x = π. It is a product, so use the product rule with u = x² and v = sin(x). The power rule gives u′ = 2x and the trig rule gives v′ = cos(x). So f′(x) = u′·v + u·v′ = 2x·sin(x) + x²·cos(x). At x = π: sin(π) = 0 and cos(π) = −1, so f′(π) = 2π × 0 + π² × (−1) = −π² ≈ −9.8696. The point on the curve is f(π) = π² × 0 = 0. The tangent line is y = 0 + (−π²)(x − π) = −π²x + π³, which is about y = −9.8696x + 31.0063. The slope is negative, so the curve is falling at x = π.
The rules, with examples
| Rule | Formula | Example |
|---|---|---|
| Constant | d/dx c = 0 | d/dx 7 = 0 |
| Power | d/dx xⁿ = n·xⁿ⁻¹ | d/dx x⁵ = 5x⁴, d/dx √x = 1/(2√x) |
| Constant multiple | (c·u)′ = c·u′ | d/dx 3x² = 6x |
| Sum | (u + v)′ = u′ + v′ | d/dx (x³ + x) = 3x² + 1 |
| Product | (u·v)′ = u′v + uv′ | d/dx x·eˣ = eˣ + x·eˣ |
| Quotient | (u/v)′ = (u′v − uv′)/v² | d/dx sin(x)/x = (x·cos(x) − sin(x))/x² |
| Chain | f(g(x))′ = f′(g(x))·g′(x) | d/dx (x² + 1)⁵ = 10x(x² + 1)⁴ |
| Exponential | d/dx eˣ = eˣ, d/dx aˣ = aˣ·ln(a) | d/dx 2ˣ = 2ˣ·ln(2) |
| Logarithm | d/dx ln(x) = 1/x | d/dx log₁₀(x) = 1/(x·ln 10) |
| Trig | sin → cos, cos → −sin, tan → sec² | d/dx tan(3x) = 3sec²(3x) |
| Inverse trig | d/dx atan(x) = 1/(1 + x²) | d/dx asin(x) = 1/√(1 − x²) |
| Logarithmic differentiation | (uʷ)′ = uʷ·(w′·ln u + w·u′/u) | d/dx xˣ = xˣ·(ln(x) + 1) |
Higher and partial derivatives
The second derivative f″(x) is the derivative of f′(x). It tells you how the slope itself changes: positive means the curve bends upwards (concave up), negative means it bends downwards. For x²·sin(x), f″(x) = 2sin(x) + 4x·cos(x) − x²·sin(x). For a function of several letters, a partial derivative treats every other letter as a constant: ∂/∂x (x²y³) = 2xy³ and ∂/∂y (x²y³) = 3x²y². A mixed partial differentiates by one letter and then the other: ∂²/∂y∂x (x²y³) = 6xy².
Typing a function
- Powers: x^2 or x². Roots: sqrt(x), cbrt(x). Fractions: (x+1)/(x−1).
- e^x or exp(x) for the exponential, ln(x) for the natural log, log(x) for base 10.
- sin, cos, tan, sec, csc, cot, asin (or arcsin), acos, atan, sinh, cosh, tanh, and |x| or abs(x).
- sin^2(x) means (sin x)², and sin x without brackets is fine. 2x and x sin(x) mean multiply.
Trig functions use radians, as in every calculus course. Results are worked out with exact rules; decimals are rounded to the places you choose.
Common questions
What is a derivative?
A derivative tells you how fast a function is changing at each point: the slope of its graph. If f(x) = x², the derivative is f′(x) = 2x, so at x = 3 the curve is climbing 6 units up for every 1 unit across. A positive derivative means the graph is rising, a negative one means it is falling, and 0 means it is flat for a moment.
How do you use the product rule?
For a product u·v, the derivative is u′·v + u·v′: differentiate the first part and keep the second, then keep the first and differentiate the second, and add. For x²·sin(x), u = x² gives u′ = 2x and v = sin(x) gives v′ = cos(x), so the derivative is 2x·sin(x) + x²·cos(x).
What is the chain rule?
Use the chain rule when one function sits inside another. Differentiate the outside function, leave the inside alone, then multiply by the derivative of the inside. For sin(3x + 1), the outside sin becomes cos(3x + 1) and the inside 3x + 1 has derivative 3, so the answer is 3cos(3x + 1).
How do you find the equation of a tangent line?
Work out the derivative, put your x value a into it to get the slope m, and find the point (a, f(a)) on the curve. Then the tangent line is y = f(a) + m(x − a). For f(x) = x²·sin(x) at x = π, f(π) = 0 and the slope is −π², so the tangent is y = −π²x + π³.
What is a partial derivative?
When a function has more than one letter, like x²y³, a partial derivative changes only one of them and treats the others as fixed numbers. With respect to x, y³ is just a constant, so ∂/∂x (x²y³) = 2x·y³. With respect to y it is 3x²·y². Pick the letter in Advanced.
Why do trig derivatives need radians?
The rules d/dx sin(x) = cos(x) and d/dx cos(x) = −sin(x) are only true when x is measured in radians. In degrees every trig derivative picks up an extra factor of π/180. That is why this calculator, like every calculus textbook, treats x as radians: type π/4 rather than 45 for a 45° angle.
Related calculators
Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.