MAT1051 · Week 5 · Introduction to the Derivative, the Product Rule and the Quotient Rule

The definition of the derivative, product and quotient rules

Computing the derivative from the limit definition, the tangent line, differentiability, the power rule, and the product and quotient rules. A 'Use the definition' question is almost certain on the midterm.

derivativedifference quotienttangent linedifferentiablepower ruleproduct rulequotient rulehigher-order derivativevelocityacceleration

The derivative means “instantaneous rate of change” and “slope of the tangent line”. This week you learn two things: computing the derivative from the definition (as a limit) and computing it quickly with rules. On exams they are asked separately. If the question says “Use the definition”, an answer found with a rule gets no points. The key points:

  1. Definition: f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x)=\lim_{h\to0}\dfrac{f(x+h)-f(x)}{h}. It always gives 00\tfrac00, and you cancel hh with algebra.
  2. Tangent line: y−f(a)=f′(a)(x−a)y-f(a)=f'(a)(x-a).
  3. Write roots and fractions as powers first, then use the power rule.
  4. The derivative of a product is not the product of the derivatives. (fg)′=f′g+fg′(fg)'=f'g+fg'.
  5. In the quotient rule, order matters: f′g−fg′g2\dfrac{f'g-fg'}{g^2}.

The definition of the derivative

The derivative of ff at the point aa:

f′(a)=lim⁡h→0f(a+h)−f(a)hf'(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}

The fraction is the slope of the secant line through the points aa and a+ha+h. As hh goes to zero, the secant line turns into the tangent line. If the limit exists, ff is differentiable at aa.

Notations: f′(x)f'(x), y′y', dydx\dfrac{dy}{dx}, ddxf(x)\dfrac{d}{dx}f(x).

Computing from the definition: three types

Example 1 (polynomial). f(x)=x2f(x)=x^2, a=3a=3.

f(3+h) = 9 + 6h + h^2
f(3+h) - f(3) = 6h + h^2
[ ... ] / h = 6 + h
h -> 0:  f'(3) = 6

The tangent line passes through (3,9)(3,9) with slope 66: y−9=6(x−3)y-9=6(x-3), that is y=6x−9y=6x-9.

Example 2 (fraction). f(x)=1xf(x)=\dfrac1x. Find a common denominator:

1h(1x+h−1x)=1h⋅x−(x+h)x(x+h)=−1x(x+h) →h→0 −1x2\frac{1}{h}\left(\frac{1}{x+h}-\frac1x\right)=\frac1h\cdot\frac{x-(x+h)}{x(x+h)}=\frac{-1}{x(x+h)}\ \xrightarrow{h\to0}\ -\frac{1}{x^2}

Example 3 (root). f(x)=xf(x)=\sqrt x. Multiply by the conjugate:

x+h−xh⋅x+h+xx+h+x=hh(x+h+x) →h→0 12x\frac{\sqrt{x+h}-\sqrt x}{h}\cdot\frac{\sqrt{x+h}+\sqrt x}{\sqrt{x+h}+\sqrt x}=\frac{h}{h(\sqrt{x+h}+\sqrt x)}\ \xrightarrow{h\to0}\ \frac{1}{2\sqrt x}

PITFALL · setting hh to zero too early. If you put h=0h=0 before hh has completely left the denominator, you get 00\tfrac00. Simplify first, then take the limit.

The derivative is also a function

When you put the variable xx in place of aa, f′(x)f'(x) becomes a new function: it assigns to each point the slope at that point. That is why you can read the graph of the derivative from the graph of ff:

  • if ff is increasing, f′>0f'>0 (the graph is above the axis),
  • if ff is decreasing, f′<0f'<0,
  • at a peak or valley of ff there is a horizontal tangent, f′=0f'=0.

The exam question “which of the following graphs is the graph of f′f'?” is solved with these three sentences. In week 9 you will use the same idea in reverse and sketch the shape of ff from the sign of f′f'.

There is also a difference between average and instantaneous change. The average rate of change on the interval [a,b][a,b] is f(b)−f(a)b−a\dfrac{f(b)-f(a)}{b-a}, the slope of the secant. The instantaneous rate of change is f′(a)f'(a). In physics, this is the difference between average velocity and the velocity at that moment.

Differentiability and continuity

Theorem: If ff is differentiable at aa, it is continuous at aa. The converse is not true.

The function f(x)=∣x∣f(x)=|x| is continuous at 00. But

