is its own slope
At every point, the slope of equals its height there. At the height is , and central differences (lesson 2.2.2) settle on the same number.
| gap | 0.1 | 0.01 | 0.001 |
|---|---|---|---|
| central difference at 1 | 2.722815 | 2.718327 | 2.718282 |
A picture shows what this means. Every tangent to meets the -axis exactly 1 unit to the left of its point. So the run is 1 and the rise is the height, and the slope is the height divided by 1.
Tangents to at , 0 and 1. Each runs 1 along the axis and rises by the height of its point, so its slope is that height: 0.37, 1 and .
Rule: Derivative of the exponential
The slope of at every point equals its value there. The value is always positive, so always rises, and the higher it is, the faster it rises.
By the constant rule, any multiple is its own slope too: . No other exponential is.
Slide the point along below. The slope traced underneath is the same curve again.
Explore
Slide the point along the curve. Its tangent shows the slope there, and the lower graph plots that slope for every x: the derivative.
The slope of y = eˣ, which is eˣ
- Point
- (0, 1)
- Slope there
- 1
- The curve is
- rising: the slope is positive, so the slope graph is above zero
Why is the natural base
Every exponential has a slope proportional to its height. The factor is its slope at 0, which depends on the base.
| base | 2 | 3 | |
|---|---|---|---|
| slope of at 0 | 0.693147 | 1 | 1.098612 |
is the one base whose slope at 0 is exactly 1, so the factor disappears. That is the sense in which lesson 1.4.2 called natural. The section on other bases below says where 0.693147 and 1.098612 come from.
Try it
The loop prints central differences of at 1, next to itself.
The last lines estimate the slope at 0 of , and with a tiny gap, .
and the chain rule
With the chain rule of lesson 2.3.3, the exponent becomes an inner function. Its slope comes out in front, and the exponential stays as it is.
Rule: Exponential of a function
The slope of an exponential is the exponential itself, times the slope of its exponent.
The sign of decides the shape.
- , growth. has slope .
- , decay. has slope . The slope is negative, and it shrinks as the curve shrinks.
- . is a constant, with slope 0.
Divide the slope of by its value and you get , whatever is. This is the relative rate: the change per unit of as a fraction of the current size.
So , with in years, always grows at 0.05 of its size per year. Case study 2.3.7 uses this for continuous discounting.
The exponent need not be linear. has slope . The bell-shaped has slope , which is about at ; it returns in lesson 2.6.3.
With the product rule, has slope . It is 1 at and 0 at , where the curve is flat for an instant.
Try it
SymPy writes as exp(x). The loop differentiates each example of this section.
The last lines check the relative rate of , the bell curve's slope at 1, and at and 0.
has slope
undoes , so its graph is the mirror image of in the line (lessons 1.1.3 and 1.4.3). A mirror in swaps every run with its rise. So it turns a slope into .
On , the point at height 2 sits at , and its slope is its height, 2. The mirror image is the point on , so the slope there is .
The mirror in swaps run and rise. The tangent to at height 2 runs 0.5 and rises 1; its image on at runs 1 and rises 0.5.
The same happens at every point. The slope of at is one over the height of at the mirror point, and that height is .
Rule: Derivative of the logarithm
The slope is large for small and shrinks as grows. It is always positive, so always rises, more and more slowly.
| 0.5 | 1 | 2 | 4 | |
|---|---|---|---|---|
| slope | 2 | 1 | 0.5 | 0.25 |
Central differences at 2 give 0.500417, 0.500004 and 0.5 for gaps 0.1, 0.01 and 0.001.
Logs of functions
With the chain rule and the outer function , whose slope is , the log of a function has a neat derivative.
Rule: Log of a function
The slope of the inside divided by the inside: its relative rate.
- has slope .
- has slope , the same as . By the log rule of lesson 1.4.3, , and the constant has slope 0.
- has slope .
- is different: its outer function is , so its slope is .
Because is a relative rate, a log turns relative change into an ordinary slope. For example, has slope , the relative rate of .
Negative inputs, and where breaks
exists only for , so it has no slope at 0 or below. As shrinks towards 0, the slope grows without limit: 10 at 0.1, 100 at 0.01, 1000 at 0.001. The curve plunges down the -axis.
is defined for negative as well: it is mirrored in the -axis. Its slope is also , on both sides of 0. At it is , because there the curve falls.
Lesson 2.5.2 uses this to undo .
Try it
The first loop prints central differences of at 2, and the second the slope near 0. A central difference of at follows.
SymPy writes as log. Declaring positive lets it simplify and .
Other bases
Lesson 1.4.3 gives , so . The chain rule, with inner function and inner slope , then gives the slope of . Change of base, , gives the slope of .
Rule: Other bases
For , and both rules reduce to the ones above. The factor is the slope of at 0, from the table earlier.
- has slope .
- A base below 1 has a negative log. has slope : it decays.
- has slope , which is about 0.434294 at .
Power, exponential or constant?
Three look-alikes take three different rules. Ask where the variable is.
| function | the variable is | rule | derivative |
|---|---|---|---|
| in the base | power rule | ||
| in the exponent | exponential rule | ||
| nowhere | constant | 0 |
Try it
SymPy differentiates each example of this section. It writes as E and as log.
sp.log(x, 10) is , which SymPy turns into log(x)/log(10) by change of base. It writes as -log(2)/2**x.
These derivatives, read backwards, give the antiderivatives of lesson 2.5.2. Case study 2.3.7 uses to find a bond's duration exactly.
Common mistakes
- is not a power of . The power rule does not apply: .
- Keep the chain factor. gives , and gives , not .
- of a sum is not a sum of logs. has slope , not .
- A constant inside drops out. has slope , not or .
- is not . Their slopes are and .
- Other bases need . gives , not .
- needs a positive input. For negative , use , whose slope is also .
Exponentials and logarithms
0 of 12 correct
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
How to type answers
- Powers with
^:x^7,2^(1/3),a^-2. - Multiply with
*or by writing side by side:3x^2,2(x+1). ln(x)is the natural log,log(x, 2)is log base 2,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for sin²x.- Your first answer to each question is saved: it counts towards your score and brings the question back for review.
- Exact answers like
ln(20)/ln(3)are best. Decimals need about 4 significant figures.
Summary card
- : the slope equals the height. is the base whose slope at 0 is 1.
- ; so , a constant relative rate .
- for : the mirror of swaps rise and run. also has slope .
- , the relative rate of .
- and .