← Background
Background · Calculus I, Part 2 of 3

Running Totals and Rates: The Derivative

How fast does a running total grow, and at what distance is the radial density of hydrogen largest?

This page uses the sums, limits and integrals of part 1, and ordinary algebra.

1. A Running Total

In part 1 the radial density of the hydrogen electron was P(r)=4r2e−2r, in electrons per bohr, with the distance r from the proton in bohr. Now let the far end of the integral move. Define

N(r)=∫0rP(s)ds,

the number of electrons (here a fraction of one) within distance r. The letter s runs through the slices; r is where we stop. Each value below is a limit of rectangle sums.

r (bohr)N(r)
00.000000
0.50.080301
10.323324
1.50.576810
20.761897
30.938031
40.986246
60.999478

2. How Fast Does the Total Grow?

Step from r to r+h, where h is a small length. The total rises by N(r+h)−N(r). Dividing by the step gives the average rate of growth, in electrons per bohr. At r=1:

step hN(1+h)rise N(1+h)−N(1)rise divided by h
10.76189670.43857310.438573
0.50.57680990.25348630.506973
0.10.37728630.05396270.539627
0.010.32873680.00541320.541323
0.0010.32386490.00054130.541341

The last column closes in on 0.541341, and that is P(1). It is no accident: the rise is the area of one thin slice, about P(1)×h. Part 3 turns this remark into a theorem. First we need to understand “the rate at a point”.

3. The Derivative as a Limit

Take any function f. The quotient (f(x+h)−f(x))/h is the slope of the straight line through two points of the graph, called a secant. As the second point slides toward the first, the secant turns toward the tangent, the line that just follows the curve there.

The derivativef′(x)=limh→0f(x+h)−f(x)h.

Here lim⁡h→0 means the number the quotient closes in on as h gets close to zero, from either side. We never put h=0, which would give the meaningless 0/0. The derivative is also written df/dx. A function that has a derivative is called differentiable.

We use three facts about limits without proof: the limit of a sum is the sum of the limits, the limit of a product is the product of the limits, and a constant factor can be taken outside. (For a reciprocal we also use that the limit of 1/g is 1 divided by the limit of g, when that limit is not zero.)

  1. A constant never changes, so every quotient is 0 and its derivative is 0.
  2. The function x: the quotient is (x+h−x)/h=1.
  3. The square: (x+h)2−x2h=2xh+h2h=2x+h→2x.

Now the radial density at r=0.5, where P=0.367879:

step hP(0.5+h)secant slope
10.4480840.080204
0.50.5413410.346923
0.10.4337200.658402
0.010.3751630.728353
0.0010.3686140.735023

The slopes approach 0.735759. Section 6 will produce that number from a formula.

Two secant lines from the point at 0.5 bohr, with steps of 1 and 0.5 bohr, and the tangent they approach.

4. Try It: Slide the Slope

Move the point with the first slider (or press and drag on a plot). The second slider shrinks the step h from 1 down to 0.001. The lower plot records the tangent slope at every distance. Watch where it crosses zero.

The sliders need JavaScript. The figure above and the tables on this page show the same slopes.

5. Rules That Save the Work

Taking a limit by hand every time would be slow. A few rules do it once and for all. Below, u and v are differentiable functions of x, and Δu=u(x+h)−u(x) is the change in u over the step.

A Differentiable Function Has No Jumps

Since Δu=(Δu/h)⋅h, and the first factor tends to u′ while the second tends to 0, the change Δu tends to 0.

Sums and Constant Factors

The change of u+v is Δu+Δv, and the change of cu is cΔu. Divide by h and take the limit:

(u+v)′=u′+v′,(cu)′=cu′.

The Product Rule

Think of uv as the area of a rectangle with sides u and v. When both sides grow, the new area has two thin strips and a tiny corner.

The change of a product: two strips and a corner. The picture shows growth; the algebra holds for either sign.
  1. (u+Δu)(v+Δv)−uv=vΔu+uΔv+ΔuΔv.
  2. Divide by h: vΔuh+uΔvh+ΔuhΔv.
  3. Let h→0. The corner term tends to u′⋅0=0. What remains is the rule.
Product rule(uv)′=u′v+uv′.

The Power Rule

For a whole number n=1,2,3,… the derivative of xn is nxn−1. It is true for n=1 (derivative 1). Suppose it is true for some n. Then by the product rule

(xn+1)′=(xn⋅x)′ =nxn−1⋅x+xn⋅1=(n+1)xn.

That is the same rule for n+1. So it climbs from 1 to 2, from 2 to 3, and so on without end. For n=2 it gives 2x, as found above.

The Chain Rule

Often one function is fed into another, y=f(u) with u=g(x). If u changes 3 times as fast as x, and y changes 2 times as fast as u, then y changes 6 times as fast as x: rates multiply. Here is the argument, written so that it never divides by Δu, which might be zero.

  1. For a change k in u, define the leftover E(k)=f(u+k)−f(u)k−f′(u) when k≠0, and E(0)=0. By the definition of f′, E(k)→0 as k→0.
  2. Rearranged, f(u+k)−f(u)=(f′(u)+E(k))k, and this holds for k=0 too.
  3. Put k=Δu, call the resulting change in y Δy, and divide by h: Δyh=(f′(u)+E(Δu))Δuh.
  4. As h→0, Δu→0, so E(Δu)→0, and Δu/h→g′(x).
