Skip to content

Derivative Calculator

Differentiate any function step by step: first, second and higher derivatives, the rules used, the value and slope at a point, the tangent line and a graph.

Calculator Details

f′(x):…See results ↓

Use + − * / ^ and brackets; sin, cos, tan, sec, asin…, sinh…, sqrt, exp, ln (natural log), log (base 10), abs, pi, e. 2x means 2·x

Other letters are treated as constants (a partial derivative)

1 for f′, 2 for f″, up to 5

Value, slope and tangent line here (trig in radians)

Your Results

f′(x): …

f′(x)

…

Loading the symbolic engine…

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Detailed Breakdown

How This Calculator Works

How it's calculated

The derivative f′(a) is the slope of f at a: the limit of (f(a + h) − f(a)) ÷ h as h shrinks to 0. Rather than taking limits, the calculator applies the differentiation rules to the formula, term by term: the power rule d/dx xⁿ = nxⁿ⁻¹, the sum and constant multiple rules, the product rule (uv)′ = u′v + uv′, the quotient rule (u/v)′ = (u′v − uv′)/v², the chain rule f(g(x))′ = f′(g(x))·g′(x), and the derivatives of sin, cos, eˣ, ln x and the other functions. The result is then simplified. The tangent line at a is y = f′(a)(x − a) + f(a).

Frequently Asked Questions

What is a derivative?

The derivative f′(x) measures how fast f(x) changes as x changes: the slope of the graph at each point. It is defined as the limit of (f(x + h) − f(x)) ÷ h as h approaches 0. If f gives position over time, f′ is velocity and f″ is acceleration.

How do I type functions?

Use x as the variable with + − * / ^ and brackets: x^3 - 2x + 1, sin(x)^2, e^(2x), sqrt(x^2 + 1), ln(x). Multiplication can be implied (2x, 3sin(x)). log(x) is the base-10 logarithm and ln(x) the natural one, as on a calculator; log(x, 2) is base 2. Trigonometric functions use radians.

What is the difference between ln and log?

ln x is the natural logarithm (base e), with derivative 1/x. log x here means the common logarithm (base 10), with derivative 1/(x ln 10) ≈ 0.4343/x. Many calculus textbooks write log for the natural logarithm; if yours does, type ln.

How do I find the second derivative?

Set the order to 2. The calculator differentiates twice and lists f′ and f″. The second derivative tells you about curvature: where f″ > 0 the graph is concave up (like a cup), where f″ < 0 it is concave down, and at a critical point it tells you whether you have a minimum or a maximum.

What is the tangent line?

The straight line that touches the curve at x = a with the same slope: y = f′(a)(x − a) + f(a). For f(x) = x³ at a = 2, f(2) = 8 and f′(2) = 12, so the tangent is y = 12x − 16. Close to a, the tangent is the best straight-line approximation of the function.

Can it do partial derivatives?

Yes, for one variable at a time. Choose the variable to differentiate with respect to; every other letter is treated as a constant. ∂/∂x of a·x² + y·x is 2ax + y. Values at a point need numbers for those constants, so the calculator shows the formula only.

Why does my answer look different from the textbook?

The same derivative can be written many ways: 2·sin(x)·cos(x) and sin(2x) are equal, and so are (x² − 2x − 1)/(x − 1)² and longer quotient-rule forms. Check by comparing the value at a point: if both forms give the same number at a couple of points, they are almost certainly the same function.

Which rules does the calculator use?

The standard ones from a first calculus course: constant, power, sum, constant multiple, product, quotient and chain rules, plus the derivatives of exponential, logarithmic, trigonometric, inverse trigonometric, hyperbolic and root functions. It lists the rules that apply to your function under the answer.

Derivatives are found symbolically with the mathjs derivative and simplify functions and evaluated in double precision (results rounded to 12 significant figures); trig is in radians; log means base 10 and ln the natural log. Up to the 5th derivative. Not included: step-by-step working for each rule, implicit differentiation, derivatives of piecewise functions, limits, integrals, and functions of complex numbers. The simplified form may differ from a textbook's while being equal.

Derivative Calculator: Derivatives, Rules Used, Tangent Lines and Graphs

By FindMySum · Last reviewed

A derivative calculator finds the derivative of a function: a formula for its rate of change, or the slope of its graph at every point. This one differentiates symbolically, so you get an exact formula rather than a decimal estimate, then evaluates it at a point, gives the tangent line there, lists the rules it used and draws the function and its derivative together. It handles higher derivatives up to the fifth and partial derivatives in one variable. The worked example below uses the calculator's opening function, f(x) = x²·sin(x), at x = 1.

What a derivative measures

The average rate of change of f between x and x + h is the slope of the line through those two points, (f(x + h) − f(x)) ÷ h. As h shrinks towards 0, that secant line turns into the tangent line, and its slope becomes the derivative:

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

If f(t) is the distance a car has travelled after t hours, f′(t) is its speed at time t. Working out limits for every function would be slow, so in practice derivatives are found with a short list of rules.

