AI Math Tutor

Blog · calculus

How to Do Derivatives: Rules, Examples and Checks

· AI Math Tutor Team

Learning how to do derivatives comes down to matching the shape of a function to the right rule: a single power of x, two functions multiplied together, one function divided by another, or a function nested inside another one. Once you can recognize which situation you are looking at, differentiating almost any function is a matter of applying one rule correctly and simplifying. This guide covers how to do derivatives using the six core rules, gives you a table to check your rule against, and works through four full examples, one for each of the trickier rules.

Key takeaways

What a derivative measures

A derivative tells you how fast a function's output is changing at a specific input value, not on average, but at that exact instant. If a function describes distance traveled over time, its derivative describes speed at each moment. Graphically, the derivative at a point is the slope of the line that just touches the curve at that point without crossing through it, called the tangent line.

Because a derivative is itself a rate, it is also a function: it can be evaluated at different x-values to see how the rate of change itself changes across the graph. A function's derivative being positive means the function is increasing at that point, negative means it is decreasing, and 0 means the function is momentarily flat.

The notation for a derivative varies depending on the textbook or course, but the common forms all mean the same thing. f′(x)f'(x), dydx\frac{dy}{dx}, and ddxf(x)\frac{d}{dx}f(x) all describe the derivative of a function with respect to x. Reading dydx\frac{dy}{dx} as "the rate of change of y as x changes" is often the most useful way to keep its meaning in mind while you work through a problem.

The derivative rules at a glance

Rule What it says Example
Power rule Bring the exponent down as a coefficient, then subtract 1 from the exponent ddxxn=nxn−1\frac{d}{dx}x^n = nx^{n-1}
Constant rule The derivative of a constant by itself is always 0 ddx(7)=0\frac{d}{dx}(7) = 0
Sum and difference rule Differentiate each term separately, then add or subtract the results ddx(x2+3x)=2x+3\frac{d}{dx}(x^2+3x) = 2x+3
Product rule First times derivative of second, plus second times derivative of first ddx(uv)=u′v+uv′\frac{d}{dx}(uv) = u'v + uv'
Quotient rule Bottom times derivative of top, minus top times derivative of bottom, over bottom squared ddx(uv)=u′v−uv′v2\frac{d}{dx}\left(\frac{u}{v}\right) = \frac{u'v-uv'}{v^2}
Chain rule Derivative of the outside function, times the derivative of the inside function ddxf(g(x))=f′(g(x))g′(x)\frac{d}{dx}f(g(x)) = f'(g(x))g'(x)

The power, constant, and sum rules

The power rule is the rule you will use most often: to differentiate xnx^n, bring the exponent n down in front as a coefficient, then subtract 1 from the exponent. The derivative of x5x^5 is 5x45x^4, and the derivative of xx itself, which is x1x^1, is 1⋅x0=11 \cdot x^0 = 1.

The constant rule says the derivative of any plain number, with no variable attached, is always 0, because a constant never changes as x changes. A constant multiplied by a variable term, like 5x35x^3, keeps the constant in place and applies the power rule to the variable part, giving 15x215x^2. This is sometimes split out as its own constant multiple rule, but it is really just the power rule with a constant carried along for the ride.

The sum and difference rule says you can differentiate a sum or difference of terms one term at a time. The derivative of x2+3x−7x^2 + 3x - 7 is the derivative of x2x^2, plus the derivative of 3x3x, minus the derivative of the constant 7, giving 2x+3−0=2x+32x + 3 - 0 = 2x + 3. This rule is what lets you differentiate a whole polynomial term by term instead of all at once, and it is also why the power rule alone is enough to differentiate any polynomial, no matter how many terms it has.

Together, these three rules cover every polynomial you will meet, from a single term like x2x^2 to a long expression with many terms added and subtracted. The remaining three rules, product, quotient, and chain, exist for the situations a polynomial alone cannot describe: functions multiplied together, functions divided by each other, and functions nested inside one another.

The product and quotient rules

