The exponential function, and why $e$
Is there a base $a$ for which the derivative of $a^{x}$ is $a^{x}$ itself?
Let $a>0$ and consider $f(x)=a^{x}.$ Because $a^{x+h}=a^{x}a^{h},$ the Newton quotient factors: $$ \frac{a^{x+h}-a^{x}}{h} = a^{x}\cdot\frac{a^{h}-1}{h}\,. \tag{4.1} $$ The first factor comes straight out, and the second does not involve $x$ at all. So whatever number that second factor tends to, it is a constant, and the derivative of $a^{x}$ is $a^{x}$ times it. Everything depends on one limit.
Computing it numerically gives about $0.69$ for $a=2$ and about $1.10$ for $a=3.$ It increases with $a,$ so somewhere between $2$ and $3$ there is a base for which it is exactly $1.$
The computation, with $h=0.001$ (this table is the app's):
| base $a$ | $\dfrac{a^{h}-1}{h}$ at $h=0.001$ |
|---|---|
| $2$ | $0.6934$ |
| $2.71828$ | $1.0005$ |
| $3$ | $1.0992$ |
That base is the number $e$. The limit of the second factor of (4.1) is also the slope of the tangent to $y=a^{x}$ at the point $(0,1),$ since the first factor is $a^{0}=1$ there. The picture shows the three tangents.
Note what has happened. We did not discover $e$ somewhere and then compute its derivative; we asked which base makes the limit come out at $1$ and defined $e$ to be that base. The answer is clean because it was built to be.
$\displaystyle\frac{d}{dx}e^{x} = e^{x}$, and by the chain rule (Fact 3.16), $\displaystyle\frac{d}{dx}e^{g(x)} = e^{g(x)}\,g'(x)$.
This follows immediately from (4.1) with $a=e,$ since the second factor tends to $1$ by Definition 4.1; so $e^{x}$ is, up to a constant multiple, the only function that is its own derivative. As an instance of the chain-rule form, $\frac{d}{dx}e^{-x^{2}} = e^{-x^{2}}\cdot(-2x).$
Guess first. Before the Watch out below, which answers it, try the next question.
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
Remember that $e \approx 2.718$ is a constant.
Which pair of derivatives is correct?
- Why is that answer tempting? Applies the power rule to $e^{x}.$ The result $x\,e^{x-1}$ is the derivative of $e^{x}$ with respect to $e,$ not with respect to $x$ (Watch out 4.3).
- Why is that answer tempting? Applies the exponential rule to the power function $x^{e}.$ The mirror image of B: in $x^{e}$ the variable is in the base.
- Why is that answer tempting? Both rules swapped. A sign that “variable in the exponent” against “variable in the base” has not yet settled.
Two different animals, and the difference is which slot the variable sits in — exactly the distinction from Lecture 2:
| variable | rule | |
|---|---|---|
| $e^{x}$ | in the exponent | exponential: derivative $e^x$ |
| $x^{e}$ | in the base | power: derivative $e\,x^{e-1}$ |
$x^{e}$ is an ordinary power function — the exponent just happens to be an ugly constant, $2.718\ldots$ Nothing about it is exponential.
And $e^x$ is an ordinary exponential — the base just happens to be the one base that makes the derivative come out clean.
Since $a=e^{\ln a}$ we have $a^{x}=e^{x\ln a}$, and therefore $$ \frac{d}{dx}a^{x} = a^{x}\ln a\,. $$
There is $\ln a$ again — the same number as the limit we started from, which is why the limit was $0.69\approx\ln2$ for $a=2.$ It is a nuisance factor that equals $1$ exactly when $a=e.$ The honest way to read Fact 4.4 is that there is really only one exponential function, and every other base is that function with the clock running at a different speed; $\ln a$ is the speed. For instance $\frac{d}{dx}10^{-x} = -10^{-x}\ln10.$
Three more, each needing one of the two Facts and the chain rule. The example is the app's own, not one of the notes' numbered examples.
Exponentials and the chain rule
Differentiate $f(x)=5e^{-2x},$ $g(x)=e^{x^{2}-4x}$ and $h(x)=2^{3x}.$ Where is $g'(x)=0?$
Try it yourself first. Then open one step at a time.
$f{:}$ a constant times $e^{\text{inside}}.$ The inside $-2x$ has derivative $-2,$ so by Fact 4.2 $$ \begin{aligned} f'(x)&=5e^{-2x}\cdot(-2)\\ &=-10e^{-2x}\,. \end{aligned} $$
$g{:}$ the same rule with a longer inside. The inside $x^{2}-4x$ has derivative $2x-4{:}$ $$ g'(x)=(2x-4)\,e^{x^{2}-4x}\,. $$ An exponential is never zero, so $g'(x)=0$ exactly when $2x-4=0,$ that is at $x=2.$
$h{:}$ another base. Write $2^{3x}=e^{3x\ln2}$ as in Fact 4.4. The inside $3x\ln 2$ has derivative $3\ln2,$ a constant, so $$ h'(x)=2^{3x}\cdot3\ln2\,. $$
Which slot? In all three the variable is in the exponent, so no power rule is used on the exponential itself. The power rule appears only inside $g,$ on $x^{2}.$
$f'(x)=-10e^{-2x},$ $g'(x)=(2x-4)e^{x^{2}-4x},$ which is zero only at $x=2,$ and $h'(x)=3\ln2\cdot2^{3x}.$
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
Which of these is the derivative of $3^{x}?$
- Why is that answer tempting? The power rule, used on a function with the variable in the exponent. Watch out 4.3 says this for $e^{x},$ and it holds for every base.
- Why is that answer tempting? True only for the base $e.$ For any other base the factor $\ln a$ of Fact 4.4 stays, and $\ln 3\ne1.$
- Why is that answer tempting? The factor $\ln 3$ on the wrong side. From $3^{x}=e^{x\ln3}$ the chain rule multiplies by the derivative of the inside, $\ln 3.$
By Fact 4.4, $3^{x}=e^{x\ln3},$ and the chain rule gives $$ \frac{d}{dx}3^{x}=e^{x\ln3}\cdot\ln3=3^{x}\ln3\,. $$ At $x=0$ the slope is $\ln3\approx1.10,$ the number in the table and in the picture above.
The logarithm
There is no formula for $\ln x$ to put into a Newton quotient. How can we find its derivative anyway?
We have no formula for $\ln x$ to differentiate. What we do have is an equation it satisfies, and that turns out to be enough.
For $x>0$, $$ \frac{d}{dx}\ln x = \frac{1}{x}\,, $$ and consequently, wherever $h(x)>0$, $$ \frac{d}{dx}\ln h(x) = \frac{h'(x)}{h(x)}\,. \tag{4.2} $$
Differentiate an equation that $\ln x$ satisfies. Start from $e^{\ln x}=x,$ which is Definition 2.8, and differentiate both sides with respect to $x.$ The left-hand side needs the chain rule: $$ e^{\ln x}\cdot\frac{d}{dx}\ln x = 1\,. $$
Solve for the derivative. But $e^{\ln x}=x,$ so $x\cdot\frac{d}{dx}\ln x = 1,$ giving $\frac{d}{dx}\ln x = 1/x.$ Formula (4.2) is then the chain rule again.
Stop and notice what that argument did, because it is the join of this lecture. We had no formula for $\ln x.$ We wrote down an equation it satisfies, differentiated both sides, and solved for the derivative — never needing a formula at all. That technique has a name and a section of its own, and we come to it next.
Two consequences are free. Differentiating again, $(\ln x)'' = -1/x^{2},$ which is negative throughout, so by Fact 3.22 the graph of $\ln$ bends downwards everywhere. And $\ln$ grows absurdly slowly: $\ln x$ does not reach $10$ until $x>22\,026.$
Guess first. The next question is the example below; answer it before you read on.
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
Find $\dfrac{dy}{dx}$.
- Why is that answer tempting? Uses (ln x)′ = 1/x with no chain rule — forgets the h′(x) on top. The commonest log-differentiation error.
- Why is that answer tempting? Differentiates the inside only and forgets the logarithm entirely.
- Why is that answer tempting? Puts the inner derivative in the denominator — the chain rule upside down.
With $h(x) = 4 - x^2$ and $h'(x) = -2x$: $$y' = \frac{-2x}{4 - x^{2}} = \frac{2x}{x^{2}-4}$$
And the domain. $\ln$ needs a positive argument, so this function only exists where $4 - x^2 > 0$, that is $$-2 < x < 2$$ Outside that interval there is nothing to differentiate.
Where the derivative of a logarithm means anything
Differentiate $y=\ln(4-x^{2}),$ and say where the answer is valid.
Try it yourself first. Then open one step at a time.
With $h(x)=4-x^{2}$ and $h'(x)=-2x,$ formula (4.2) gives $$ y' = \frac{-2x}{4-x^{2}} = \frac{2x}{x^{2}-4}\,. $$
The function itself exists only where $4-x^{2}>0,$ that is on the interval $-2<x<2,$ and that is where the derivative means anything. Outside it there is nothing to differentiate.
$y'=\dfrac{2x}{x^{2}-4},$ valid only for $-2<x<2.$
Observe the shape of (4.2): $h'/h$ is the relative rate of change of $h$ from Definition 3.14. Differentiating a logarithm and taking a relative rate are the same operation, which is why Fact 3.15 looked so much like the logarithm rules. We are about to exploit that.
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
For $x>0,$ what is the derivative of $\ln(3x)?$
- Why is that answer tempting? This is $1/h$ with $h=3x{:}$ the $h'=3$ on top is lost, the first error of Watch out 4.6.
- Why is that answer tempting? The $h'=3$ is on top, but the denominator should be $h(x)=3x,$ not $x.$
- Why is that answer tempting? Comes from $\ln(3x)=\ln3\cdot\ln x,$ which is not a rule. The logarithm of a product is a sum (Fact 2.9).
With $h(x)=3x$ and $h'(x)=3,$ formula (4.2) gives $$ \frac{d}{dx}\ln(3x)=\frac{3}{3x}=\frac{1}{x}\,. $$ The same from Fact 2.9: $\ln(3x)=\ln3+\ln x,$ and the constant $\ln 3$ disappears when we differentiate. The graph of $\ln(3x)$ is the graph of $\ln x$ moved up by $\ln3,$ so the slopes are the same.
Recap e and ln: the whole card
Everything on this card has now been derived; nothing on it is new. (The card is the app's, from the lecture's slides.)
| function | derivative |
|---|---|
| $e^{x}$ | $e^{x}$ |
| $e^{g(x)}$ | $e^{g(x)}\,g'(x)$ |
| $a^{x}$ | $a^{x}\ln a$ |
| $\ln x$ | $\dfrac{1}{x}$ for $x>0$ |
| $\ln g(x)$ | $\dfrac{g'(x)}{g(x)}$ where $g(x)>0$ |
| $\log_{a}x$ | $\dfrac{1}{x\ln a}$ for $x>0$ |
The first is Fact 4.2, the second the chain rule on top of it, the third Fact 4.4, and the next two are Fact 4.5. The last follows from Lecture 2's $\log_{a}x=\ln x/\ln a{:}$ a constant times $\ln x.$ Two identities carry the whole card: $$ e^{\ln x}=x\quad(x>0)\,,\qquad a^{x}=e^{x\ln a}\,. $$
Implicit differentiation
The curve $y^{3}+3x^{2}y=13$ passes through $(2,1).$ What is its slope there, when $y$ cannot be solved for?
The circle $x^{2}+y^{2}=25$ defines $y$ implicitly near $(3,4),$ and there one could solve, $y=\sqrt{25-x^{2}}.$ The curve $y^{3}+3x^{2}y=13$ also defines $y$ implicitly, and there one cannot solve in any way worth having. The point of the method is that it does not care which case you are in.
Try it before the example. The circle is part (a) of the example below. Differentiate both sides, and ask first what $\frac{d}{dx}\bigl(y^{2}\bigr)$ is.
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
The circle $$x^{2} + y^{2} = 25$$ passes through the point $(3, 4)$.
What is the slope of the tangent there?
- Why is that answer tempting? Right method, inverted answer: reports −y/x instead of −x/y. Easy to catch from a sketch.
- Why is that answer tempting? Loses the minus sign. The tangent at a point in the first quadrant of a circle must slope downward — a sketch kills this.
- Why is that answer tempting? The belief implicit differentiation exists to remove. Worth respecting: it is what every previous method required.
A free check: the radius to $(3,4)$ has slope $4/3,$ and a tangent is perpendicular to the radius — $-\tfrac34 \times \tfrac43 = -1.$ ✓
D deserves a word. You could solve here, and it works. For $y^3 + 3x^2y = 13$ you cannot, and the method does not care.
The circle, and a curve that cannot be solved
(a) Find the slope of the tangent to the circle $x^{2}+y^{2}=25$ at $(3,4).$
(b) Find $y'$ for $y^{3}+3x^{2}y=13,$ and evaluate it at $(2,1).$
Try it yourself first. Then open one step at a time.
(a) Differentiating both sides and remembering the $y',$ $$ \begin{aligned} &2x + 2y\,y' = 0 \\ &\Longrightarrow\quad y' = -\frac{x}{y} = -\frac{3}{4}\,. \end{aligned} $$
Geometry checks this for free: the radius to $(3,4)$ has slope $4/3,$ a tangent is perpendicular to the radius, and $-\tfrac34\cdot\tfrac43=-1.$ ✓
(b) The middle term needs the product rule as well as the chain rule: $$ \begin{aligned} &3y^{2}y' + 6xy + 3x^{2}y' = 0 \\ &\Longrightarrow\quad y' = -\frac{6xy}{3y^{2}+3x^{2}} \\ &\qquad\quad\;= -\frac{2xy}{x^{2}+y^{2}}\,, \end{aligned} $$
which at $(2,1)$ is $-4/5.$ Solving the original cubic for $y$ would have been miserable, and was never needed.
(a) The slope is $-\tfrac34.$
(b) $y'=-\dfrac{2xy}{x^{2}+y^{2}},$ which is $-\tfrac45$ at $(2,1).$
The geometry check of part (a), drawn. At a point of the circle in the first quadrant the circle is falling, so the slope must be negative; and it is steeper than $-1$ exactly where $y<x.$ At $(3,4)$ we have $y>x,$ so the slope lies between $-1$ and $0{:}$ $-\tfrac34$ passes both tests.
Addition: differentiating implicitly a second time. This is not in the lecture notes. Implicit differentiation as in Method 4.9 stops at $y',$ but the equation we get in its first step holds for every $x$ near the point, so it can be differentiated once more. Every $y$ and every $y'$ in it is a function of $x{:}$ a $y$ leaves a $y'$ behind, as before, and a $y'$ leaves a $y''.$ Then insert the point and the value of $y'$ already found, and solve for $y''$ — again a linear equation. This is what the second derivative of a function given by an equation needs, and the Taylor polynomials at the end of this lecture use it.
The second derivative of the curve of Example 4.11(b)
The equation $y^{3}+3x^{2}y=13$ defines $y$ as a function of $x$ near $(2,1),$ with $y'(2)=-\tfrac45$ by Example 4.11. Find $y''(2).$
Try it yourself first. Then open one step at a time.
Start from the differentiated equation. Dividing the equation of Example 4.11(b) by $3$ gives $$ y^{2}y' + 2xy + x^{2}y' = 0\,. \tag{1} $$ It holds for every $x$ near $2,$ so we may differentiate it.
Differentiate (1) term by term. Each term is a product, and each $y$ or $y'$ in it is a function of $x{:}$ $$ \begin{aligned} \bigl(y^{2}y'\bigr)' &= 2y\,(y')^{2} + y^{2}y''\,,\\ \bigl(2xy\bigr)' &= 2y + 2x\,y'\,,\\ \bigl(x^{2}y'\bigr)' &= 2x\,y' + x^{2}y''\,. \end{aligned} $$
Insert $x=2,$ $y=1$ and $y'=-\tfrac45.$ The three lines become $$ \begin{aligned} &\tfrac{32}{25} + y'' \\ &\quad+ 2 - \tfrac{16}{5} \\ &\quad- \tfrac{16}{5} + 4y'' = 0\,. \end{aligned} $$
Solve for $y''.$ The numbers add up to $\tfrac{32}{25}+2-\tfrac{32}{5}=-\tfrac{78}{25},$ so $5y''=\tfrac{78}{25}$ and $$ y''(2)=\frac{78}{125}\,. $$ It is positive, so by Fact 3.22 the curve bends upwards near $(2,1)$ while it falls with slope $-\tfrac45.$
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
On the circle $x^{2}+y^{2}=25,$ differentiating once gave $2x+2y\,y'=0.$ What do we get by differentiating this equation once more with respect to $x?$
- Why is that answer tempting? $2y\,y'$ is a product of two functions of $x,$ and only one of them was differentiated. The product rule gives two terms.
- Why is that answer tempting? The product of the two derivatives, $y'$ times $y'',$ is the error of Watch out 3.9: $(fg)'\ne f'g'.$
- Why is that answer tempting? Here $y'$ was treated as a constant. Like $y,$ it is a function of $x,$ and it leaves a $y''$ behind.
The term $2y\,y'$ is a product of $y$ and $y',$ both functions of $x.$ By the product rule, its derivative is $2y'\cdot y'+2y\cdot y''.$ So $$ 2+2(y')^{2}+2y\,y''=0\,. $$ At $(3,4),$ with $y'=-\tfrac34{:}$ $2+\tfrac98+8y''=0,$ so $y''=-\tfrac{25}{64}.$ It is negative, and indeed the upper half of the circle bends downwards.
Logarithmic differentiation, and the power rule in general
What is the derivative of $x^{x}?$ Neither the power rule nor the exponential rule applies.
The same idea handles functions where neither of our two rules applies at all. What is $\frac{d}{dx}x^{x}$? The power rule needs a constant exponent and the exponential rule a constant base; here the variable sits in both slots.
Differentiating $x^{x}$
Differentiate $y=x^{x}$ for $x>0.$
Try it yourself first. Then open one step at a time.
Taking logarithms, $\ln y = x\ln x.$
Differentiating both sides, the left by (4.2) and the right by the product rule, $$ \frac{y'}{y} = \ln x + x\cdot\frac1x = \ln x + 1\,, $$
and therefore $y' = x^{x}\bigl(\ln x+1\bigr).$
$y'=x^{x}\bigl(\ln x+1\bigr)$ for $x>0.$
The $y'/y$ in step (2) is Lecture 3's relative rate once more. Taking logarithms and then differentiating is precisely how the relative-rate rules arose there, so the technique is not new machinery but an old identity used forwards.
This also settles a debt. The power rule was proved from the definition only for whole-number exponents, and Lecture 3 promised the general case here.
For every real number $a$ and every $x>0$, $$ \frac{d}{dx}x^{a} = a\,x^{a-1}\,. $$
Write $x^{a}=e^{a\ln x},$ which is legitimate for $x>0,$ and differentiate with Fact 4.2 and (4.2): $$ \begin{aligned} \frac{d}{dx}e^{a\ln x} &= e^{a\ln x}\cdot\frac{a}{x} \\ &= x^{a}\cdot\frac{a}{x} = a\,x^{a-1}\,. \end{aligned} $$
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
Let $y=x^{2x}$ for $x>0.$ Taking logarithms gives $\ln y=2x\ln x.$ What is $y'?$
- Why is that answer tempting? This is $y'/y,$ the left-hand side after step 2 of Method 4.12. Step 3 still has to multiply by $y=x^{2x}.$
- Why is that answer tempting? The power rule, which needs a constant exponent. Here the exponent $2x$ varies.
- Why is that answer tempting? Only one factor of $2x\ln x$ was differentiated. The product rule gives $2\ln x$ and $2x\cdot\frac1x=2.$
This is logarithmic differentiation. Differentiate $\ln y=2x\ln x$ implicitly. The left gives $y'/y$ by (4.2), the right gives $2\ln x+2x\cdot\frac1x$ by the product rule: $$ \frac{y'}{y}=2\ln x+2\,. $$ Multiply by $y=x^{2x}{:}$ $y'=x^{2x}(2\ln x+2).$ A check at $x=1{:}$ $y'(1)=1\cdot2=2.$
Linear approximation
Without a calculator: what is $\sqrt[3]{1.03}$ to three decimal places?
Everything so far has computed derivatives. We now use one. The idea is to replace a function that is hard to evaluate by a function that is easy, accepting an error in exchange, and the simplest easy function is a straight line.
If $f$ is differentiable at $a$, then for $x$ near $a$, $$ f(x) \;\approx\; f(a) + f'(a)(x-a)\,. \tag{4.3} $$
Guess first. The next question asks in what sense this is the best line. The paragraph after it gives the notes' answer.
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
This is called the best linear approximation to $f$ about $a$.
In what sense is it best?
- Why is that answer tempting? That is the regression line of statistics, fitted by least squares. A genuinely different object, and easy to confuse with this one if you have met a scatterplot.
- Why is that answer tempting? There are infinitely many lines through a point. Confuses ‘passes through’ with ‘determined by’.
- Why is that answer tempting? A real and different notion of best approximation, and not this one. Taylor is local; this criterion is global.
It is best in a local sense: of all the straight lines in the world, exactly one passes through $(a, f(a))$ and has slope $f'(a)$, and that one hugs $f$ more closely near $a$ than any other line can.
That is the pattern of the whole section. Linear matches $f$ and $f'$. Quadratic matches $f$, $f'$ and $f''$. The degree-$n$ Taylor polynomial matches the first $n$ derivatives. Approximation here means agreeing to high order at one point — not fitting well on average.
Why A is worth naming. The line closest to $f$ on average is the regression line, and it is a different object built for a different job: it uses all the data and may pass nowhere near $(a, f(a))$. You will meet it in statistics. Do not let the two words "best fit" merge.
The right-hand side is the tangent line at $a,$ met in Lecture 2 and now used as a tool rather than described as a picture. Why this line and no other? Because infinitely many lines pass through the point $\bigl(a,f(a)\bigr),$ but exactly one of them also has slope $f'(a);$ it is the only line that agrees with $f$ in both value and slope at $a,$ and that is what makes it the linear approximation rather than merely a linear approximation.
A cube root without a calculator
Estimate $\sqrt[3]{1.03}$ without a calculator.
Try it yourself first. Then open one step at a time.
Take $f(x)=x^{1/3}$ about $a=1,$ where the cube root is known. By Fact 4.14, $f'(x)=\tfrac13x^{-2/3},$ so $f(1)=1$ and $f'(1)=\tfrac13.$
Then (4.3) gives $$ \begin{aligned} &\sqrt[3]{x} \;\approx\; 1 + \tfrac13(x-1)\,, \qquad\text{so} \\ &\sqrt[3]{1.03} \approx 1 + \tfrac13(0.03) = 1.01\,. \end{aligned} $$
The true value is $1.0099\ldots,$ so one derivative and no calculator have produced three correct decimal places.
$\sqrt[3]{1.03}\approx1.01,$ against the true $1.0099\ldots$
Recap Doubling time, from Lecture 2
Money growing at $p\%$ a year is multiplied by $a=1+p/100$ every year. It has doubled after $t$ years when $a^{t}=2.$ Taking $\ln$ of both sides brings the unknown down out of the exponent, $t\ln a=\ln2,$ so the doubling time is $$ t^{*}=\frac{\ln2}{\ln a}=\frac{\ln2}{\ln\bigl(1+\frac{p}{100}\bigr)}\,. $$ That is Fact 2.13. It is exact, and it needs two logarithms: no use at a dinner table.
Guess first. Turn that exact formula into one you can use in your head.
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
Money grows at $p\%$ a year, so the doubling time is $$t^{*} = \frac{\ln 2}{\ln(1 + p/100)}$$
Using $\ln(1+x) \approx x$ and $\ln 2 \approx 0.7$, this becomes:
- Why is that answer tempting? Multiplies where it should divide. Fails a sanity check instantly: it would make higher interest rates take longer to double.
- Why is that answer tempting? Inverts the fraction. At p = 3.5 it predicts doubling in 0.05 years.
- Why is that answer tempting? Approximates the numerator and forgets the denominator entirely.
Check it at $p = 3.5{:}$ the rule gives $20$ years, the exact formula $20.1.$
Sanity first. A higher interest rate must give a shorter doubling time, so $p$ has to be in the denominator. That kills A and C before any algebra.
The rule of 70
Show that a quantity growing at $p\%$ per period doubles in roughly $70/p$ periods.
Try it yourself first. Then open one step at a time.
Apply (4.3) to $f(x)=\ln(1+x)$ about $a=0.$ Here $f(0)=0$ and, by (4.2), $f'(0)=1,$ so $$ \ln(1+x) \approx x \qquad\text{for small } x\,. $$
The doubling time of Fact 2.13, with $a=1+p/100,$ is therefore $$ \begin{aligned} t^{*} &= \frac{\ln 2}{\ln\bigl(1+\tfrac{p}{100}\bigr)} \\ &\approx\; \frac{0.7}{p/100} = \frac{70}{p}\,. \end{aligned} $$
At $p=3.5$ this predicts $20$ years against the exact $20.1;$ at $p=7$ it predicts $10,$ and at $p=2,$ $35.$ Note that $\ln2=0.693$ was rounded up to $0.7{:}$ the rule is engineered for mental arithmetic, and $70$ has friendlier divisors than $69.$
The doubling time is about $\dfrac{70}{p}$ periods, from $\ln(1+x)\approx x$ and $\ln2\approx0.7.$
Every economist knows that rule. Rather fewer know it is a linear approximation.
How good is the rule? A table from the lecture's slides (the app's addition), with the exact $t^{*}=\ln2/\ln(1+p/100)$ to one decimal:
| $p$ | $70/p$ | exact |
|---|---|---|
| $2$ | $35.0$ | $35.0$ |
| $5$ | $14.0$ | $14.2$ |
| $7$ | $10.0$ | $10.2$ |
| $10$ | $7.0$ | $7.3$ |
| $20$ | $3.5$ | $3.8$ |
| $50$ | $1.4$ | $1.7$ |
Two roundings pull opposite ways. $\ln(1+x)<x$ for $x>0,$ so replacing $\ln(1+x)$ by $x$ makes the denominator too large and the answer too small; rounding $0.693$ up to $0.7$ pushes it back. Below about $10\%$ the two nearly cancel. Above it the first wins, and at $p=50$ the rule is about $18\%$ too low: “near $a=0$” has run out.
Taylor polynomials
A straight line can match the value and the slope of $f$ at a point. What can a parabola match?
A line matches $f$ in value and slope. A parabola has one more coefficient to spend, so it can match the second derivative too, and the pattern continues.
Here $k!$ (“$k$ factorial”) is the product $1\cdot2\cdots k,$ with $0!=1{:}$ so $2!=2$ and $3!=6.$ The case $n=1$ of the Taylor polynomial is the tangent line of Fact 4.15.
$P_{n}$ is the unique polynomial of degree at most $n$ whose value and first $n$ derivatives at $a$ agree with those of $f$: $$ P_{n}^{(k)}(a) = f^{(k)}(a)\qquad\text{for } k=0,1,\ldots,n\,, $$ and $f(x)\approx P_{n}(x)$ for $x$ near $a$. The case $n=1$ is (4.3).
The quadratic case. Take the quadratic case, which contains the whole idea. Write $p(x)=A+B(x-a)+C(x-a)^{2}.$ Then $p(a)=A,$ $p'(a)=B$ and $p''(a)=2C,$ so matching $f(a),$ $f'(a)$ and $f''(a)$ forces $A=f(a),$ $B=f'(a)$ and $C=f''(a)/2.$
Where the $k!$ comes from. The coefficient of $(x-a)^{k}$ in general is divided by $k!$ for the same reason: differentiating $(x-a)^{k}$ down to a constant produces the factor $k!.$
For $f(x)=e^{x}$ about $a=0$ every derivative is $e^{x},$ hence every $f^{(k)}(0)=1,$ and (4.4) is as clean as it gets: $$ \begin{aligned} e^{x} \;\approx\; 1 &+ x + \frac{x^{2}}{2} + \frac{x^{3}}{6} \\ &+ \cdots + \frac{x^{n}}{n!}\,. \end{aligned} $$ This one is worth committing to memory; it reappears in statistics, in finance, and in Lecture 5.
Adding terms
A function, its centre $a$ and its Taylor polynomial of degree $n.$ The shaded band on the $x$-axis is where the polynomial is within $0.1$ of the function, and its width is printed.
- Raise degree n one step at a time and watch the band widen.
- Move centre a. The band travels with it: the approximation is good near $a,$ wherever $a$ is, and nowhere else.
- Press the function button until it shows $1/(1-x),$ set $a=0,$ and push $n$ high. The band grows towards $x=1$ and then stops, however many terms you add.
More terms, near the centre and far from it
Estimate $e^{0.1}$ using Taylor polynomials of degree $1,$ $2$ and $3$ about $a=0,$ and compare with the true value $1.1051709\ldots$
Try it yourself first. Then open one step at a time.
From the series above, $$ \begin{aligned} P_{1}(0.1) &= 1.1\,,\\ P_{2}(0.1) &= 1.1 + \tfrac{0.01}{2} = 1.105\,,\\ P_{3}(0.1) &= 1.105 + \tfrac{0.001}{6} \\ &= 1.10516\ldots \end{aligned} $$
The errors are about $5\times10^{-3},$ $1.7\times10^{-4}$ and $4\times10^{-6}{:}$ each extra term buys roughly another two decimal places at this value of $x$.
At $x=3$ the same three polynomials give $4,$ $8.5$ and $13$ against a true value of $20.1,$ and the accuracy is not there at all.
$1.1,$ $1.105$ and $1.10516\ldots$ against $1.1051709\ldots{:}$ excellent at $x=0.1,$ useless at $x=3.$
Note also what has not been said. The symbol $\approx$ has been used throughout without once bounding the error, which is the difference between a rule of thumb and mathematics. Fact 5.4 supplies the bound.
Definition 4.19 needs only the numbers $f(a),$ $f'(a),$ $f''(a),\ldots,$ not a formula for $f.$ So it applies just as well to a function given by an equation, once the derivatives at the point are known. The next example is the app's own and uses the addition of the section on implicit differentiation.
A Taylor polynomial for a function given by an equation
The equation $y^{3}+3x^{2}y=13$ defines $y$ as a function of $x$ near $x=2,$ with $y(2)=1.$ Find the Taylor polynomial of degree $2$ of $y$ about $x=2,$ and use it to estimate $y(2.1).$
Try it yourself first. Then open one step at a time.
The three numbers. $y(2)=1,$ $y'(2)=-\tfrac45$ (Example 4.11) and $y''(2)=\tfrac{78}{125}$ (the addition after it).
Definition 4.19 with $n=2$ and $a=2.$ The second derivative is divided by $2!=2{:}$ $$ \begin{aligned} P_{2}(x) &= 1-\tfrac45(x-2) \\ &\quad+\tfrac{39}{125}(x-2)^{2}\,. \end{aligned} $$
The estimate. At $x=2.1$ we have $x-2=0.1,$ so $$ \begin{aligned} y(2.1) &\approx 1-0.08+0.00312 \\ &= 0.92312\,. \end{aligned} $$ The tangent line alone gives $0.92.$ Solving the cubic $y^{3}+13.23\,y=13$ numerically gives $y(2.1)=0.92315\ldots,$ so the second-degree term has bought two more correct decimals.
$P_{2}(x)=1-\tfrac45(x-2)+\tfrac{39}{125}(x-2)^{2},$ and $y(2.1)\approx0.9231.$
Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.
A function has $f(1)=2,$ $f'(1)=-1$ and $f''(1)=6.$ What is its Taylor polynomial of degree $2$ about $a=1?$
- Why is that answer tempting? The second derivative is divided by $2!=2$ in (4.4). Without it, $P_{2}''(1)$ would be $12,$ not $6.$
- Why is that answer tempting? Powers of $x$ instead of $(x-1).$ That is the Taylor polynomial about $0,$ and it is built from numbers at $1{:}$ the centre and the variable are mixed up.
- Why is that answer tempting? The sign of $f'(1)=-1$ is lost. The coefficient of $(x-a)$ is $f'(a)$ itself.
By (4.4) with $n=2$ and $a=1,$ $$ \begin{aligned} P_{2}(x)&=f(1)+f'(1)(x-1)\\ &\quad+\frac{f''(1)}{2}(x-1)^{2}\,, \end{aligned} $$ that is $2-(x-1)+3(x-1)^{2}.$ A check by Fact 4.20: $P_{2}(1)=2,$ $P_{2}'(1)=-1$ and $P_{2}''(1)=2\cdot3=6.$
What you should take away
- The Newton quotient of $a^{x}$ factors as $a^{x}\cdot(a^{h}-1)/h,$ so everything depends on $\lim_{h\to0}(a^{h}-1)/h.$ That limit is $\ln a;$ it equals $1$ exactly when $a=e,$ and that is what defines $e$. Hence $(e^{x})'=e^{x},$ and $(a^{x})'=a^{x}\ln a$ for every other base.
- $(\ln x)'=1/x,$ obtained by differentiating $e^{\ln x}=x;$ more generally $\bigl(\ln h(x)\bigr)' = h'(x)/h(x),$ which is the relative rate of change of $h.$ Check where $\ln h$ is defined before differentiating it.
- Implicit differentiation: differentiate both sides treating $y$ as a function of $x$ — every $y$ leaves a $y'$ — then solve for $y'.$ It needs no formula for $y,$ which is the point.
- Logarithmic differentiation: take logs, differentiate implicitly to get $y'/y,$ multiply back. It handles $x^{x},$ where neither the power rule nor the exponential rule applies, and it finishes the power rule: $(x^{a})'=ax^{a-1}$ for every real $a.$
- $f(x)\approx f(a)+f'(a)(x-a)$ near $a$ — the tangent line used as a tool, and the only line matching both value and slope at $a.$ Applied to $\ln(1+x)$ it gives the rule of 70.
- The Taylor polynomial $\sum_{k\le n} f^{(k)}(a)(x-a)^{k}/k!$ matches the first $n$ derivatives at $a;$ for $e^{x}$ about $0$ it is $1+x+x^{2}/2+\cdots+x^{n}/n!.$ It is accurate near $a$ and can be badly wrong away from it — and no error bound has been given yet.
Think further
Questions without computation. Think on your own or with a classmate before opening the thought.
Discussion question 1 — the exponent or the base
Which pair is correct?
(A) $\displaystyle\frac{d}{dx}e^{x}=e^{x}$ and $\displaystyle\frac{d}{dx}x^{e}=e\,x^{e-1};$
(B) $\displaystyle\frac{d}{dx}e^{x}=xe^{x-1}$ and $\displaystyle\frac{d}{dx}x^{e}=e\,x^{e-1};$
(C) $\displaystyle\frac{d}{dx}e^{x}=e^{x}$ and $\displaystyle\frac{d}{dx}x^{e}=x^{e}\ln x;$
(D) $\displaystyle\frac{d}{dx}e^{x}=xe^{x-1}$ and $\displaystyle\frac{d}{dx}x^{e}=x^{e}\ln x.$
One way to think about it
(A). In $e^{x}$ the variable is in the exponent, so Fact 4.2 applies and the derivative is $e^{x}$ itself. In $x^{e}$ the variable is in the base and the exponent is the constant $e=2.718\ldots,$ so it is a power function and Fact 4.14 gives $e\,x^{e-1}.$ (B) uses the power rule on $e^{x}$ (Watch out 4.3); (C) uses an exponential rule on $x^{e};$ (D) does both.
Discussion question 2 — a logarithm and its domain
Differentiate $\ln(x^{2}-9),$ and state where your answer is valid.
One way to think about it
With $h(x)=x^{2}-9$ and $h'(x)=2x,$ formula (4.2) gives $$ \frac{d}{dx}\ln(x^{2}-9)=\frac{2x}{x^{2}-9}\,. $$ The logarithm needs $x^{2}-9>0,$ that is $x<-3$ or $x>3.$ The answer is valid on those two intervals and nowhere else. Between $-3$ and $3$ the formula $\dfrac{2x}{x^{2}-9}$ still produces numbers, for example $0$ at $x=0,$ but there is no function there to be the derivative of (Watch out 4.6).
Discussion question 3 — where the circle stands upright
In Example 4.11(a), what happens to $y'=-x/y$ at the points $(\pm5,0),$ and what does the circle look like there?
One way to think about it
At $(\pm5,0)$ the denominator $y$ is zero, and $-x/y$ is not defined: the differentiated equation $2x+2y\,y'=0$ reads $\pm10=0$ whatever $y'$ is. The circle has a vertical tangent there, and a vertical line has no slope.
It also stops being a function of $x$ there. Just inside $x=5$ there are two values of $y,$ one above and one below the axis, and just outside there are none. So no part of the circle near $(5,0)$ is defined implicitly in the sense of Definition 4.8, and there is no $y'$ to find.
Discussion question 4 — logarithmic differentiation on a product
Use logarithmic differentiation on $y = x^{2}e^{3x}/(1+x).$ Which step of Method 4.12 does the real work?
One way to think about it
Take $x>0,$ so that every logarithm below exists. By Fact 2.9, $$ \ln y=2\ln x+3x-\ln(1+x)\,. $$ Differentiating both sides, $$ \frac{y'}{y}=\frac{2}{x}+3-\frac{1}{1+x}\,, $$ and multiplying by $y,$ $$ \begin{aligned} y'&=y\,\Bigl(\frac{2}{x}+3-\frac{1}{1+x}\Bigr)\,,\\ y&=\frac{x^{2}e^{3x}}{1+x}\,. \end{aligned} $$ Step 1 does the real work. Taking logarithms turns the product and the quotient into a sum and a difference, and the exponential into the plain term $3x;$ after that each term is differentiated on its own, with no product or quotient rule at all.
Discussion question 5 — eliminating before computing
Money grows at $p\%$ a year. Using $\ln(1+x)\approx x$ and $\ln2\approx0.7,$ the doubling time is about
(A) $70p;$
(B) $p/70;$
(C) $0.7p;$
(D) $70/p.$
Which of these can you eliminate before doing any algebra, and why?
One way to think about it
(D), by Example 4.18. Before any algebra: a higher interest rate must double the money sooner, so the doubling time must fall as $p$ rises. That eliminates (A) and (C), which grow with $p.$ (B) falls as $p$ rises, but its size is absurd: at $p=3.5$ it gives $0.05$ years, about two and a half weeks. Only (D) survives the two checks.
Discussion question 6 — best in what sense
In what sense is $f(a)+f'(a)(x-a)$ the best linear approximation to $f$ about $a$? How many lines pass through $\bigl(a,f(a)\bigr),$ and how many of those have slope $f'(a)$?
One way to think about it
Infinitely many lines pass through $\bigl(a,f(a)\bigr),$ and exactly one of them has slope $f'(a).$ That one agrees with $f$ in value and slope at $a,$ and no other line does: it is best in the sense of agreeing with $f$ to the highest order at the point $a$. It is not best on average over a range (that is the regression line of statistics), and nothing is promised far from $a$ (Watch out 4.16).
Discussion question 7 — no Taylor polynomial at 0
The Taylor polynomial of $\ln x$ about $a=1$ has degree-$n$ term $(-1)^{n-1}(x-1)^{n}/n.$ Why can there be no Taylor polynomial for $\ln x$ about $a=0$?
One way to think about it
Definition 4.19 needs the numbers $f(a),$ $f'(a),\ldots$ at the centre. But $\ln x$ is defined only for $x>0{:}$ there is no $\ln0,$ and no derivative at $0$ either, since $1/x$ has no value there. With nothing to match, there is no polynomial.
About $a=1$ everything exists: $\ln1=0,$ and the derivatives are $1/x,$ $-1/x^{2},$ $2/x^{3},\ldots,$ which at $1$ give $1,$ $-1,$ $2,\ldots$ Divided by $1!,$ $2!,$ $3!,\ldots$ these give the coefficients $1,$ $-\tfrac12,$ $\tfrac13,\ldots,$ that is $(-1)^{n-1}/n.$