lim⁡h→0+∣h∣h=1,lim⁡h→0−∣h∣h=−1\lim_{h\to0^+}\frac{|h|}{h}=1,\qquad \lim_{h\to0^-}\frac{|h|}{h}=-1

The one-sided derivatives differ, so f′(0)f'(0) does not exist. The graph has a corner.

Typical places where the derivative does not exist: a corner, a cusp (for example x2/3x^{2/3} at 00), a vertical tangent (x3\sqrt[3]{x} at 00), a point of discontinuity.

Differentiation rules

RuleFormula
Constant(c)′=0(c)'=0
Power rule(xn)′=nxn−1(x^n)'=nx^{n-1}, for every real nn
Constant multiple(cf)′=cf′(cf)'=cf'
Sum/difference(f±g)′=f′±g′(f\pm g)'=f'\pm g'
Product rule(fg)′=f′g+fg′(fg)'=f'g+fg'
Quotient rule(fg)′=f′g−fg′g2\left(\dfrac fg\right)'=\dfrac{f'g-fg'}{g^2}

Example 4 (power rule). y=3x4−2x+5x23y=3x^4-\dfrac2x+5\sqrt[3]{x^2}.

First write it as powers: y=3x4−2x−1+5x2/3y=3x^4-2x^{-1}+5x^{2/3}. Then:

y′=12x3+2x−2+103x−1/3=12x3+2x2+103x3y'=12x^3+2x^{-2}+\frac{10}{3}x^{-1/3}=12x^3+\frac{2}{x^2}+\frac{10}{3\sqrt[3]{x}}

Example 5 (product). y=(2x+1)(x2−3)y=(2x+1)(x^2-3).

