12.4 Algebra of Derivatives
Four rules replace first principles: the power rule $\tfrac{d}{dx}x^n=nx^{n-1}$, the sum and constant-multiple rules, the product rule $(uv)'=u'v+uv'$ and the quotient rule. Together they differentiate every polynomial and every trigonometric function in a line or two.
Finding $\tfrac{d}{dx}(x^2)$ from first principles took four lines. Finding $\tfrac{d}{dx}(x^7-4x^3+2\sin x)$ or $\tfrac{d}{dx}\left(\tfrac{x^2}{1+\cos x}\right)$ the same way would take a page, with many chances to slip. Mathematicians do not work like that. Instead, they prove a few rules once, from first principles, and then build derivatives of complicated functions out of the derivatives of simple ones — in the same way that the algebra of limits (Theorem 12.2) builds limits.
In this section we prove the power rule for $x^n$, the rules for sums, differences and constant multiples, and then the two less obvious rules, for products and quotients. With the derivatives of $\sin x$ and $\cos x$ from Section 12.3 they give the derivatives of all polynomials, all rational functions and all six trigonometric functions. We finish with tangents, velocities and marginal costs.
The Power Rule and Polynomials
For every positive integer $n$, $$\dfrac{d}{dx}\left(x^n\right)=nx^{n-1}.$$
Proof. Fix a point $a$. By the second form of Definition 12.3 and Theorem 12.4, $$f'(a)=\lim_{x\to a}\dfrac{x^n-a^n}{x-a}=na^{n-1}.$$ Since $a$ was any point, $f'(x)=nx^{n-1}$. $\blacksquare$
A second proof, by the binomial theorem (Section 7.1). $(x+h)^n=x^n+{}^nC_1x^{n-1}h$ $+\,{}^nC_2x^{n-2}h^2+\dots+h^n$, so $$\begin{aligned}\dfrac{(x+h)^n-x^n}{h}&=nx^{n-1}+{}^nC_2x^{n-2}h\\&\quad+\dots+h^{n-1}.\end{aligned}$$ Every term after the first contains $h$, so the limit as $h\to0$ is $nx^{n-1}$.
Let $u$ and $v$ be differentiable at $x$ and let $c$ be a constant. Then $u\pm v$ and $cu$ are differentiable at $x$, and $$(u\pm v)'=u'\pm v',\qquad(cu)'=c\,u'.$$
Proof. $\dfrac{[u(x+h)+v(x+h)]-[u(x)+v(x)]}{h}$ $=\dfrac{u(x+h)-u(x)}{h}+\dfrac{v(x+h)-v(x)}{h}$. Both fractions have limits, $u'(x)$ and $v'(x)$, so by the sum rule for limits the left side tends to $u'(x)+v'(x)$. Differences are the same with minus signs, and $\dfrac{cu(x+h)-cu(x)}{h}$ $=c\cdot\dfrac{u(x+h)-u(x)}{h}\to cu'(x)$. $\blacksquare$
Together with $\tfrac{d}{dx}(c)=0$, these rules differentiate any polynomial term by term: $$\begin{aligned}&\dfrac{d}{dx}\left(a_nx^n+\dots+a_2x^2+a_1x+a_0\right)\\&\quad=na_nx^{n-1}+\dots+2a_2x+a_1.\end{aligned}$$
The Product and Quotient Rules
It is tempting to guess that the derivative of a product is the product of the derivatives. It is not: $x\cdot x=x^2$ has derivative $2x$, but $(x)'(x)'=1\cdot1=1$. The correct rule has two terms.
Let $u$ and $v$ be differentiable at $x$. Then $uv$ is differentiable at $x$ and $$(uv)'=u'v+uv'.$$ If also $v(x)\ne0$, then $\tfrac uv$ is differentiable at $x$ and $$\left(\dfrac uv\right)'=\dfrac{u'v-uv'}{v^2}.$$
Proof of the product rule. Add and subtract $u(x+h)v(x)$ in the numerator: $$\begin{aligned}\dfrac{u(x+h)v(x+h)-u(x)v(x)}{h}&=u(x+h)\cdot\dfrac{v(x+h)-v(x)}{h}\\&\quad+v(x)\cdot\dfrac{u(x+h)-u(x)}{h}.\end{aligned}$$ As $h\to0$ the two difference quotients tend to $v'(x)$ and $u'(x)$, and $u(x+h)\to u(x)$ (a differentiable function has no jump: $u(x+h)-u(x)=h\cdot\tfrac{u(x+h)-u(x)}{h}$ $\to0\cdot u'(x)=0$). By the algebra of limits the whole expression tends to $u(x)v'(x)+v(x)u'(x)$.
Proof of the quotient rule. $$\begin{aligned}&\dfrac{u(x+h)}{v(x+h)}-\dfrac{u(x)}{v(x)}\\&\quad=\dfrac{u(x+h)v(x)-u(x)v(x+h)}{v(x+h)v(x)}.\end{aligned}$$ Add and subtract $u(x)v(x)$ in the numerator and divide by $h$: $$\begin{aligned}\dfrac{1}{v(x+h)v(x)}\Big[&v(x)\dfrac{u(x+h)-u(x)}{h}\\&-u(x)\dfrac{v(x+h)-v(x)}{h}\Big].\end{aligned}$$ As $h\to0$ this tends to $\dfrac{v(x)u'(x)-u(x)v'(x)}{v(x)^2}$, using $v(x+h)\to v(x)\ne0$. $\blacksquare$
A memory aid for the quotient rule: "bottom times derivative of top, minus top times derivative of bottom, all over bottom squared". The order matters, because of the minus sign.
Negative Powers and the Other Trigonometric Functions
The quotient rule immediately extends the power rule and finishes the list of trigonometric derivatives.
For every positive integer $n$ and every $x\ne0$, $$\dfrac{d}{dx}\left(x^{-n}\right)=-nx^{-n-1}.$$ So $\tfrac{d}{dx}x^m=mx^{m-1}$ holds for every integer $m$ (for $m=0$ both sides are $0$, taking $x\ne0$).
Proof. $x^{-n}=\dfrac{1}{x^n}$. By the quotient rule with $u=1$, $v=x^n$: $\dfrac{0\cdot x^n-1\cdot nx^{n-1}}{x^{2n}}=-nx^{n-1-2n}=-nx^{-n-1}$. $\blacksquare$
With $x$ in radians, and wherever the function is defined,
| $f(x)$ | $\sin x$ | $\cos x$ | $\tan x$ | $\cot x$ | $\sec x$ | $\operatorname{cosec}x$ |
|---|---|---|---|---|---|---|
| $f'(x)$ | $\cos x$ | $-\sin x$ | $\sec^2x$ | $-\operatorname{cosec}^2x$ | $\sec x\tan x$ | $-\operatorname{cosec}x\cot x$ |
Proof. The first two are Theorem 12.8. For $\tan x=\tfrac{\sin x}{\cos x}$: $\dfrac{\cos x\cos x-\sin x(-\sin x)}{\cos^2x}=\dfrac{1}{\cos^2x}=\sec^2x$. For $\sec x=\tfrac1{\cos x}$: $\dfrac{0-1\cdot(-\sin x)}{\cos^2x}=\dfrac{1}{\cos x}\cdot\dfrac{\sin x}{\cos x}=\sec x\tan x$. The results for $\cot x=\tfrac{\cos x}{\sin x}$ and $\operatorname{cosec}x=\tfrac1{\sin x}$ follow in the same way (Exercise III). $\blacksquare$
A pattern helps the memory: the three "co-" functions have derivatives that start with a minus sign and swap each function for its co-function.
1. $(uv)'=u'v'$. Wrong — test it on $x\cdot x$. Use $u'v+uv'$.
2. $\left(\tfrac uv\right)'=\tfrac{u'}{v'}$, or the numerator in the wrong order. The quotient rule is $\tfrac{u'v-uv'}{v^2}$; swapping the terms changes the sign of the answer.
3. Forgetting that constants differentiate to $0$ — but a constant factor stays: $(5x^3)'=15x^2$, while $(x^3+5)'=3x^2$.
4. Using the power rule on $\sin^nx$ blindly. $nx^{n-1}$ is for a power of $x$. $\sin^2x=\sin x\cdot\sin x$ needs the product rule: $2\sin x\cos x$, not $2\sin x$.
5. Using the quotient rule when simplifying is quicker. $\tfrac{x^4+2x^2}{x}=x^3+2x$; dividing out first saves work and errors.
6. Mixing up signs of the "co-" functions. $(\cos x)'=-\sin x$, $(\cot x)'=-\operatorname{cosec}^2x$, $(\operatorname{cosec}x)'=-\operatorname{cosec}x\cot x$; the others are positive.
The chain rule is taught and tested in school, but not in the year-end board exam; JEE Main lists it (and JEE Advanced uses it throughout differential calculus). In Class 12 it becomes one of the most-used rules of all.
The chain rule. Many functions are composites (Section 2.4): $\sin2x$ is "double, then take the sine", and $(x^2+1)^5$ is "square and add $1$, then take the fifth power". Write $y=f(u)$ with $u=g(x)$. If $g$ is differentiable at $x$ and $f$ is differentiable at $u=g(x)$, then $y=f(g(x))$ is differentiable at $x$ and $$\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx},$$ that is, $\big(f(g(x))\big)'=f'\big(g(x)\big)\cdot g'(x)$: the derivative of the outer function, evaluated at the inner one, times the derivative of the inner function. Why rates multiply: if $u$ changes $3$ times as fast as $x$ and $y$ changes $2$ times as fast as $u$, then $y$ changes $2\times3=6$ times as fast as $x$.
Worked example 1. Differentiate $y=(2x+1)^5$.
Solution. Inner $u=2x+1$, $\tfrac{du}{dx}=2$; outer $y=u^5$, $\tfrac{dy}{du}=5u^4$. So $\tfrac{dy}{dx}=5(2x+1)^4\cdot2=10(2x+1)^4$. Check at $x=0$: the formula gives $10$; numerically $\tfrac{(1.0002)^5-(0.9998)^5}{0.0002}\approx10.000$ ✓. (Expanding $(2x+1)^5$ by the binomial theorem and differentiating term by term gives the same answer, much more slowly.)
Worked example 2. Differentiate (a) $\sin2x$ (b) $\sin(x^2)$.
Solution. (a) $\cos2x\cdot2=2\cos2x$. Check by the product rule: $\sin2x=2\sin x\cos x$ has derivative $2(\cos^2x-\sin^2x)=2\cos2x$ ✓. (b) The inner function is $x^2$: $\cos(x^2)\cdot2x=2x\cos(x^2)$ — not $\cos(x^2)$, which forgets the inner derivative, and not $\cos2x$.
Exercises
- 1 $x^7$
- 2 $5x^4-2x^3+x-9$
- 3 $x^{10}+10x$
- 4 $(3x-2)^2$
- 5 $x^2(x+3)$
- 6 $\dfrac{x^4+2x}{x}$, $x\ne0$
- 7 $\dfrac{1}{x^5}$, $x\ne0$
- 8 For $f(x)=x^3-6x^2+9x+1$, find $f'(x)$ and the values of $x$ where $f'(x)=0$.
- 9 For $f(x)=1+x+\dfrac{x^2}{2}+\dfrac{x^3}{3}+\dots+\dfrac{x^{50}}{50}$, find $f'(1)$.
- 1 $x^3\sin x$
- 2 $(x^2+1)(x-5)$
- 3 $x\cos x$
- 4 $\sin^2x$ (as $\sin x\cdot\sin x$)
- 5 $\dfrac{2x-1}{x+3}$
- 6 $\dfrac{1}{x^2+1}$
- 7 $\dfrac{x}{\sin x}$
- 8 $\dfrac{1+\cos x}{\sin x}$
- 9 $\dfrac{x^2+3x}{x-1}$
- 10 $\dfrac{\sin x}{1+\cos x}$, and simplify your answer
- 1 Use the quotient rule to prove $\dfrac{d}{dx}(\cot x)=-\operatorname{cosec}^2x$.
- 2 Prove $\dfrac{d}{dx}(\operatorname{cosec}x)=-\operatorname{cosec}x\cot x$.
- 3 $3\tan x-2\sec x$
- 4 $x^2\tan x$
- 5 Find the slope of $y=\sin x+\cos x$ at $x=\tfrac\pi4$, and say what the tangent looks like there.
- 6 $\dfrac{1-\cos x}{1+\cos x}$
- 1 A particle moves along a line so that $s=t^3-6t^2+9t$ metres after $t$ seconds. Find its velocity, its velocity at $t=2$, and the times when it is momentarily at rest.
- 2 Find the equation of the tangent to $y=x^3-2x^2+1$ at $x=2$.
- 3 Find the points on $y=x^3-12x$ where the tangent is horizontal.
- 4 The curve $y=ax^2+bx$ passes through $(1,5)$ and has slope $8$ there. Find $a$ and $b$.
- 5 A shop's revenue from selling $x$ units is $R(x)=x(200-0.5x)$ rupees. Find the marginal revenue $R'(x)$ and its value at $x=120$.
- 1 $(3x-2)^4$
- 2 $\cos5x$
- 3 $\sin^2x$, treating it as $u^2$ with $u=\sin x$ (compare Mistake 4)
- 4 $\dfrac{1}{(x^2+1)^2}$
- 5 $\tan(x^2)$
- 6 Find the slope of the tangent to $y=(2x-3)^5$ at $x=2$.
How this is examined: Board papers ask for derivatives by the product and quotient rules (2–3 marks), often of trigonometric quotients that simplify nicely, and for a velocity or a tangent from a polynomial model. JEE uses the rules inside tangent and slope conditions, and combines them with sums of series.
E1. Board · 1 mark If $y=x\sin x$, then $\dfrac{dy}{dx}$ at $x=\tfrac\pi2$ is (A) $1$ (B) $0$ (C) $\tfrac\pi2$ (D) $-1$
E2. Board · 2 marks Differentiate $\dfrac{x^2+1}{x^2-1}$ with respect to $x$.
E3. Board · 3 marks Differentiate $\dfrac{\sin x+\cos x}{\sin x-\cos x}$.
E4. Board · Case study A ball is thrown straight up from a height of $1.5\ \text{m}$; its height after $t$ seconds is $y=1.5+14t-4.9t^2$ metres. (i) Find its velocity $v(t)$. (1 mark) (ii) When does it reach its highest point (where $v=0$)? (1 mark) (iii) Find the greatest height. (2 marks)
E5. JEE Main If $f(x)=1+2x+3x^2+\dots+20x^{19}$, then $f'(1)$ equals (A) $2660$ (B) $2870$ (C) $210$ (D) $3080$
E6. JEE Advanced One or more options correct. The curve $y=x^3+ax^2+bx$ passes through $(1,-2)$ and has a horizontal tangent there. Then (A) $a=0$ (B) $b=-3$ (C) the tangent at $x=-1$ is also horizontal (D) the curve passes through $(-1,-2)$
Research question. A packaging company folds open boxes from square cards of side $20\ \text{cm}$ by cutting a square of side $x$ from each corner. Where does the derivative of the volume become zero — and is that the box that holds the most?
Why it matters. Packaging, tin cans and shipping containers are designed to use as little material as possible for the capacity they need. Engineers find the best design by locating where the rate of change of volume (or cost) with respect to a dimension is zero. You can already compute that rate with the rules of this section; Class 12 will prove why the zero marks a maximum.
What to do.
- Show that the volume is $V(x)=x(20-2x)^2\ \text{cm}^3$ for $0\lt x\lt10$.
- Expand and differentiate: find $V'(x)$ and the value of $x$ in $(0,10)$ where $V'(x)=0$. Compute $V$ there.
- Make boxes from card (or paper) with $x=1,2,3,10/3,4,5\ \text{cm}$. Measure each volume by filling it with rice or dried lentils and pouring into a measuring jug.
- Tabulate $x$, the measured volume, the formula $V(x)$ and the sign of $V'(x)$. Plot $V$ against $x$.
- Describe the shape of the graph near the point where $V'=0$.
Tools: Card, ruler, scissors, tape, rice or lentils, a measuring jug, a spreadsheet
Hand in: Your derivative working, the table and graph, a photo of your boxes, and a paragraph explaining what the sign of $V'(x)$ tells you on either side of the special value.
Going further. Repeat for a rectangular card of $20\ \text{cm}\times30\ \text{cm}$. Is the best cut still a sixth of the shorter side?
🧪 Self-check quiz
Q1. $\dfrac{d}{dx}\left(x^6\right)$ is
Q2. The product rule says $(uv)'$ equals
Q3. $\dfrac{d}{dx}(\tan x)$ is
Q4. The derivative of $\dfrac{x}{x+1}$ at $x=0$ is
Q5. The slope of the tangent to $y=x^3$ at $x=-1$ is