Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Calculus

Derivative Rules Explained with Worked Examples

By MathSolver Pro Editorial Team · Published

Computing derivatives from the limit definition is slow. A small set of rules, each proved once from that definition, lets you differentiate almost any formula in a few lines. This guide explains each rule, why it works and how to combine them.

Why rules instead of limits

The derivative is defined as a limit, f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0}\frac{f(x + h) - f(x)}{h}, and the article what is a derivative works through that definition for simple functions. Doing so for every problem would be painful. Instead, mathematicians proved general rules once, and those rules now handle polynomials, roots, exponentials, logarithms, trigonometric functions and any combination of them.

Think of the rules in two groups: derivatives of the basic building blocks, and rules for combining blocks through sums, products, quotients and compositions.

The basic rules: constants, powers and sums

ddxc=0,ddxxn=nxn−1,ddx[cf(x)]=cf′(x),ddx[f+g]=f′+g′\frac{d}{dx}c = 0, \qquad \frac{d}{dx}x^n = nx^{n-1}, \qquad \frac{d}{dx}\big[c f(x)\big] = c f'(x), \qquad \frac{d}{dx}\big[f + g\big] = f' + g'

A constant never changes, so its rate of change is zero. The power rule works for any real exponent nn, not just positive whole numbers, which makes it far more useful than it first appears. Constant multiples pass straight through, and the derivative of a sum is the sum of the derivatives.

Example 1: a polynomial

  1. Differentiate 5x4−3x2+7x−25x^4 - 3x^2 + 7x - 2 term by term.
  2. 5⋅4x3−3⋅2x+7−0=20x3−6x+75 \cdot 4x^3 - 3 \cdot 2x + 7 - 0 = 20x^3 - 6x + 7.

Example 2: roots and reciprocals

  1. Rewrite as powers first: 4x3=4x−3\frac{4}{x^3} = 4x^{-3} and 6x=6x1/26\sqrt{x} = 6x^{1/2}.
  2. ddx4x−3=−12x−4=−12x4\frac{d}{dx}4x^{-3} = -12x^{-4} = -\frac{12}{x^4}.
  3. ddx6x1/2=3x−1/2=3x\frac{d}{dx}6x^{1/2} = 3x^{-1/2} = \frac{3}{\sqrt{x}}.

Rewrite roots and fractions with xx in the denominator as powers before differentiating. Most power rule errors come from skipping this step.

Exponential, logarithmic and trigonometric functions

These derivatives are worth memorising, because every larger problem is built from them:

ddxex=ex,ddxax=axln⁡a,ddxln⁡x=1x,ddxlog⁡ax=1xln⁡a\frac{d}{dx}e^x = e^x, \qquad \frac{d}{dx}a^x = a^x\ln a, \qquad \frac{d}{dx}\ln x = \frac{1}{x}, \qquad \frac{d}{dx}\log_a x = \frac{1}{x\ln a}
ddxsin⁡x=cos⁡x,ddxcos⁡x=−sin⁡x,ddxtan⁡x=sec⁡2x\frac{d}{dx}\sin x = \cos x, \quad \frac{d}{dx}\cos x = -\sin x, \quad \frac{d}{dx}\tan x = \sec^2 x

The function exe^x is its own derivative, which is why ee appears throughout calculus. The trigonometric rules require the angle in radians; in degrees, an extra factor of π180\frac{\pi}{180} appears. The remaining trig derivatives are ddxsec⁡x=sec⁡xtan⁡x\frac{d}{dx}\sec x = \sec x\tan x, ddxcsc⁡x=−csc⁡xcot⁡x\frac{d}{dx}\csc x = -\csc x\cot x and ddxcot⁡x=−csc⁡2x\frac{d}{dx}\cot x = -\csc^2 x, all of which follow from the quotient rule below.

The product rule

ddx[f(x)g(x)]=f′(x)g(x)+f(x)g′(x)\frac{d}{dx}\big[f(x)g(x)\big] = f'(x)g(x) + f(x)g'(x)

The derivative of a product is not the product of the derivatives. To see why, picture a rectangle with sides ff and gg. When both sides grow slightly, the area gains a strip of size f′⋅gf' \cdot g along one side and a strip of size f⋅g′f \cdot g' along the other, plus a tiny corner that vanishes in the limit.

Example 3: y=x2sin⁡xy = x^2\sin x

  1. Let f=x2f = x^2 and g=sin⁡xg = \sin x, so f′=2xf' = 2x and g′=cos⁡xg' = \cos x.
  2. y′=2xsin⁡x+x2cos⁡xy' = 2x\sin x + x^2\cos x.
  3. At x=πx = \pi: y′=2π⋅0+π2(−1)=−π2y' = 2\pi \cdot 0 + \pi^2(-1) = -\pi^2.