y′=2⏟f′(x2−3)+(2x+1)2x⏟g′=2x2−6+4x2+2x=6x2+2x−6y'=\underbrace{2}_{f'}(x^2-3)+(2x+1)\underbrace{2x}_{g'}=2x^2-6+4x^2+2x=6x^2+2x-6

Example 6 (quotient). y=x2x+1y=\dfrac{x^2}{x+1}.

y′=2x(x+1)−x2⋅1(x+1)2=x2+2x(x+1)2y'=\frac{2x(x+1)-x^2\cdot1}{(x+1)^2}=\frac{x^2+2x}{(x+1)^2}

To remember the quotient rule: “bottom times derivative of top, minus top times derivative of bottom, over bottom squared”.

Where do the rules come from?

The power rule comes from applying the binomial expansion to the definition: (x+h)n=xn+nxn−1h+(…)(x+h)^n=x^n+nx^{n-1}h+(\ldots), where the part in parentheses contains terms with h2h^2 and higher powers. When the difference is divided by hh, nxn−1nx^{n-1} remains, and every other term goes to zero because it contains hh.

For the product rule, in the definition you add and subtract the term f(x+h)g(x)f(x+h)g(x):

f(x+h)g(x+h)−f(x)g(x)h=f(x+h)g(x+h)−g(x)h+g(x)f(x+h)−f(x)h\frac{f(x+h)g(x+h)-f(x)g(x)}{h}=f(x+h)\frac{g(x+h)-g(x)}{h}+g(x)\frac{f(x+h)-f(x)}{h}

As h→0h\to0 the first term becomes f(x)g′(x)f(x)g'(x) and the second becomes g(x)f′(x)g(x)f'(x). (The part f(x+h)→f(x)f(x+h)\to f(x) comes from a differentiable function being continuous.) The proof is rarely asked on exams, but this is the answer to “why not f′g′f'g'”.

For three factors the rule extends with the same logic: each time differentiate one factor and leave the others as they are.

(fgh)′=f′gh+fg′h+fgh′(fgh)'=f'gh+fg'h+fgh'

Example 7. For y=x(x+1)(x−2)y=x(x+1)(x-2), y′=(x+1)(x−2)+x(x−2)+x(x+1)=3x2−2x−2y'=(x+1)(x-2)+x(x-2)+x(x+1)=3x^2-2x-2. To check, expand: y=x3−x2−2xy=x^3-x^2-2x, y′=3x2−2x−2y'=3x^2-2x-2. The same.

PITFALL · an unnecessary quotient rule. For y=x3+1xy=\dfrac{x^3+1}{x}, instead of the quotient rule, divide first: y=x2+x−1y=x^2+x^{-1}, y′=2x−x−2y'=2x-x^{-2}. It is shorter and has less risk of error. If the denominator is a constant (x25\tfrac{x^2}{5}), never use the quotient rule.

Higher-order derivatives

y′′=d2ydx2y''=\dfrac{d^2y}{dx^2} is the derivative of the derivative. y′′′y''', y(4)y^{(4)}, … continue in this way.

Example 8. y=x4−2x3y=x^4-2x^3: y′=4x3−6x2y'=4x^3-6x^2, y′′=12x2−12xy''=12x^2-12x, y′′′=24x−12y'''=24x-12, y(4)=24y^{(4)}=24, y(5)=0y^{(5)}=0. For a polynomial each derivative lowers the degree by one; the (n+1)(n+1)th derivative of a polynomial of degree nn is zero.

Physical meaning: velocity and acceleration

If the position is s(t)s(t), the velocity is v(t)=s′(t)v(t)=s'(t) and the acceleration is a(t)=v′(t)=s′′(t)a(t)=v'(t)=s''(t). The sign of the velocity gives the direction: v>0v>0 forward, v<0v<0 backward. Speed is ∣v∣|v|.

Example 9. s(t)=t3−6t2+9ts(t)=t^3-6t^2+9t (meters, seconds). v(t)=3t2−12t+9v(t)=3t^2-12t+9, a(t)=6t−12a(t)=6t-12. At t=2t=2, v=12−24+9=−3v=12-24+9=-3 m/s (moving backward), a=0a=0. The object stops when v=0v=0, that is 3(t−1)(t−3)=0⇒t=13(t-1)(t-3)=0 \Rightarrow t=1 and t=3t=3.

Tangent and normal lines

At the point x=ax=a:

  • Tangent: y−f(a)=f′(a)(x−a)y-f(a)=f'(a)(x-a)
  • Normal (perpendicular to the tangent): y−f(a)=−1f′(a)(x−a)y-f(a)=-\dfrac{1}{f'(a)}(x-a), if f′(a)≠0f'(a)\ne0

The question “where is the tangent horizontal?” is the equation f′(x)=0f'(x)=0. For “tangent parallel to a given line”, you equate the slopes.

Example 10. At which point of the curve y=x2−3x+4y=x^2-3x+4 is the tangent parallel to the line y=5x−2y=5x-2?

parallel -> equal slopes:  y' = 2x - 3 = 5   ->  x = 4
point:  y(4) = 16 - 12 + 4 = 8    ->  (4, 8)
tangent:  y - 8 = 5(x - 4)        ->  y = 5x - 12

Example 11. The normal line to the curve y=xy=\sqrt x at x=4x=4. The point is (4,2)(4,2). The tangent slope is 124=14\tfrac{1}{2\sqrt4}=\tfrac14 and the normal slope is −4-4. Normal: y−2=−4(x−4)y-2=-4(x-4), that is y=−4x+18y=-4x+18.

Common mistakes

Wrong thinkingCorrect
(fg)′=f′g′(fg)'=f'g'f′g+fg′f'g+fg'
(fg)′=f′g′\left(\dfrac fg\right)'=\dfrac{f'}{g'}f′g−fg′g2\dfrac{f'g-fg'}{g^2}
The order fg′−f′gfg'-f'g in the quotientDerivative of the top first: f′g−fg′f'g-fg'; if the order is reversed the sign flips
(1x2)′=12x\left(\dfrac{1}{x^2}\right)'=\dfrac{1}{2x}(x−2)′=−2x−3(x^{-2})'=-2x^{-3}
(x)′=x/2(\sqrt x)'=\sqrt{x}/212x−1/2=12x\tfrac12x^{-1/2}=\dfrac{1}{2\sqrt x}
(π2)′=2π(\pi^2)'=2\piA constant, its derivative is 00
The question asks for the definition, but solving with a ruleIf it says “Use the definition”, show it with the limit
Continuous implies differentiable∣x∣\lvert x\rvert is continuous but has no derivative at 00
Putting f′(a)f'(a) instead of f(a)f(a) in the tangent equationThe point comes from f(a)f(a), the slope from f′(a)f'(a)

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

Use the definition of the derivative to find f′(x)f'(x) for f(x)=3x2−5xf(x)=3x^2-5x.

Show answer
f'(x) = 6x - 5

f(x+h)=3(x+h)2−5(x+h)=3x2+6xh+3h2−5x−5hf(x+h)=3(x+h)^2-5(x+h)=3x^2+6xh+3h^2-5x-5h. Difference: f(x+h)−f(x)=6xh+3h2−5hf(x+h)-f(x)=6xh+3h^2-5h. Divide by hh: 6x+3h−56x+3h-5. As h→0h\to0: f′(x)=6x−5f'(x)=6x-5.

Question 2medium

Use the definition of the derivative to find f′(x)f'(x) for f(x)=1x+2f(x)=\dfrac{1}{x+2}.

Show answer
f′(x)=−1(x+2)2f'(x)=-\dfrac{1}{(x+2)^2}

f(x+h)−f(x)h=1h(1x+h+2−1x+2)=1h⋅(x+2)−(x+h+2)(x+h+2)(x+2)=−1(x+h+2)(x+2)\dfrac{f(x+h)-f(x)}{h}=\dfrac{1}{h}\left(\dfrac{1}{x+h+2}-\dfrac{1}{x+2}\right)=\dfrac{1}{h}\cdot\dfrac{(x+2)-(x+h+2)}{(x+h+2)(x+2)}=\dfrac{-1}{(x+h+2)(x+2)}. As h→0h\to0: −1(x+2)2-\dfrac{1}{(x+2)^2}.

Question 3medium

Use the definition of the derivative to find f′(x)f'(x) for f(x)=2x+1f(x)=\sqrt{2x+1}.

Show answer
f′(x)=12x+1f'(x)=\dfrac{1}{\sqrt{2x+1}}

Multiply by the conjugate: 2x+2h+1−2x+1h⋅2x+2h+1+2x+12x+2h+1+2x+1=2hh(2x+2h+1+2x+1)\dfrac{\sqrt{2x+2h+1}-\sqrt{2x+1}}{h}\cdot\dfrac{\sqrt{2x+2h+1}+\sqrt{2x+1}}{\sqrt{2x+2h+1}+\sqrt{2x+1}}=\dfrac{2h}{h(\sqrt{2x+2h+1}+\sqrt{2x+1})}. The hh cancels; as h→0h\to0: 222x+1=12x+1\dfrac{2}{2\sqrt{2x+1}}=\dfrac{1}{\sqrt{2x+1}}.

Question 4easy

Differentiate y=4x5−3x2+6xy=4x^5-\dfrac{3}{x^2}+6\sqrt{x}.

Show answer
y′=20x4+6x3+3xy'=20x^4+\dfrac{6}{x^3}+\dfrac{3}{\sqrt x}

First write it as powers: y=4x5−3x−2+6x1/2y=4x^5-3x^{-2}+6x^{1/2}. Power rule: 20x4−3(−2)x−3+6⋅12x−1/2=20x4+6x−3+3x−1/220x^4-3(-2)x^{-3}+6\cdot\tfrac12x^{-1/2}=20x^4+6x^{-3}+3x^{-1/2}.

Question 5easy

Differentiate y=(x2+1)(x3−2x)y=(x^2+1)(x^3-2x).

Show answer
y′=5x4−3x2−2y'=5x^4-3x^2-2

Product rule: y′=2x(x3−2x)+(x2+1)(3x2−2)=2x4−4x2+3x4−2x2+3x2−2=5x4−3x2−2y'=2x(x^3-2x)+(x^2+1)(3x^2-2)=2x^4-4x^2+3x^4-2x^2+3x^2-2=5x^4-3x^2-2. Check: if you expand first, y=x5−x3−2xy=x^5-x^3-2x, and its derivative is the same.

Question 6medium

Differentiate y=3x−1x2+4y=\dfrac{3x-1}{x^2+4}.

Show answer
y′=−3x2+2x+12(x2+4)2y'=\dfrac{-3x^2+2x+12}{(x^2+4)^2}

Quotient rule: (numerator)′⋅denominator−numerator⋅(denominator)′(denominator)2=3(x2+4)−(3x−1)(2x)(x2+4)2=3x2+12−6x2+2x(x2+4)2=−3x2+2x+12(x2+4)2\dfrac{(\text{numerator})'\cdot\text{denominator}-\text{numerator}\cdot(\text{denominator})'}{(\text{denominator})^2}=\dfrac{3(x^2+4)-(3x-1)(2x)}{(x^2+4)^2}=\dfrac{3x^2+12-6x^2+2x}{(x^2+4)^2}=\dfrac{-3x^2+2x+12}{(x^2+4)^2}.

Question 7easy

Find the equation of the tangent line to y=x3−2x+1y=x^3-2x+1 at x=2x=2.

Show answer
y = 10x - 15

Point: y(2)=8−4+1=5y(2)=8-4+1=5, so (2,5)(2,5). Slope: y′=3x2−2y'=3x^2-2, y′(2)=10y'(2)=10. Line: y−5=10(x−2)⇒y=10x−15y-5=10(x-2) \Rightarrow y=10x-15.

Question 8easy

At which xx-values does y=x3−3x2−9x+2y=x^3-3x^2-9x+2 have a horizontal tangent line?

Show answer
x = -1 and x = 3

Horizontal tangent: the slope is zero. y′=3x2−6x−9=3(x2−2x−3)=3(x−3)(x+1)=0y'=3x^2-6x-9=3(x^2-2x-3)=3(x-3)(x+1)=0. x=3x=3 and x=−1x=-1.

Question 9medium

Suppose f(2)=3f(2)=3, f′(2)=−1f'(2)=-1, g(2)=4g(2)=4, g′(2)=5g'(2)=5. Find (fg)′(2)(fg)'(2) and (fg)′(2)\left(\dfrac fg\right)'(2).

Show answer
(fg)′(2)=11(fg)'(2)=11, (f/g)′(2)=−1916(f/g)'(2)=-\dfrac{19}{16}

(fg)′=f′g+fg′=(−1)(4)+(3)(5)=11(fg)'=f'g+fg'=(-1)(4)+(3)(5)=11. (fg)′=f′g−fg′g2=(−1)(4)−(3)(5)16=−1916\left(\dfrac fg\right)'=\dfrac{f'g-fg'}{g^2}=\dfrac{(-1)(4)-(3)(5)}{16}=-\dfrac{19}{16}.

Question 10hard

Find aa and bb so that f(x)={x2,x≤1ax+b,x>1f(x)=\begin{cases}x^2, & x\le 1\\ ax+b, & x>1\end{cases} is differentiable at x=1x=1.

Show answer
a = 2, b = -1

To be differentiable it must first be continuous: 1=a+b1=a+b. Then the left and right derivatives must be equal: from the left (x2)′=2x→2(x^2)'=2x\to 2, from the right (ax+b)′=a(ax+b)'=a. So a=2a=2, b=−1b=-1. (y=2x−1y=2x-1 is the tangent of the parabola at x=1x=1.)

Question 11medium

Show that f(x)=∣x−3∣f(x)=|x-3| is continuous but not differentiable at x=3x=3.

Show answer
Left derivative -1, right derivative 1; they differ.

Continuity: lim⁡x→3∣x−3∣=0=f(3)\lim_{x\to3}|x-3|=0=f(3). Derivative: f(3+h)−f(3)h=∣h∣h\dfrac{f(3+h)-f(3)}{h}=\dfrac{|h|}{h}. It is 11 as h→0+h\to0^+ and −1-1 as h→0−h\to0^-. The one-sided limits differ, so f′(3)f'(3) does not exist. The graph has a corner at x=3x=3.

Question 12hard

Find y′′y'' for y=xx+1y=\dfrac{x}{x+1} and evaluate y′′(1)y''(1).

Show answer
y′′=−2(x+1)3y''=-\dfrac{2}{(x+1)^3}, y′′(1)=−14y''(1)=-\dfrac14

y′=1⋅(x+1)−x⋅1(x+1)2=1(x+1)2=(x+1)−2y'=\dfrac{1\cdot(x+1)-x\cdot1}{(x+1)^2}=\dfrac{1}{(x+1)^2}=(x+1)^{-2}. y′′=−2(x+1)−3=−2(x+1)3y''=-2(x+1)^{-3}=-\dfrac{2}{(x+1)^3}. At x=1x=1: −28=−14-\dfrac{2}{8}=-\dfrac14.

Verification: All derivatives were checked with node (verify/MAT1051/05.mjs): the symbolic answer was compared at five different points with a numerical derivative computed by the central difference (h = 1e-5); second derivatives with the second-difference formula, one-sided derivatives with the one-sided limit of the difference quotient.

Review card

f'(x) = lim (h->0) [f(x+h) - f(x)] / h (from the definition: expand, cancel h, set h = 0) Fraction f: common denominator Root f: multiply by the conjugate Tangent line: y - f(a) = f'(a)(x - a) horizontal tangent: f'(x) = 0 Differentiable => continuous (the converse is FALSE: |x| is continuous, no derivative at 0) Corner, cusp, vertical tangent, discontinuity -> no derivative (x^n)' = n x^(n-1) for every real n; 1/x^2 = x^(-2), √x = x^(1/2) (c)' = 0 (cf)' = c f' (f ± g)' = f' ± g' PRODUCT: (fg)' = f'g + fg' QUOTIENT: (f/g)' = (f'g - fg') / g^2 (order: derivative of the TOP first, minus!) s(t) position -> v = s' velocity -> a = v' = s'' acceleration