Chain ruleddxf(g(x))=f′(g(x))g′(x).

The Exponential

For a power ax with a fixed base a, the law of exponents gives ax+h−ax=ax(ah−1). Therefore

ddxax=ax⋅limh→0ah−1h.

The slope of an exponential is proportional to its own height. The proportionality number is its slope at x=0. We take it as given that the limit exists, and estimate it:

hbase 2base ebase 3
0.10.7177351.0517091.161232
0.010.6955551.0050171.104669
0.0010.6933871.0005001.099216
0.00010.6931711.0000501.098673

Base 2 gives a number near 0.6931, less than 1; base 3 gives one near 1.0986, more than 1. We also take it as given that this number grows steadily with the base, so that in between there is exactly one base for which it is 1. That base is what the letter e means, e=2.718282… So

Exponential ruleddxex=ex,ddre−2r=−2e−2r.

The second formula is the chain rule with u=−2r: the outer function gives eu and the inner one gives −2.

6. Differentiating the Radial Density

Now every tool is ready. Write P=uv with u=4r2 and v=e−2r.

  1. Constant factor and power rule: u′=4⋅2r=8r.
  2. Exponential and chain rules: v′=−2e−2r.
  3. Product rule: P′(r)=8re−2r+4r2(−2e−2r), which is 8re−2r−8r2e−2r.
  4. Take out the common factor 8re−2r. The result is boxed below.
P′(r)=8r(1−r)e−2r.

At r=0.5 this is 8×0.5×0.5×e−1=2e−1=0.735759, the number the secants of section 3 were heading for.

7. Where the Radial Density Is Largest

The sign of a derivative says which way the graph goes. Where f′ is positive over a stretch, f rises there; where f′ is negative, f falls. (This follows from the mean value theorem, which we quote: between two points, some tangent is parallel to the secant joining them. So if every tangent slopes upward, every secant does.)

In P′(r)=8r(1−r)e−2r the factor e−2r is always positive. For r>0 the factor 8r is positive. So the sign is the sign of 1−r:

distancesign of P′the curve
0<r<1positiverises
r=1zerolevel
r>1negativefalls

It rises up to 1 bohr and falls ever after, so the largest value is at r=1 bohr, where P(1)=4e−2=0.541341 electrons per bohr. This also supplies the fact used in part 1 for the tail.

Note that P′(0)=0 as well. A zero slope alone does not tell a top from a bottom: at r=0 the curve starts out level at its lowest value, 0. Always look at what the sign does on each side.

r (bohr)P(r)P′(r)
00.0000000.000000
0.250.1516330.909796
0.50.3678790.735759
0.750.5020430.334695
10.5413410.000000
1.250.513031−0.205212
1.50.448084−0.298722
20.293050−0.293050
30.089235−0.118980
50.004540−0.007264
Above, the radial density; below, its slope. The slope crosses zero going downward exactly under the top of the hump.
Per bohr is not per cubic bohr.

The distance of 1 bohr is the most likely distance. The density per unit volume, e−2r/π, is largest right at the proton. Both are true: shells near 1 bohr are far roomier than shells near the proton.

The Slope of the Slope

The derivative of the derivative is the second derivative f″. It tells how the graph bends: negative means bending downward, as at a hilltop. Differentiate P′=(8r−8r2)e−2r by the product rule:

P″(r)=(8−16r)e−2r−2(8r−8r2)e−2r =8(1−4r+2r2)e−2r.

At the top, P″(1)=−8e−2=−1.082682, negative as it should be. At the start, P″(0)=8, positive: a valley floor.

8. Exercises

Exercise 1. Find the derivative of x3 directly from the limit.

Answer to exercise 1

(x+h)3−x3=3x2h+3xh2+h3. Dividing by h gives 3x2+3xh+h2, which tends to 3x2, as the power rule says.

Exercise 2. Find the derivative of 1/x (for x≠0) from the limit.

Answer to exercise 2

1x+h−1x=−hx(x+h). Dividing by h gives −1x(x+h), which tends to −1/x2.

Exercise 3. Where is f(r)=re−r largest for r≥0?

Answer to exercise 3

f′=e−r−re−r=(1−r)e−r, positive before 1 and negative after. So the largest value is at r=1 and equals e−1.

Exercise 4. Differentiate the density per unit volume, ρ(r)=e−2r/π. Is its slope ever zero?

Answer to exercise 4

ρ′(r)=−2e−2r/π. It is negative everywhere and never zero. For r≥0 the largest value is therefore at the end, r=0, where the slope is not zero. A maximum at the edge of a range need not be level.

Exercise 5. At which distances does the bending of P change, that is, where is P″=0?

Answer to exercise 5

Solve 2r2−4r+1=0: r=1±2/2, which is 0.2929 and 1.7071 bohr. Between them the curve bends downward.

9. What Comes Next

Part 1 added slices; this page measured rates. The table of section 2 hinted that the rate of the running total is the density itself. Part 3 proves it and uses it to count the electron exactly.

Further Reading

Comments, questions or contributions? Please open an issue or a pull request on GitHub.