The quotient rule

ddx[f(x)g(x)]=f′(x)g(x)−f(x)g′(x)g(x)2\frac{d}{dx}\left[\frac{f(x)}{g(x)}\right] = \frac{f'(x)g(x) - f(x)g'(x)}{g(x)^2}

Order matters here because of the subtraction. A common memory aid is low d-high minus high d-low, over low squared, where high is the numerator and low the denominator.

Example 4: y=x2+1x−1y = \frac{x^2 + 1}{x - 1}

  1. f=x2+1f = x^2 + 1, f′=2xf' = 2x; g=x−1g = x - 1, g′=1g' = 1.
  2. y′=2x(x−1)−(x2+1)(1)(x−1)2y' = \frac{2x(x - 1) - (x^2 + 1)(1)}{(x - 1)^2}.
  3. Simplify the numerator: 2x2−2x−x2−1=x2−2x−12x^2 - 2x - x^2 - 1 = x^2 - 2x - 1, so y′=x2−2x−1(x−1)2y' = \frac{x^2 - 2x - 1}{(x - 1)^2}.

Applying it to tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x} gives cos⁡2x+sin⁡2xcos⁡2x=sec⁡2x\frac{\cos^2 x + \sin^2 x}{\cos^2 x} = \sec^2 x, confirming the table above.

The chain rule

The chain rule handles compositions, functions inside functions. If y=f(g(x))y = f(g(x)), then:

dydx=f′(g(x))⋅g′(x)\frac{dy}{dx} = f'\big(g(x)\big)\cdot g'(x)

In words: differentiate the outer function, leaving the inside alone, then multiply by the derivative of the inside. In Leibniz notation, with u=g(x)u = g(x), it reads dydx=dydu⋅dudx\frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}. Rates multiply: if uu changes 3 times as fast as xx and yy changes 2 times as fast as uu, then yy changes 6 times as fast as xx. Recognising the inner and outer functions is the skill practised in function composition.

Example 5: four chain rule derivatives

  1. ddx(3x2+1)5=5(3x2+1)4⋅6x=30x(3x2+1)4\frac{d}{dx}(3x^2 + 1)^5 = 5(3x^2 + 1)^4 \cdot 6x = 30x(3x^2 + 1)^4.
  2. ddxsin⁡(x2)=cos⁡(x2)⋅2x\frac{d}{dx}\sin(x^2) = \cos(x^2)\cdot 2x.
  3. ddxe−2x=−2e−2x\frac{d}{dx}e^{-2x} = -2e^{-2x}.
  4. ddxln⁡(x2+4)=2xx2+4\frac{d}{dx}\ln(x^2 + 4) = \frac{2x}{x^2 + 4}.

Combining the rules

Real problems mix rules. Work from the outside in: decide what the last operation in the expression is, apply its rule, and then handle each piece.

Example 6: y=xe3xy = xe^{3x}

  1. The outermost operation is a product, so use the product rule.
  2. The derivative of e3xe^{3x} needs the chain rule: 3e3x3e^{3x}.
  3. y′=1⋅e3x+x⋅3e3x=e3x(1+3x)y' = 1 \cdot e^{3x} + x \cdot 3e^{3x} = e^{3x}(1 + 3x).