When two functions are multiplied together, such as x2sin⁡xx^2 \sin x, the derivative of the product is not simply the product of the two derivatives. Instead, the product rule says: differentiate the first function and multiply by the second, then add the first function multiplied by the derivative of the second. Written with uu and vv standing for the two functions, ddx(uv)=u′v+uv′\frac{d}{dx}(uv) = u'v + uv'.

When one function is divided by another, such as xx+1\frac{x}{x+1}, the quotient rule applies: ddx(uv)=u′v−uv′v2\frac{d}{dx}\left(\frac{u}{v}\right) = \frac{u'v - uv'}{v^2}. The order of subtraction in the numerator matters, since u′v−uv′u'v - uv' and uv′−u′vuv' - u'v differ only by a sign, and getting that order backward is one of the most common quotient rule mistakes.

Not every fraction needs the quotient rule. If the denominator is just a plain number, like x24\frac{x^2}{4}, rewrite it as 14x2\frac{1}{4}x^2 and use the constant multiple rule and power rule instead; it is faster and there is nothing to get backward. The quotient rule earns its place only when the variable itself shows up in the denominator.

The chain rule

The chain rule handles a function nested inside another function, like (3x+1)5(3x+1)^5 or sin⁡(2x)\sin(2x). Differentiate the outside function first, treating the inside as a single unit, then multiply the result by the derivative of the inside function.

For (3x+1)5(3x+1)^5, the outside function is "something to the 5th power" and the inside is 3x+13x+1. Differentiating the outside gives 5(3x+1)45(3x+1)^4, and multiplying by the derivative of the inside, which is 3, gives 15(3x+1)415(3x+1)^4. The chain rule shows up constantly once functions start getting nested, which is most functions beyond the simplest polynomials.

A useful way to spot when the chain rule is needed is to ask whether you could evaluate the function in one step or two. Evaluating x2x^2 at a number takes one step: square it. Evaluating (3x+1)5(3x+1)^5 takes two steps: compute 3x+13x + 1 first, then raise that result to the 5th power. Whenever evaluating a function takes more than one step like that, the chain rule is what differentiates it correctly, and the product and quotient rules can combine with the chain rule when a nested function is also multiplied or divided by something else.

How to check a derivative you just found

Because a derivative describes a rate of change, you can check one without redoing the algebra by testing how much the original function actually changes over a small step. Pick a convenient x-value, calculate the function at that value and at a value slightly larger, such as 0.01 more, and find the difference between the two outputs. That difference should be close to your derivative, evaluated at the starting x-value, multiplied by the size of the step.

This estimate will not match exactly, since a derivative describes an instantaneous rate and a small step is still a small distance, but a close match is strong evidence the derivative is correct, and a wildly different result is a clear sign to recheck your work. Every worked example below uses exactly this kind of check.

Worked examples

Example 1: differentiate f(x)=x4f(x) = x^4 using the power rule

  1. Apply the power rule: bring the exponent 4 down as a coefficient, then subtract 1 from the exponent.
    f′(x)=4x4−1=4x3f'(x) = 4x^{4-1} = 4x^3

So f′(x)=4x3f'(x) = 4x^3. Check by estimating: increasing x from 1 to 1.01 changes x4x^4 from 1 to about 1.04061.0406, a change of about 0.04060.0406, which is close to f′(1)×0.01=4×0.01=0.04f'(1) \times 0.01 = 4 \times 0.01 = 0.04.

Example 2: differentiate f(x)=x2sin⁡xf(x) = x^2 \sin x using the product rule

  1. Identify the two functions being multiplied: u=x2u = x^2 and v=sin⁡xv = \sin x, so u′=2xu' = 2x and v′=cos⁡xv' = \cos x.
  2. Apply the product rule, u′v+uv′u'v + uv'.
    f′(x)=2xsin⁡x+x2cos⁡xf'(x) = 2x\sin x + x^2\cos x

