Skip to main content
math

Derivative Calculator

Differentiate sums of power terms such as 3x² + 5x − 7, term by term with the power rule.

By Christopher FloiedPublished Updated

A sum of terms a·x^n joined by + or −. Write powers with ^, as in 4x^3, x^-2 or x^(2/3), or as superscripts, as in 3x² or x⁻². Up to 20 terms and 200 characters.

Leave blank for the derivative alone, or enter a point for f(x₀), the slope f′(x₀) and the tangent line there.

Results

Derivative f′(x)

6x + 5

How to Use This Calculator

1

Enter your input values

Fill in all required input fields for the Derivative Calculator. Follow the units and input format printed next to each field. Where a unit selector is available, choose the units that match your data.

2

Review your inputs

Double-check that all values are correct and match the units or format shown for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.

3

Read the results

The Derivative Calculator computes the output in your browser and displays the results, with units clearly labeled, as soon as they are ready — no data sent to a server.

4

Explore parameter sensitivity

Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.

When to Use This Calculator

  • •Use the Derivative Calculator when you need a quick mathematical result without writing out all the steps manually, saving time on repetitive calculations.
  • •Use it to verify hand calculations on tests or assignments and catch arithmetic mistakes.
  • •Use it when teaching or explaining mathematical concepts to others, demonstrating how changing inputs affects the result.
  • •Use it to explore the behavior of mathematical functions across a range of inputs.

Related Calculators

About Derivative Calculator

The Derivative Calculator differentiates a sum of power terms such as 3x^2 + 5x - 7, 4x^(1/2) + 2x^-1 or 4x^3 - x, term by term with the power rule. Type the function of x with ^ for powers (whole-number superscripts such as 3x² or x⁻² also work): it combines like terms, drops terms that cancel, and writes f′(x) in descending powers of x. Enter an optional point x₀ to get the value f(x₀), the slope f′(x₀) and the equation of the tangent line there. Each term has the form a·xⁿ, where the coefficient a is a decimal number and the exponent n may be negative, a decimal or a fraction in parentheses such as x^(2/3). Products and quotients of terms (x*x, 1/x, 3x(x + 2)), powers of sums such as (x + 1)^2, anything that needs the chain rule, and trigonometric, exponential and logarithmic functions such as sin(x), e^x, 2^x and ln(x) are not supported: the calculator says so instead of guessing. Rewrite x*x as x^2 and 1/x as x^-1, and expand (x + 1)^2 to x^2 + 2x + 1 first. It takes up to 20 terms and 200 characters, with each |a| and |n| at most 1,000,000.

The Math Behind It

The derivative of a function f at a point x is the limit f′(x) = lim(h→0) [f(x + h) − f(x)] / h. When it exists, it is the instantaneous rate of change of f, and the slope of the tangent line to the graph at that point. The power rule gives the derivative of a single power term: if f(x) = a·xⁿ, then f′(x) = n·a·xⁿ⁻¹. A constant term (n = 0) has derivative 0, and a·x (n = 1) has derivative a. A sum of power terms is differentiated term by term because differentiation is linear: the derivative of f + g is f′ + g′ (the sum rule), and the derivative of c·f is c·f′ (the constant multiple rule). So for f(x) = 3x² + 5x − 7 the three terms give 6x, 5 and 0, and f′(x) = 6x + 5. Like terms are combined before differentiating, so 3x² + 2x² is treated as 5x², whose derivative is 10x, and terms that cancel, such as −x³ + x³, contribute nothing. For a whole-number exponent the rule follows from the binomial theorem: (x + h)ⁿ = xⁿ + n·xⁿ⁻¹·h + (terms in h² and higher powers of h), so [(x + h)ⁿ − xⁿ] / h tends to n·xⁿ⁻¹ as h → 0. For any real exponent and x > 0, writing xⁿ = e^(n·ln x) and differentiating gives the same result, n·xⁿ⁻¹. That is why the rule also covers x^(1/2) = √x, whose derivative is (1/2)x^(−1/2) = 1/(2√x), and x^−1 = 1/x, whose derivative is −x^−2 = −1/x². Where the result is defined depends on the exponents. A term with a whole-number exponent of 0 or more is defined for every x. A negative exponent divides by a power of x, so it is undefined at x = 0. For a non-integer exponent this calculator uses the usual real-valued convention xⁿ = e^(n·ln x) for x > 0, with 0ⁿ = 0 when n > 0, and treats such a term as undefined for x < 0, even an odd root such as x^(1/3), which does have a real value there. So when x₀ is negative and some exponent is not a whole number, or x₀ is 0 and some exponent in f or f′ is negative, it reports that f′ is undefined at this x. For example, x^(1/2) is 0 at x = 0, but its derivative 0.5x^-0.5 is not defined there: the graph has a vertical tangent. The tangent line at x₀ passes through the point (x₀, f(x₀)) with slope m = f′(x₀). In point-slope form it is y − f(x₀) = m(x − x₀), which the calculator writes in slope-intercept form y = m·x + b with b = f(x₀) − m·x₀. For 3x² + 5x − 7 at x₀ = 2, f(2) = 15 and f′(2) = 17, so b = 15 − 34 = −19 and the tangent line is y = 17x − 19. Near x₀ the tangent line is the best straight-line approximation to f, which is the idea behind linear approximation and Newton's method. Other functions need other rules. A product such as x·(x + 2) needs the product rule (or expanding first), a quotient needs the quotient rule, a composite such as (3x + 1)² needs the chain rule, and sin x, eˣ, aˣ and ln x have derivatives of their own (cos x, eˣ, aˣ·ln a and 1/x). This calculator applies none of them: it refuses such input with a message rather than return a wrong answer. Where a function can be rewritten as a sum of power terms, by expanding products and powers of sums, it can then be entered here. Coefficients in f′(x) and in the tangent line are shown to 10 significant digits, and an exponent that is not a short decimal is shown as a fraction, such as (-2/3). The value f(x₀) and the slope f′(x₀) are rounded to 6 decimal places, and shown in scientific notation from 1,000,000 up and below 0.001.

