Skip to content
Mathematics11 min

Derivatives: Every Rule, With Worked Examples and When to Use Them

by Andrea

In brief

There are four rules of differentiation to know: sum, product (Leibniz), quotient and composite function. To these you add the table of standard derivatives — powers, sine, cosine, exponential, logarithm. Everything else, from x\sqrt{x} to 1x\frac{1}{x}, comes back to these cases once you rewrite the function as a power.

Derivatives almost never go wrong because of the formulas: they go wrong in deciding which formula to apply, and in what order. In our courses we see it every year in the fourth and fifth year: the student knows D[sinx]=cosxD[\sin x] = \cos x by heart, then, faced with sin(3x2)\sin(3x^2), differentiates only the "outside" and loses the factor 6x6x. This guide lines the whole thing up — the table of standard derivatives, the four rules, when to use each one, examples with the numbers — and closes with the mistakes we correct most often in lessons.

What are the derivatives of the standard functions?

Before the rules you need the building blocks: the derivatives of the standard functions. Here they are, and they have to be known without hesitation, because every exercise uses them as ingredients.

f(x)f(x)f(x)f'(x)Worth remembering
kk (constant)00π2\pi^2, e3e^3 and ln5\ln 5 are constants too: derivative zero
xnx^nnxn1n\,x^{n-1}Holds for every real nn, negative or fractional included
x\sqrt{x}12x\dfrac{1}{2\sqrt{x}}It is x1/2x^{1/2}: the power rule with n=12n = \tfrac{1}{2}
1x\dfrac{1}{x}1x2-\dfrac{1}{x^2}It is x1x^{-1}: the minus sign comes from n=1n = -1
sinx\sin xcosx\cos x
cosx\cos xsinx-\sin xThe minus goes on the cosine, not on the sine
tanx\tan x1cos2x=1+tan2x\dfrac{1}{\cos^2 x} = 1 + \tan^2 xThe two forms are equivalent: use whichever is convenient
exe^xexe^xThe only function equal to its own derivative
axa^xaxlnaa^x \ln aWith a=ea = e, lne=1\ln e = 1 and you are back to the row above
lnx\ln x1x\dfrac{1}{x}
logax\log_a x1xlna\dfrac{1}{x \ln a}

A detail we repeat often in lessons: x\sqrt{x} and 1x\frac{1}{x} are not special cases to be learned separately. They are the power rule applied with n=12n = \frac{1}{2} and n=1n = -1. Anyone who sees them that way also gets 1x22x3\frac{1}{x^2} \to -\frac{2}{x^3} or x313x2/3\sqrt[3]{x} \to \frac{1}{3}x^{-2/3} on the spot, with no extra formula sheets.

And if you are wondering where these formulas come from: D[sinx]=cosxD[\sin x] = \cos x is proved using precisely the standard limit sinxx1\frac{\sin x}{x} \to 1 — if you want to revisit it, we cover it in our guide to standard limits for the Maturità.

How do the four rules of differentiation work?

Sum and difference. The derivative of a sum is the sum of the derivatives:

D[f(x)+g(x)]=f(x)+g(x)D[f(x) + g(x)] = f'(x) + g'(x)

and multiplicative constants come outside the derivative: D[kf(x)]=kf(x)D[k \cdot f(x)] = k \cdot f'(x). Together, these two properties let you differentiate any polynomial term by term.