Example 7: logarithmic differentiation of y=xxy = x^x

  1. Neither the power rule nor the exponential rule applies, because both base and exponent vary.
  2. Take logs: ln⁡y=xln⁡x\ln y = x\ln x.
  3. Differentiate both sides, using the chain rule on the left: y′y=ln⁡x+1\frac{y'}{y} = \ln x + 1.
  4. So y′=xx(ln⁡x+1)y' = x^x(\ln x + 1) for x>0x > 0.

When yy cannot be isolated at all, as in x2+y2=25x^2 + y^2 = 25, the chain rule still works through implicit differentiation.

Common mistakes

  • Forgetting the inner derivative in the chain rule, for example writing cos⁡(x2)\cos(x^2) for the derivative of sin⁡(x2)\sin(x^2).
  • Multiplying derivatives for a product instead of using the product rule.
  • Reversing the order in the numerator of the quotient rule, which flips the sign.
  • Applying the power rule to exe^x or to 2x2^x; those are exponential functions, not powers.
  • Using degrees in trigonometric derivatives.

To check an answer, the derivative calculator shows which rule it applies at every step, and the graphing calculator lets you compare the slope of a curve with your derivative's values.

Inverse trigonometric functions

The inverse trigonometric functions have algebraic derivatives, which surprises many students the first time they see them. They come from differentiating the inverse relationship implicitly; for example, if y=arcsin⁡xy = \arcsin x then sin⁡y=x\sin y = x, and differentiating both sides gives cos⁡y⋅y′=1\cos y \cdot y' = 1. Since cos⁡y=1−x2\cos y = \sqrt{1 - x^2} on the range of arcsine, the result follows:

ddxarcsin⁡x=11−x2,ddxarctan⁡x=11+x2\frac{d}{dx}\arcsin x = \frac{1}{\sqrt{1 - x^2}}, \qquad \frac{d}{dx}\arctan x = \frac{1}{1 + x^2}

These two results matter more in integration than in differentiation, because they explain why integrals such as ∫dx1+x2\int \frac{dx}{1 + x^2} produce an arctangent.

Higher derivatives

Differentiating a derivative gives the second derivative, and the same rules apply each time. For y=x4y = x^4, the derivatives are 4x34x^3, then 12x212x^2, then 24x24x, then 24, and every derivative after that is 0. A polynomial of degree nn always vanishes after n+1n + 1 differentiations.

Sine and cosine cycle instead: the derivatives of sin⁡x\sin x are cos⁡x\cos x, −sin⁡x-\sin x, −cos⁡x-\cos x and then sin⁡x\sin x again, repeating every four steps. The exponential exe^x never changes at all. These patterns are the starting point for building Taylor series, which approximate functions using all of their derivatives at a single point.

Practice problems with answers

Try each one before reading the answer. Decide first which rule is the outermost one.

  1. ddx(2x3−1x)\frac{d}{dx}\left(2x^3 - \frac{1}{x}\right). Answer: 6x2+1x26x^2 + \frac{1}{x^2}.
  2. ddx(x3ex)\frac{d}{dx}\left(x^3 e^x\right). Answer: x2ex(3+x)x^2e^x(3 + x), by the product rule.
  3. ddxcos⁡(5x+1)\frac{d}{dx}\cos(5x + 1). Answer: −5sin⁡(5x+1)-5\sin(5x + 1), by the chain rule.
  4. ddxln⁡xx\frac{d}{dx}\frac{\ln x}{x}. Answer: 1−ln⁡xx2\frac{1 - \ln x}{x^2}, by the quotient rule.
  5. ddx1+x2\frac{d}{dx}\sqrt{1 + x^2}. Answer: x1+x2\frac{x}{\sqrt{1 + x^2}}, by the chain rule with the power 12\frac{1}{2}.

Rules in context: rates that depend on each other

The chain rule is what makes related rates problems possible. Suppose a circular ripple spreads on a pond so that its radius grows at 2 cm per second. The area is A=πr2A = \pi r^2, and differentiating with respect to time gives dAdt=2πrdrdt\frac{dA}{dt} = 2\pi r\frac{dr}{dt}. When the radius is 10 cm, the area is growing at 2π(10)(2)=40π≈125.72\pi(10)(2) = 40\pi \approx 125.7 square centimetres per second.

The same idea answers questions about a ladder sliding down a wall, a balloon being inflated or the shadow of a person walking away from a street light. In each case you write an equation linking the quantities, differentiate every term with respect to time using the chain rule, and then substitute the values at the moment you care about. Substituting before differentiating is a classic mistake, because it turns changing quantities into constants.

Frequently asked questions

Does the power rule work for negative and fractional exponents?

Yes. It holds for every real exponent, so ddxx−1=−x−2\frac{d}{dx}x^{-1} = -x^{-2} and ddxx1/3=13x−2/3\frac{d}{dx}x^{1/3} = \frac{1}{3}x^{-2/3}. Rewrite roots and reciprocals as powers first.

Can I avoid the quotient rule?

Often. Write fg\frac{f}{g} as f⋅g−1f \cdot g^{-1} and use the product and chain rules, or simplify the fraction first. Both routes give the same answer, though it may need simplifying to look identical.

How do I know when to use the chain rule?

Whenever something other than plain xx sits inside a function: a power of a bracket, a trig function of 2x2x, ee raised to anything other than xx, or a log of an expression. If the inside is just xx, its derivative is 1 and the chain rule changes nothing.

Why is the derivative of e to the x equal to itself?

The number e≈2.71828e \approx 2.71828 is exactly the base for which the slope of axa^x at x=0x = 0 equals 1. With that property, the limit definition shows that the slope at every point equals the function's value there.

What order should I apply derivative rules in?

Start with the last operation you would perform if you were evaluating the expression for a number. If that is a multiplication, use the product rule; if it is applying a function to a bracket, use the chain rule. Then apply the same question to each piece, working inwards.

MathSolver Pro Editorial Team

Math content and review

Our editorial team writes every guide to explain the reasoning behind each method, not just the answer. Each worked example is checked against the site's own solver engines and automated tests before it is published, and articles are revised whenever a method or an exam format changes.