Formula Reference

Power rule

d/dx [a·xⁿ] = n·a·xⁿ⁻¹

Variables: a = coefficient, n = exponent (any real number), x = variable

Sum and constant rules

d/dx [f + g] = f′ + g′, d/dx [c] = 0

Variables: f, g = power terms, c = constant

Tangent line at x₀

y = m·x + b, m = f′(x₀), b = f(x₀) − m·x₀

Variables: x₀ = chosen point, m = slope there, b = y-intercept

Worked Examples

Example 1: A polynomial and its tangent line at x₀ = 2

Differentiate f(x) = 3x^2 + 5x - 7, then find the tangent line at x₀ = 2.

Step 1:Apply the power rule to each term: d/dx[3x^2] = 2·3x^1 = 6x, d/dx[5x] = 5 and d/dx[-7] = 0.
Step 2:Add the results: f′(x) = 6x + 5.
Step 3:Value at the point: f(2) = 3·4 + 5·2 − 7 = 15.
Step 4:Slope at the point: f′(2) = 6·2 + 5 = 17.
Step 5:Intercept: b = f(2) − f′(2)·2 = 15 − 34 = −19.

f′(x) = 6x + 5. At x₀ = 2, f(2) = 15, f′(2) = 17 and the tangent line is y = 17x − 19.

Example 2: A root and a reciprocal at x₀ = 4

Differentiate f(x) = 4x^(1/2) + 2x^-1, that is 4√x + 2/x, and find the slope and the tangent line at x₀ = 4.

Step 1:4x^(1/2): multiply by the exponent, 4 · 1/2 = 2, and lower it, 1/2 − 1 = −1/2, giving 2x^-0.5.
Step 2:2x^-1: multiply by −1 and lower the exponent to −2, giving −2x^-2.
Step 3:So f′(x) = 2x^-0.5 − 2x^-2, which is 1/√x − 2/x².
Step 4:Value: f(4) = 4·2 + 2/4 = 8.5.
Step 5:Slope: f′(4) = 2/2 − 2/16 = 1 − 0.125 = 0.875.
Step 6:Intercept: b = 8.5 − 0.875·4 = 5.

f′(x) = 2x^-0.5 − 2x^-2. At x₀ = 4 the slope is 0.875 and the tangent line is y = 0.875x + 5.

Example 3: Like terms and constants

Differentiate f(x) = 3x^2 + 2x^2 + 7, then the constant function f(x) = 7.

Step 1:Combine like terms first: 3x^2 + 2x^2 + 7 = 5x^2 + 7.
Step 2:d/dx[5x^2] = 10x, and the constant 7 has derivative 0.
Step 3:For f(x) = 7 alone every term vanishes, so the derivative is the zero function.

f′(x) = 10x for the first function, and f′(x) = 0 for the constant.

Example 4: Where the derivative does not exist

Differentiate f(x) = x^(1/2), the square root of x, and try the points x₀ = 0 and x₀ = −1.

Step 1:Power rule: f′(x) = (1/2)x^(1/2 − 1), which the calculator writes as 0.5x^-0.5, that is 1/(2√x).
Step 2:At x₀ = 0, f(0) = 0, but 0.5x^-0.5 divides by √0 = 0, so the slope is not defined: the graph has a vertical tangent there.
Step 3:At x₀ = −1, √x has no real value, so neither f nor f′ is defined.