So f′(x)=2xsin⁡x+x2cos⁡xf'(x) = 2x\sin x + x^2\cos x. Check at x=0x = 0: f′(0)=2(0)sin⁡0+02cos⁡0=0f'(0) = 2(0)\sin 0 + 0^2\cos 0 = 0. Since f(x)=x2sin⁡xf(x) = x^2\sin x behaves like x3x^3 very close to 0, its slope there is indeed 0, matching the check.

Example 3: differentiate f(x)=xx+1f(x) = \frac{x}{x+1} using the quotient rule

  1. Identify the top and bottom: u=xu = x, v=x+1v = x + 1, so u′=1u' = 1 and v′=1v' = 1.
  2. Apply the quotient rule, u′v−uv′v2\frac{u'v - uv'}{v^2}.
    f′(x)=(1)(x+1)−(x)(1)(x+1)2=x+1−x(x+1)2=1(x+1)2f'(x) = \frac{(1)(x+1) - (x)(1)}{(x+1)^2} = \frac{x+1-x}{(x+1)^2} = \frac{1}{(x+1)^2}

So f′(x)=1(x+1)2f'(x) = \frac{1}{(x+1)^2}. Check at x=1x = 1: f(1)=12f(1) = \frac{1}{2} and f(1.01)≈1.012.01≈0.5025f(1.01) \approx \frac{1.01}{2.01} \approx 0.5025, a change of about 0.00250.0025, close to f′(1)×0.01=14×0.01=0.0025f'(1) \times 0.01 = \frac{1}{4} \times 0.01 = 0.0025.

Example 4: differentiate f(x)=(3x+1)5f(x) = (3x+1)^5 using the chain rule

  1. Identify the outside function, something to the 5th power, and the inside function, 3x+13x + 1.
  2. Differentiate the outside function, leaving the inside alone, then multiply by the derivative of the inside.
    f′(x)=5(3x+1)4×3=15(3x+1)4f'(x) = 5(3x+1)^4 \times 3 = 15(3x+1)^4

So f′(x)=15(3x+1)4f'(x) = 15(3x+1)^4. Check at x=0x = 0: f(0)=15=1f(0) = 1^5 = 1 and f(0.01)=(1.03)5≈1.1593f(0.01) = (1.03)^5 \approx 1.1593, a change of about 0.15930.1593, close to f′(0)×0.01=15(1)4×0.01=0.15f'(0) \times 0.01 = 15(1)^4 \times 0.01 = 0.15.

Common mistakes

Some functions need a rule beyond these six. When the variable appears in both the base and the exponent, like xxx^x, none of the rules above apply directly, and Derivative of x to the x: Logarithmic Differentiation shows the technique that handles it. Reciprocal functions like 1t\frac{1}{t} have their own shortcut using negative exponents, covered in Derivative of 1/t and Other Reciprocals, Step by Step, and the trig derivatives beyond sine and cosine, including where the negative signs come from, are in Derivative of -sin x and the Other Trig Derivatives. For a method that applies to any kind of math problem, not only derivatives, see How to Solve Any Math Problem Step by Step. When you want a derivative checked line by line, scan the problem and read every step in AI Math Tutor.

AI Math Tutor is a study aid, not a substitute for a teacher, and it can make mistakes: check every step, not just the answer.

Questions

What does a derivative actually measure?

A derivative measures how fast a function's output changes as its input changes, at a single instant. Graphically, it is the slope of the line tangent to the function's curve at a given point.

How do you know which derivative rule to use?

Look at the structure of the function. A single power of x uses the power rule. Two functions multiplied together need the product rule. One function divided by another needs the quotient rule. A function nested inside another, like sin⁡(3x)\sin(3x), needs the chain rule.

Do you always need to use the quotient rule for a fraction?

Not always. If the denominator is just a number, you can pull it out as a constant multiple and use the power rule instead. The quotient rule is needed when the variable appears in the denominator itself.

How can you check a derivative without redoing the whole problem?

Pick a point, estimate how much the original function changes over a very small step from that point, and compare that change to what your derivative predicts for the same small step. If the two are close, your derivative is almost certainly correct.

Is the derivative of a constant always 0?

Yes. A constant does not change as x changes, so its rate of change, and therefore its derivative, is always 0.

Read next