acalculator

What is the derivative of a function?

Type a function such as (x^2 + 2)(3x^3 - 5x) to get its derivative. Add a point to get the slope of the tangent line there.

Your numbers

Use + - * / ^, sqrt, ln, sin, pi, e and one letter.
Derivative
15x^4 + 3x^2 - 10

The derivative of (x^2 + 2)(3x^3 - 5x) is 15x^4 + 3x^2 - 10.

Derivative: 15x^4 + 3x^2 - 10. The derivative of (x^2 + 2)(3x^3 - 5x) is 15x^4 + 3x^2 - 10.

How to calculate

Finds the derivative of a function and its value at a point, checked numerically.

Example with the default inputs (Function f(x) (x^2 + 2)(3x^3 - 5x)): The derivative of (x^2 + 2)(3x^3 - 5x) is 15x^4 + 3x^2 - 10.

Method: A computer algebra system differentiates f; the answer shows only when it matches a numeric difference quotient at 20 points.

  • One variable letter (x if none); radians; ln is the natural logarithm.
  • An answer that fails its check is not shown.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Function f(x) (x^2 + 2)(3x^3 - 5x) gives Derivative 15x^4 + 3x^2 - 10.Source: OpenStax Calculus Vol. 1, 3.3, Ex. 3.24. https://openstax.org/books/calculus-volume-1/pages/3-3-differentiation-rules
  2. Function f(x) x^2 - 4x + 6, Slope at (optional) 1 gives Derivative 2x - 4, Value at a -2.
  3. Function f(x) 6/x^2 gives Derivative -12/x^3.

How it works

The derivative calculator finds f′, the derivative of the function f you type, with respect to its variable. A computer algebra system (nerdamer, open source) applies the differentiation rules. The algebra runs after you start typing, in the background.

Every answer is checked before it is shown. At 20 points (fixed pseudo-random numbers, mostly between −4 and 4, some up to ±10), the slope of f is measured numerically with a five-point central difference, step h = 0.0001 × max(1, |x|), and compared with the derivative formula; they must agree to 1 part in a million. Points where f is not a real number are skipped, and so are points next to a corner or a jump, where the steps h and h/2 disagree. An answer that fails is never shown; the page says "No verified answer" instead.

Then the answer is put in a textbook form:

  • a derivative that is a polynomial is expanded: (x² + 2)(3x³ − 5x) gives 15x⁴ + 3x² − 10;
  • a derivative that is a rational function (a ratio of polynomials) is written as one simplified fraction when the algebra finds one: 5x²/(4x + 3) gives 10x (2x + 3)/(4x + 3)²;
  • anything else stays as the algebra gave it.

Each rewrite is its own checked step (equal to the first form at 20 points); if it fails, the first form is shown.

Value at a point. When you type a number a, the page evaluates the derivative formula at x = a. It shows the value only when it is a real number and a central difference of f at a, with h = 0.00001 × max(1, |a|), agrees with it to 1 part in 100,000. So a corner (|x| at 0), a vertical tangent (√x at 0) or a point outside the domain gives no value.

What you can type

  • One variable. Use one lowercase letter as the variable: x, t, y, and so on; the derivative is with respect to that letter. With no letter the function is a constant and its derivative is 0. Two different letters give no answer. The letter e is Euler’s number, and pi (or π) is π.
  • Numbers can have decimals (2.5) and powers of ten (1e-3).
  • Operations: + − * / and ^ for powers. Brackets group. A number or bracket next to a letter multiplies: 2x, (x + 1)(x − 1), x sin(x).
  • Functions: sqrt, cbrt, ln (and log, the same natural logarithm), log10, exp, abs (or |x|), sin, cos, tan, sec, csc, cot, asin, acos, atan (arcsin, arccos, arctan also work), sinh, cosh, tanh and their inverses. Angles are in radians. sin x means sin(x); sin x^2 means sin(x²).
  • The point a is a number or a constant expression: 1, −2.5, pi/4, e.

How answers are written

The derivative uses the syntax you type: ^ for powers, sqrt(u), |u| for absolute value, π for pi, ln for the natural logarithm, a space or a number before a letter for multiplication. Terms go by power of the variable, highest first, and factors of a product lowest degree first. The page shows it as MathML; Copy answer gives this text. An answer holding a number the algebra rounded (a fraction whose denominator, after removing factors 2 and 5, is over 1,000,000, or a decimal with more than 12 significant digits) is not shown. The value at a is a decimal to 10 significant figures.

Assumptions

  • Angles are in radians; ln and log are the natural logarithm.
  • The derivative formula may be defined at points where f is not, or the other way round; the value at a follows the rule above.
  • An answer that fails its check, finds no formula, or takes over 3 seconds is not shown ("No verified answer").

Worked examples by hand

j(x) = (x² + 2)(3x³ − 5x) (OpenStax Calculus Volume 1, section 3.3, Example 3.24). By the product rule, j′(x) = 2x(3x³ − 5x) + (x² + 2)(9x² − 5) = 6x⁴ − 10x² + 9x⁴ − 5x² + 18x² − 10 = 15x⁴ + 3x² − 10.

f(x) = x² − 4x + 6 at x = 1 (OpenStax Calculus Volume 1, section 3.3, Example 3.22). f′(x) = 2x − 4, so f′(1) = −2. With f(1) = 3, the tangent line is y = 3 − 2(x − 1) = −2x + 5.

f(x) = 6/x² (OpenStax Calculus Volume 1, section 3.3, Example 3.27). Write f(x) = 6x⁻²; the power rule gives f′(x) = −12x⁻³ = −12/x³.

Other questions people ask

What is a derivative?

The derivative f′(x) of a function is its rate of change: the slope of the tangent line to the graph at x. It is the limit of the difference quotient (f(x + h) − f(x))/h as h goes to 0. For f(x) = x², the derivative is 2x, so the slope of the parabola is 2 at x = 1 and −4 at x = −2.

Which rules does the calculator use?

The same rules as a calculus course: the power rule (xⁿ has derivative nxⁿ⁻¹), the sum and constant multiple rules, the product rule (fg)′ = f′g + fg′, the quotient rule (f/g)′ = (f′g − fg′)/g², the chain rule, and the derivatives of eˣ, ln x, and the trigonometric functions. The answer is then checked with numbers, not by the same rules.

How is the answer checked?

At 20 points, the page computes the slope of your function numerically, from values of f just left and right of each point, and compares it with the derivative formula. They must agree to 1 part in a million. If they do not, the page says "No verified answer" instead of showing the formula.

Why does my answer look different from the book’s?

The same derivative can be written in many ways. (20x² + 30x)/(4x + 3)² and 10x(2x + 3)/(4x + 3)² are equal for every x. The page expands a polynomial answer and writes a rational one as a single fraction, but a textbook may factor it differently.

What is the value at a point?

Type a number in "Slope at" to get f′(a), the slope of the tangent line at x = a. For f(x) = x² − 4x + 6 at a = 1 the slope is −2, so the tangent line is y = f(1) − 2(x − 1) = −2x + 5. If f has a corner or is not defined at a, such as |x| at 0, no value is shown.

How do I find a second derivative?

Differentiate the answer again: copy the derivative into the box. The second derivative of x³ is the derivative of 3x², which is 6x.