Product (Leibniz's rule). When two functions that both contain xx are multiplied together:

D[f(x)g(x)]=f(x)g(x)+f(x)g(x)D[f(x) \cdot g(x)] = f'(x)\,g(x) + f(x)\,g'(x)

"Differentiate the first times the second untouched, plus the first untouched times the derivative of the second." Here the order makes no difference: the sum is symmetric.

Quotient. For a fraction with xx both above and below:

D ⁣[f(x)g(x)]=f(x)g(x)f(x)g(x)[g(x)]2D\!\left[\frac{f(x)}{g(x)}\right] = \frac{f'(x)\,g(x) - f(x)\,g'(x)}{[g(x)]^2}

Here, by contrast, the order in the numerator matters a great deal: first the derivative of the numerator times the denominator, then the minus. Swapping the two terms flips the sign of the entire answer.

Composite function (chain rule). When one function sits "inside" another, that is f(g(x))f(g(x)):

D[f(g(x))]=f(g(x))g(x)D[f(g(x))] = f'(g(x)) \cdot g'(x)

In practice: you differentiate the outer function leaving the argument untouched, then multiply by the derivative of the argument. That second factor — the derivative of the "inside" — is the piece students forget more than anything else, and we come back to it shortly.

Want to improve your performance?

Contact us for your first lesson and find out how we can help you with a personalized learning path.

Book now

Which rule should I use? The decision table

The real work is not remembering the formulas but classifying the function at a glance. The most reliable test is to read the function out loud: if you say "sine of...", "e to the power of...", "square root of..." and what follows is not just xx on its own, you have a composite function.

How the function appearsRule to useExample
Sum of termsDifferentiate term by term3x42x+73x^4 - 2\sqrt{x} + 7
Constant ×\times functionTake the constant outside5sinx5cosx5\sin x \to 5\cos x
Two factors, both containing xxProductx2lnxx^2 \ln x
Fraction with xx above and belowQuotientx2+12x3\dfrac{x^2+1}{2x-3}
Fraction with a constant on topRewrite as a power, no quotient rule5x3=5x3\dfrac{5}{x^3} = 5x^{-3}
One function "inside" anotherChainsin(3x2)\sin(3x^2), ex2e^{x^2}, x2+1\sqrt{x^2+1}
Composite inside a product or quotientBoth rules, chain on the single factorx2sin(3x)x^2 \sin(3x)

How we set it up in lessons

Before touching any calculation, we get students to write a letter next to the function: S (sum), P (product), Q (quotient), C (composite) — or a combination, such as P+C. It looks like a trivial step, but it forces you to classify before you differentiate: most mistakes come from starting to write before deciding on the strategy.

Four worked examples, with the numbers

Polynomial with a root and a negative power

f(x)=3x42x+5xf(x) = 3x^4 - 2\sqrt{x} + \frac{5}{x}

No product, no composite: we rewrite everything as powers, f(x)=3x42x1/2+5x1f(x) = 3x^4 - 2x^{1/2} + 5x^{-1}, and differentiate term by term:

f(x)=12x31x5x2f'(x) = 12x^3 - \frac{1}{\sqrt{x}} - \frac{5}{x^2}

Quick check at a point: f(1)=1215=6f'(1) = 12 - 1 - 5 = 6. Getting into the habit of checking the derivative at a convenient value is a lifesaver in class tests.

Want to improve your performance?

Contact us for your first lesson and find out how we can help you with a personalized learning path.

Book now

The quotient rule

f(x)=x2+12x3f(x) = \frac{x^2+1}{2x-3}

xx appears above and below: quotient. Numerator: f=2xf' = 2x; denominator: g=2g' = 2.

f(x)=2x(2x3)(x2+1)2(2x3)2=4x26x2x22(2x3)2=2x26x2(2x3)2f'(x) = \frac{2x(2x-3) - (x^2+1) \cdot 2}{(2x-3)^2} = \frac{4x^2 - 6x - 2x^2 - 2}{(2x-3)^2} = \frac{2x^2 - 6x - 2}{(2x-3)^2}

Had we swapped the order in the numerator we would have got 2x2+6x+2(2x3)2\frac{-2x^2+6x+2}{(2x-3)^2}: the same absolute value, the opposite sign everywhere. In curve sketching that means swapping the increasing and decreasing intervals — the whole graph comes out wrong because of one reversed order.

The chain rule

f(x)=sin(3x2)f(x) = \sin(3x^2)

Let us read it out loud: "sine of 3x23x^2" — composite. Outside: the sine, which differentiates to the cosine of the same argument. Inside: 3x23x^2, which differentiates to 6x6x.

f(x)=cos(3x2)6x=6xcos(3x2)f'(x) = \cos(3x^2) \cdot 6x = 6x\cos(3x^2)

Writing only cos(3x2)\cos(3x^2) is the single most frequent mistake we see on this topic: the derivative of the "inside" is not optional.

Product and chain together — the case that catches almost everyone

f(x)=x2sin(3x)f(x) = x^2 \sin(3x)

Two factors containing xx: the product rule is needed. But the second factor is itself composite (sin\sin of 3x3x), so differentiating it also calls for the chain rule:

f(x)=2xD[x2]sin(3x)+x23cos(3x)D[sin(3x)]=2xsin(3x)+3x2cos(3x)f'(x) = \underbrace{2x}_{D[x^2]} \cdot \sin(3x) + x^2 \cdot \underbrace{3\cos(3x)}_{D[\sin(3x)]} = 2x\sin(3x) + 3x^2\cos(3x)

The two classic traps here: forgetting the factor 33 inside the product, or "merging" the rules and writing 2x3cos(3x)2x \cdot 3\cos(3x) straight off, differentiating both factors together. The rules are applied one at a time, from the outside in.

Do you always need the quotient rule?

No, and using it when you do not need it is a source of avoidable mistakes. If there is a constant on top, the fraction is a power in disguise:

D ⁣[5x3]=D[5x3]=15x4=15x4D\!\left[\frac{5}{x^3}\right] = D[5x^{-3}] = -15x^{-4} = -\frac{15}{x^4}

One line, against the four of the quotient rule (with the attendant risk of getting a sign wrong). Same thing for 1x=x1/2\frac{1}{\sqrt{x}} = x^{-1/2} or 32x=32x1\frac{3}{2x} = \frac{3}{2}x^{-1}. The practical rule we give our students: use the quotient rule only when xx really is both above and below; in every other case, rewrite as a power and reach for a standard derivative.

Want to improve your performance?

Contact us for your first lesson and find out how we can help you with a personalized learning path.

Book now

The mistakes we see most often in lessons

Marking fourth-year tests and Maturità mock papers, five mistakes come back with more regularity than any others:

  1. The chain multiplier forgotten. D[ex2]D[e^{x^2}] written as ex2e^{x^2} rather than 2xex22x\,e^{x^2}; D[sin3x]D[\sin 3x] written as cos3x\cos 3x rather than 3cos3x3\cos 3x. It is the number one mistake overall, and the most insidious: the answer looks like a legitimate derivative, so nobody catches it on rereading.
  2. The order reversed in the quotient rule. The numerator is fgfgf'g - fg', in that order. Reversing it produces the answer with the opposite sign — and in curve sketching the whole increasing/decreasing analysis comes out backwards, as in the example of x2+12x3\frac{x^2+1}{2x-3} above.
  3. The product differentiated "factor by factor". D[x2lnx]=2x1x=2D[x^2 \ln x] = 2x \cdot \frac{1}{x} = 2: elegant, tidy, wrong. Leibniz's rule gives 2xlnx+x2x\ln x + x. The fact that the wrong answer comes out so neatly makes it even more treacherous.
  4. Constants treated as variables. D[ln3]=13D[\ln 3] = \frac{1}{3} and D[e2]=2eD[e^2] = 2e are mistakes we still see in the fifth year: ln3\ln 3, e2e^2 and π2\pi^2 are numbers, and the derivative of a number is 00.
  5. The sign lost with negative powers. D ⁣[5x]=5x2D\!\left[\frac{5}{x}\right] = \frac{5}{x^2} without the minus: whoever writes that has applied nxn1n\,x^{n-1} while forgetting that here n=1n = -1, which makes the coefficient negative. The correct answer is 5x2-\frac{5}{x^2}.

The mistake that costs most

A missing chain multiplier does not ruin only that one exercise: it carries through the whole of the curve sketching. A wrong ff' produces wrong stationary points, wrong monotonicity, a wrong graph — a single forgotten 6x6x in D[sin(3x2)]D[\sin(3x^2)] can wreck an entire problem in the Maturità maths paper. Before you move on, always ask yourself: "have I multiplied by the derivative of the inside?"

From derivatives to the Maturità (and beyond)

Derivatives are the heart of curve sketching, which in turn is the centrepiece of the seconda prova, the Maturità maths paper at a scientific high school: maxima, minima, points of inflection and monotonicity all go through an ff' calculated correctly. And it does not end with the exam: the same rules, unchanged, are waiting for you in the calculus questions of admission tests and in your first university analysis exam — anyone who automates them now arrives in first year with a real advantage. If you are already thinking about admission tests, take a look at our preparation paths.

To fix them for good, the same recipe as for limits works: a few minutes of rapid-fire derivatives at the start of a lesson, mixing the four types, until the S/P/Q/C classification becomes instinctive. If instead you feel the gaps go further back — the algebra of powers, functions, limits — a dedicated tutor can build you a plan around the weeks you have ahead: tell us about your situation and book your first lesson.

FAQ

How do you differentiate a composite function?

With the chain rule: D[f(g(x))]=f(g(x))g(x)D[f(g(x))] = f'(g(x)) \cdot g'(x). In practice you differentiate the outer function leaving the argument untouched, then multiply by the derivative of the argument. Example: D[sin(3x2)]=cos(3x2)6xD[\sin(3x^2)] = \cos(3x^2) \cdot 6x. Forgetting the second factor is the most common mistake of all on derivatives.

What is the derivative of 1/x?

D ⁣[1x]=1x2D\!\left[\frac{1}{x}\right] = -\frac{1}{x^2}. It is not a separate formula: 1x=x1\frac{1}{x} = x^{-1}, and applying the power rule with n=1n = -1 gives you 1x2-1 \cdot x^{-2}. The minus sign is where people go wrong most often. In the same way, 1x2=x2\frac{1}{x^2} = x^{-2} has derivative 2x3-\frac{2}{x^3}.

What is the difference between the product rule and the quotient rule?

The product rule, fg+fgf'g + fg', is a sum: the order of the two terms makes no difference. The quotient rule, fgfgg2\frac{f'g - fg'}{g^2}, is a difference: the order does matter, and reversing it changes the sign of the whole answer. The quotient rule is only needed when xx appears both in the numerator and in the denominator; with a constant on top it is better to rewrite as a power.

How many rules of differentiation do you need for the Maturità?

Four: sum (with multiplicative constants coming outside the derivative), product, quotient and composite function. To these you add the table of standard derivatives — powers, roots, sine, cosine, tangent, exponentials and logarithms. With these tools you can differentiate any function in the Maturità maths paper; the real work is recognising at a glance which rule to apply.

AN

Andrea

Responsabile Didattica Italiana Test d'Ingresso

STEM center of excellence in Milan. Certified tutors, structured methodology, and proprietary technology to guide every student toward their goals.

Need help with your studies?

Contact us for a personalized learning path.

Or message us on WhatsApp →

Maths TutoringBook now