1. The toolkit
The derivative was defined as a limit:
$$ f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}. $$That definition is the foundation — every rule below is ultimately proved from it — but it is slow and error-prone to apply by hand. Differentiating $f(x) = x^7 \sin(x^2) + e^{3x}$ from first principles would take a page of algebra. The same calculation with the rules takes a single line.
The strategy of differentiation in practice is therefore structural:
- Look at the function and identify how it's built — is it a sum? A product? A quotient? A composition?
- Apply the rule for that structure, which reduces the problem to differentiating simpler pieces.
- Differentiate the pieces using the standard derivatives, recursing if needed.
The whole craft is pattern recognition. Once the rules are second nature, the only thing you do consciously is name what you're looking at.
We use $f'(x)$ and $\tfrac{d}{dx}[f(x)]$ interchangeably. The operator $\tfrac{d}{dx}$ is read "the derivative with respect to $x$ of"; it's especially clear when you want to emphasize which variable is changing.
2. Constant, power, and sum rules
These three rules together handle every polynomial — and a great deal else besides.
If $c$ is a constant, then $\tfrac{d}{dx}[c] = 0$.
A constant function doesn't change as $x$ changes, so its rate of change is zero. The same is true of the constant factor in front of a function: it just rides along.
$$ \frac{d}{dx}\big[c \cdot f(x)\big] = c \cdot f'(x). $$For any real number $n$,
$$ \frac{d}{dx}\big[x^n\big] = n\,x^{n-1}. $$Bring the exponent down out front, then drop the exponent by one. This holds for every real $n$ — positive integers, negative integers, fractions, irrationals. It is the single most-used rule in calculus.
Quick checks:
- $\tfrac{d}{dx}[x^3] = 3x^2$.
- $\tfrac{d}{dx}[x] = 1 \cdot x^0 = 1$.
- $\tfrac{d}{dx}\!\left[\tfrac{1}{x}\right] = \tfrac{d}{dx}[x^{-1}] = -x^{-2} = -\tfrac{1}{x^2}$.
- $\tfrac{d}{dx}\!\left[\sqrt{x}\right] = \tfrac{d}{dx}[x^{1/2}] = \tfrac{1}{2}x^{-1/2} = \tfrac{1}{2\sqrt{x}}$.
The derivative of a sum is the sum of derivatives:
$$ \frac{d}{dx}\big[f(x) + g(x)\big] = f'(x) + g'(x). $$Combined with the constant-factor rule, this means you can differentiate any polynomial term-by-term:
$$ \frac{d}{dx}\big[4x^3 - 5x^2 + 7x - 9\big] = 12x^2 - 10x + 7. $$Each term: power rule, multiply by the existing coefficient. Constants vanish. That's it.
There is no general "rule" for differentiating a product or quotient term-by-term — those need their own rules, below. Linearity (the sum and constant-multiple rules) is special.
3. The product rule
What does the derivative of $f(x) \cdot g(x)$ look like? A natural guess is $f'(x) \cdot g'(x)$ — but that's wrong, and it's wrong in a way worth understanding. Try it on $f(x) = x$ and $g(x) = x$: their product is $x^2$, whose derivative is $2x$. But $f'(x) \cdot g'(x) = 1 \cdot 1 = 1$. Not even close.
Out loud: "derivative of the first times the second, plus the first times the derivative of the second." Many people learn it as "first d-second plus second d-first" — same rule, different order, equally fine.
Why two terms? Picture $f \cdot g$ as the area of a rectangle with sides $f$ and $g$. If both sides change a tiny bit, the area changes by two thin strips: one along the top (from $g$ growing while $f$ stays roughly fixed), one along the side (from $f$ growing while $g$ stays roughly fixed). The infinitesimal corner is negligible. That's where the two terms come from — and why one of them isn't enough.
A check: with $f(x) = g(x) = x$, the rule gives $1 \cdot x + x \cdot 1 = 2x$, matching $\tfrac{d}{dx}[x^2]$.
4. The quotient rule
For a ratio of functions, the rule looks like the product rule with a sign flipped and a denominator squared on the bottom.
The numerator is "derivative of the top times the bottom, minus the top times the derivative of the bottom." The order matters: writing $f \cdot g' - f' \cdot g$ instead of $f' \cdot g - f \cdot g'$ flips every sign. A common memory aid is "low d-high minus high d-low, all over the square of what's below."
Mini-derivation: $\tfrac{f}{g}$ equals $f \cdot g^{-1}$, so by the product rule and the chain rule (next section),
$$ \frac{d}{dx}\!\left[f \cdot g^{-1}\right] = f' g^{-1} + f \cdot (-g^{-2})\,g' = \frac{f'}{g} - \frac{f g'}{g^2} = \frac{f'g - fg'}{g^2}. $$This is also the reason the rule is technically optional: if you can rewrite a quotient as a product (or with a negative exponent), you can avoid it entirely. Some people do.
The minus sign in the numerator is the most common source of errors in the quotient rule. If you find yourself momentarily unsure of the order, derive it on scratch paper from the product rule — it's only two lines.
5. The chain rule
Composition is everywhere in real expressions: $\sin(x^2)$, $e^{3x}$, $\ln(1 + x^2)$, $\sqrt{4 - x^2}$. Each is a function applied to another function of $x$. The chain rule tells you how to differentiate the whole stack.
"Differentiate the outer function evaluated at the inner, then multiply by the derivative of the inner." That trailing $g'(x)$ is the part beginners forget — and forgetting it is by far the most common error in differential calculus.
In Leibniz notation the rule almost writes itself. If $y = f(u)$ and $u = g(x)$, then
$$ \frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}. $$The $du$ "cancels" symbolically, which is a deliberate notational trick — that's exactly the intuition the chain rule is meant to formalize.
A worked micro-example. Let $y = \sin(x^2)$. The outer function is $\sin$; the inner is $x^2$. Then:
$$ \frac{dy}{dx} = \cos(x^2) \cdot 2x = 2x\cos(x^2). $$If you wrote $\cos(x^2)$ alone — without the $2x$ — that's the classic chain-rule miss.
If a function looks like "something of something else," it's a composition and you need the chain rule. The "of" is the giveaway: $\sin$ of $x^2$, $e$ to the $3x$, $\ln$ of $(1 + x^2)$. Pause, name the outer and inner, then differentiate.
Stacked compositions
The chain rule extends to deeper nestings by repeated application. For $y = f(g(h(x)))$,
$$ \frac{dy}{dx} = f'(g(h(x))) \cdot g'(h(x)) \cdot h'(x). $$Differentiate from the outside in, multiplying as you go. Each layer contributes one factor; nothing else changes.
6. Derivatives of standard functions
The rules above tell you how to combine derivatives. To actually compute one, you also need the building blocks — the derivatives of the elementary functions, which you simply memorize. These five carry most of the load.
| Function | Derivative | Comment |
|---|---|---|
| $x^n$ | $n\,x^{n-1}$ | Power rule. Works for every real $n$. |
| $e^x$ | $e^x$ | The only function (up to a constant) that is its own derivative — the reason $e$ is the "natural" base. |
| $\ln x$ | $\dfrac{1}{x}$ | Defined for $x > 0$. Pairs with $e^x$ as inverses. |
| $\sin x$ | $\cos x$ | The slope of sine is cosine at every point. |
| $\cos x$ | $-\sin x$ | Note the minus sign — cosine peaks where sine is rising fastest in the negative direction. |
| $\tan x$ | $\sec^2 x$ | Equivalently $1/\cos^2 x$. Derivable from sine/cosine via the quotient rule. |
| $\arcsin x$ | $\dfrac{1}{\sqrt{1 - x^2}}$ | Defined for $-1 < x < 1$. Found by differentiating both sides of $\sin(\arcsin x) = x$. |
| $\arccos x$ | $-\dfrac{1}{\sqrt{1 - x^2}}$ | Same magnitude as $\arcsin$, opposite sign — the two inverse functions march in opposite directions. |
| $\arctan x$ | $\dfrac{1}{1 + x^2}$ | Defined for all real $x$. Shows up constantly in integration. |
The trig ones loop: differentiating $\sin x$ four times in a row returns you to $\sin x$. The exponential is even simpler — it's a fixed point of differentiation.
Combined with the chain rule, this table covers an enormous range. For example, $\tfrac{d}{dx}[e^{3x}] = e^{3x} \cdot 3$, and $\tfrac{d}{dx}[\ln(1 + x^2)] = \tfrac{1}{1+x^2} \cdot 2x$.
The derivative of $a^x$ for a general base $a$ is $a^x \ln a$. The fact that $\ln$ shows up there — even though we're not differentiating a log — is one of many small reasons $e$ is the cleanest base to work in.
7. Implicit differentiation
So far every function has been served up explicitly: $y = f(x)$. But many curves don't come in that form. The unit circle $x^2 + y^2 = 1$ defines $y$ in terms of $x$ only implicitly — and solving for $y$ produces two pieces ($\pm\sqrt{1 - x^2}$), neither of which is the whole curve.
Implicit differentiation sidesteps the solve. You differentiate both sides of the equation with respect to $x$, treating $y$ as a function of $x$ and applying the chain rule whenever $y$ appears.
Given an equation in $x$ and $y$:
- Differentiate both sides with respect to $x$.
- Every $y$ contributes a factor of $\dfrac{dy}{dx}$ (chain rule).
- Solve algebraically for $\dfrac{dy}{dx}$.
Try it on $x^2 + y^2 = 1$. Differentiate both sides:
$$ 2x + 2y\,\frac{dy}{dx} = 0. $$The $y^2$ term, by the chain rule, becomes $2y \cdot \tfrac{dy}{dx}$ — that extra $\tfrac{dy}{dx}$ is what makes implicit differentiation implicit. Now solve:
$$ \frac{dy}{dx} = -\frac{x}{y}. $$The slope at any point on the circle is $-x/y$. At $(1/\sqrt{2}, 1/\sqrt{2})$ the slope is $-1$ — exactly the tangent direction you'd expect.
Use implicit differentiation any time $y$ is tangled into the equation — squared, multiplied by $x$, inside a function — so badly that solving for $y$ is ugly or impossible. The technique converts the problem from algebra (solve for $y$) to calculus (differentiate, then solve a linear equation for $\tfrac{dy}{dx}$).
8. Logarithmic differentiation
Some derivatives look hopeless until you take a logarithm. Two patterns demand it:
- A variable in both the base and the exponent, like $y = x^x$ — neither the power rule (exponent must be constant) nor the exponential rule (base must be constant) applies.
- A product or quotient with many factors, where the product rule would balloon into a mess. Taking a log turns it into a sum.
- Take the natural log of both sides: $\ln y = \ln(\text{expression})$.
- Use log laws ($\ln(ab) = \ln a + \ln b$, $\ln(a^b) = b\ln a$) to simplify.
- Differentiate implicitly: $\dfrac{1}{y}\dfrac{dy}{dx} = (\text{derivative of the right side})$.
- Multiply through by $y$ to isolate $\dfrac{dy}{dx}$, then substitute the original expression for $y$.
The signature example: differentiate $y = x^x$. Take logs:
$$ \ln y = x \ln x. $$Differentiate both sides — left side by the chain rule, right side by the product rule:
$$ \frac{1}{y}\frac{dy}{dx} = \ln x + x \cdot \frac{1}{x} = \ln x + 1. $$Multiply by $y = x^x$:
$$ \frac{dy}{dx} = x^x(\ln x + 1). $$That answer is unreachable by the power rule or the exponential rule alone — only the log trick gets you there.
9. Common pitfalls
Forgetting the chain rule on compositions. Writing $\tfrac{d}{dx}[\sin(x^2)] = \cos(x^2)$ is wrong — the correct answer is $2x\cos(x^2)$. Any time the function inside parentheses is more complicated than just $x$, you owe yourself a chain-rule factor. This is the single most common error in differential calculus.
Sign error in the quotient rule. The numerator is $f'g - fg'$, not $fg' - f'g$. Flipping the order silently negates the whole derivative. If you're unsure, re-derive it: $f/g = f \cdot g^{-1}$, product rule, two lines, done.
The product rule is not $f' \cdot g'$. Differentiating each factor and multiplying them is the most natural guess, and it is wrong. The right answer has two terms: $f'g + fg'$. If you ever produce a derivative with the same number of terms as the original product, you've probably skipped the second term.
Dropping a constant. $\tfrac{d}{dx}[5\sin x] = 5\cos x$, not $\cos x$. Constants ride along — they don't disappear unless they were standing alone (i.e., a constant term, not a constant factor).
10. Worked examples
For each example below, try the differentiation yourself first, then open the solution. The goal isn't to match the final number — it's to verify that your steps match the canonical recipe.
Example 1 · Differentiate $f(x) = 3x^4 - 2x^2 + 7x - 5$
Apply the sum rule, then the power rule term by term. The lone constant $-5$ vanishes.
$$ f'(x) = 3 \cdot 4x^3 - 2 \cdot 2x + 7 - 0 = 12x^3 - 4x + 7. $$Notice how mechanical this is — once you spot "polynomial," you're just executing.
Example 2 · Differentiate $f(x) = x \sin x$ (product rule)
This is a product of $x$ and $\sin x$. Let $u = x$ and $v = \sin x$, so $u' = 1$ and $v' = \cos x$.
$$ f'(x) = u'v + uv' = 1 \cdot \sin x + x \cdot \cos x = \sin x + x\cos x. $$Check. Two terms — one from each factor "doing the changing." That's exactly what the product rule promises.
Example 3 · Differentiate $f(x) = \sin(x^2)$ (chain rule)
This is a composition: the outer function is $\sin$, the inner is $x^2$.
Step 1. Differentiate the outer at the inner: $\tfrac{d}{dx}[\sin(u)] = \cos(u)$, evaluated at $u = x^2$, gives $\cos(x^2)$.
Step 2. Multiply by the derivative of the inner: $\tfrac{d}{dx}[x^2] = 2x$.
$$ f'(x) = \cos(x^2) \cdot 2x = 2x\cos(x^2). $$The $2x$ is the chain-rule factor. Dropping it is the canonical mistake.
Example 4 · Differentiate $f(x) = \dfrac{x^2}{\cos x}$ (quotient rule)
Let $u = x^2$ (so $u' = 2x$) and $v = \cos x$ (so $v' = -\sin x$).
$$ f'(x) = \frac{u'v - uv'}{v^2} = \frac{2x\cos x - x^2 \cdot (-\sin x)}{\cos^2 x} = \frac{2x\cos x + x^2\sin x}{\cos^2 x}. $$Notice the double negative — $-uv'$ with $v' = -\sin x$ becomes $+x^2 \sin x$. This is where sign errors love to hide.
Example 5 · Differentiate $f(x) = e^{3x}\sin(x^2)$ (combination of rules)
The outermost structure is a product, so start with the product rule. Let $u = e^{3x}$ and $v = \sin(x^2)$.
Step 1. Differentiate each factor (chain rule both times).
- $u' = \tfrac{d}{dx}[e^{3x}] = e^{3x} \cdot 3 = 3e^{3x}.$
- $v' = \tfrac{d}{dx}[\sin(x^2)] = \cos(x^2) \cdot 2x = 2x\cos(x^2).$
Step 2. Assemble with the product rule:
$$ f'(x) = u'v + uv' = 3e^{3x}\sin(x^2) + e^{3x} \cdot 2x\cos(x^2). $$Step 3. Factor for clarity:
$$ f'(x) = e^{3x}\!\left[3\sin(x^2) + 2x\cos(x^2)\right]. $$This is the shape of essentially every "hard" derivative: spot the outermost structure, recurse into each piece, factor at the end.