f′(x) = 0.5x^-0.5. At x₀ = 0 or x₀ = −1 the calculator says: f′ is undefined at this x.

Common Mistakes & Tips

  • !Forgetting to lower the exponent after multiplying. The power rule needs both steps: multiply the coefficient by the exponent, then subtract 1 from the exponent, so d/dx[5x^4] = 20x^3.
  • !Mishandling negative exponents. Subtracting 1 makes a negative exponent more negative: d/dx[x^-2] = -2x^-3, not -2x^-1.
  • !Confusing the derivative of a constant with the derivative of x. The derivative of 7 is 0, because 7 = 7x^0, while the derivative of 5x is 5.
  • !Applying the power rule to 2^x or e^x. The power rule is for a variable base raised to a constant exponent (xⁿ). A constant base raised to x needs the exponential rule: d/dx[2^x] = 2^x·ln 2.
  • !Differentiating a power of a sum as if it were a power of x. By the chain rule d/dx[(3x + 1)^2] = 2(3x + 1)·3 = 18x + 6, not 2(3x + 1). Expanding first gives 9x^2 + 6x + 1, whose derivative is the same 18x + 6.
  • !Entering a product such as x*x or 3x(x + 2). Rewrite it as a sum of power terms first (x^2, or 3x^2 + 6x); the calculator refuses products rather than guess what was meant.

Related Concepts

Used in These Calculators

Calculators that build on or apply the concepts from this page:

Frequently Asked Questions

What can I enter?

A sum of power terms a·xⁿ in x, joined by + or −. A term can be a number (7), x with a coefficient (5x, 3*x, -x), or a power of x written with ^: 4x^3, 2x^-1, 1.5x^2.5 or x^(2/3), with a fraction exponent in parentheses. Spaces are ignored, and − is read as a minus sign. It takes up to 20 terms and 200 characters, with each coefficient and exponent between −1,000,000 and 1,000,000.

What doesn't it support?

Products and quotients of terms (x*x, x/2, 1/x), powers of sums such as (x + 1)^2, the chain rule, other variables, and trigonometric, exponential and logarithmic functions such as sin(x), e^x, 2^x and ln(x). For these it shows the message 'Supports sums of power terms a·xⁿ with numeric a and n' instead of an answer. Rewrite x/2 as 0.5x and 1/x as x^-1, and expand products and powers of sums first. For a product or a quotient of two power functions ax^m and bx^n, use the Product Rule or Quotient Rule Calculator, and for (ax + b)^n the Chain Rule Calculator.

What is the power rule for derivatives?

The power rule states that the derivative of a·xⁿ is n·a·xⁿ⁻¹: multiply the coefficient by the exponent, then reduce the exponent by one. It works for any real exponent, including fractions and negatives, wherever xⁿ is defined. A sum of power terms is differentiated by applying it to each term and adding the results, which is what this calculator does.

Does the power rule work for fractional and negative exponents?

Yes. The derivative of x^(1/2), the square root of x, is (1/2)x^(-1/2) = 1/(2√x), and the derivative of x^-1 = 1/x is -x^-2 = -1/x². Enter them as x^(1/2) or x^0.5 and as x^-1. The results are defined only where the terms are: not at x = 0 for a negative exponent and, under the convention this calculator uses, not for negative x when the exponent is not a whole number.

How does it find the tangent line?

Enter a point x₀. The calculator evaluates f(x₀) and the slope m = f′(x₀), then writes the line through (x₀, f(x₀)) with that slope as y = m·x + b, where b = f(x₀) − m·x₀. For 3x^2 + 5x - 7 at x₀ = 2 that is y = 17x − 19. With x₀ left blank it shows only the derivative.

Why does it say f′ is undefined at this x?

Because some term of f or f′ has no real value at your x₀: a negative exponent at x₀ = 0 (x^-1 = 1/x divides by zero), or, for x₀ below 0, an exponent that is not a whole number. The calculator takes xⁿ with a non-integer n to be defined only for x ≥ 0, so it also refuses odd roots such as x^(1/3) at negative x, although they have real values there. Choose another x₀.

What is the physical meaning of a derivative?

A derivative measures the instantaneous rate of change. In physics, if position is a function of time, the derivative gives velocity. If velocity is a function of time, the derivative gives acceleration. In economics, the derivative of a cost function gives marginal cost.

How precise are the results?

f′(x) is computed term by term with the power rule in double-precision arithmetic. Its coefficients, and the slope and intercept of the tangent line, are shown to 10 significant digits, and an exponent that is not a short decimal is shown as a fraction such as (-2/3). The value f(x₀) and the slope f′(x₀) are rounded to 6 decimal places, and shown in scientific notation from 1,000,000 up and below 0.001.

Add the live Derivative Calculator to your site. Free to embed, with a link back to MegaCalc.