The differentiation rules

  • Constant rule: the derivative of a constant is 0.
  • Power rule: d/dx xⁿ = n·xⁿ⁻¹, for any real n. So x³ → 3x², √x = x^½ → ½x^(−½), 1/x = x⁻¹ → −x⁻².
  • Constant multiple and sum rules: constants come along for the ride, and you differentiate a sum term by term: (3x² + 5x)′ = 6x + 5.
  • Product rule: (u·v)′ = u′·v + u·v′.
  • Quotient rule: (u/v)′ = (u′·v − u·v′) ÷ v².
  • Chain rule: for a function inside another, (f(g(x)))′ = f′(g(x))·g′(x). For sin(x²) the outer derivative is cos(x²), times the inner derivative 2x.
  • Standard functions: (sin x)′ = cos x, (cos x)′ = −sin x, (tan x)′ = sec²x, (eˣ)′ = eˣ, (ln x)′ = 1/x, and so on.

The calculator applies these rules automatically and lists the ones your function needs under the answer.

Worked example: x²·sin(x)

The function is a product of u = x² and v = sin x, so it needs the product rule, with the power rule for u and the trigonometric rule for v:

u′ = 2x, v′ = cos x

f′(x) = u′v + uv′ = 2x·sin(x) + x²·cos(x)

At x = 1 (in radians):

  • f(1) = 1² × sin 1 = 0.84147
  • f′(1) = 2 sin 1 + cos 1 = 1.68294 + 0.54030 = 2.22324

So the graph rises with a slope of about 2.22 at x = 1. The tangent line there is y = f′(1)(x − 1) + f(1) = 2.22324(x − 1) + 0.84147, or y = 2.22324x − 1.38177. These are the values the calculator shows by default.

Higher derivatives

Differentiating again gives the second derivative f″, then f‴ and so on. The second derivative describes curvature: where f″ > 0 the graph bends upward, where f″ < 0 it bends downward. In motion problems, if f is position, f′ is velocity and f″ acceleration. Set the order to 2 for f″; the table lists every derivative from f′ up to the order you chose.

For example, f(x) = x⁴ has f′ = 4x³, f″ = 12x², f‴ = 24x, f⁽⁴⁾ = 24 and f⁽⁵⁾ = 0: each derivative of a polynomial lowers the degree by one until nothing is left.

Partial derivatives

For a function of several variables, a partial derivative differentiates with respect to one of them while holding the others fixed. Choose the variable to differentiate with respect to: every other letter is treated as a constant. ∂/∂x of a·x² + b·x is 2a·x + b. Since those letters have no values, the calculator gives the formula but no number at the point.

Notation and conventions

Type functions the way you would on a scientific calculator: x^2 for x², sqrt(x), e^x or exp(x), and 2x or 3sin(x) for multiplication. Two conventions matter:

  • log and ln. log(x) is the base-10 logarithm and ln(x) the natural logarithm, as on calculators. Many calculus books write log for the natural log; if yours does, type ln. The derivatives differ: (ln x)′ = 1/x, while (log₁₀ x)′ = 1/(x·ln 10).
  • Radians. Trigonometric functions use radians, because the rule (sin x)′ = cos x is only true in radians.

The simplified answer may look different from a textbook's and still be equal: 2 sin x cos x and sin 2x are the same function. Comparing values at a point is a quick check.

Limits of the calculator

It differentiates explicit formulas in one variable at a time. It doesn't do implicit differentiation (like x² + y² = 25), piecewise functions, step-by-step working for each rule, or integrals. To see how a derivative relates to the average rate of change over an interval, try the average rate of change calculator.

More questions

What is the derivative of a constant?

Zero. A constant doesn't change as x changes, so its graph is a horizontal line with slope 0. That is also why adding a constant to a function doesn't change its derivative: x² + 5 and x² − 3 both have derivative 2x.

How are derivatives used outside maths class?

Anywhere a rate of change matters. In physics, velocity is the derivative of position and acceleration the derivative of velocity. In economics, marginal cost is the derivative of total cost with respect to quantity. Engineers and data scientists set derivatives to zero to find the best design or the lowest error.

Can a function have no derivative at a point?

Yes. |x| has a sharp corner at 0, so its slope jumps from −1 to 1 and there is no single tangent. Functions also fail to be differentiable where they are undefined or jump, and where the tangent is vertical, such as the cube root at 0. The calculator shows a dash when the derivative isn't defined at your point.

What does the sign of the derivative tell me?

Where f′(x) > 0 the function is increasing, where f′(x) < 0 it is decreasing, and where f′(x) = 0 it has a horizontal tangent: a local maximum, a local minimum or a flat inflection. The graph under the calculator shows f and f′ together, so you can see the slope change sign at the peaks and troughs.

What is the derivative of e^x and why is it special?

e^x is its own derivative: d/dx e^x = e^x. It is the only function (up to a constant multiple) with that property, which is why e appears in growth, decay and compound interest. For another base, d/dx a^x = a^x·ln a.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy