← Background
Background · Calculus I, Part 1 of 3

Adding Up Slices: Counting One Electron

How can an electron that is spread through space be counted by adding up thin slices?

This series is for a chemistry student who may have passed a calculus course without ever feeling what it does. It starts from adding numbers. All you need is algebra, powers, and the idea of the graph of a function.

1. What We Are Counting

A hydrogen atom is one proton and one electron. Quantum mechanics, in the one sentence we need, says that for hydrogen in its lowest energy state the electron has no single distance from the proton; instead, the chance of finding it at a distance between r and r+Δr is very nearly P(r)Δr when Δr is small, with

P(r)=4r2e−2r.

Read the symbols one at a time.

Why the shape? A thin spherical shell of radius r and thickness Δr has a volume of about area times thickness, 4πr2Δr. The electron’s density per unit volume at distance r is e−2r/π. Multiply the two and the factors of π cancel: 4r2e−2rΔr. Near the proton the shells are tiny; far away the density has faded. In between, P has a hump.

r (bohr)P(r) (electrons per bohr)
00.000000
0.250.151633
0.50.367879
10.541341
1.50.448084
20.293050
30.089235
40.021470
60.000885
100.000001

Our question for this page: if we add up the electron over all distances, do we get exactly one electron?

2. One Slice, Then Many

If P were constant, say 0.5 electrons per bohr over a stretch 2 bohr long, the stretch would hold 0.5×2=1 electron. On a graph that is the area of a rectangle: height times width.

Our P is not constant. But over a short stretch it does not change much. So cut the distance axis into slices, pretend P is constant on each slice, and add the rectangles. Let us do it by hand from 0 to 10 bohr with five slices of width Δr=2, taking each height at the middle of its slice.

slice (bohr)midpointheight Pheight × 2
0 to 210.5413411.082682
2 to 430.0892350.178470
4 to 650.0045400.009080
6 to 870.0001630.000326
8 to 1090.0000050.000010

The five heights add to 0.635284, and twice that is 1.270568 electrons. More than one electron: the pretence of constant height was too crude. We need thinner slices, and a short way to write long sums.

The summation sign. ∑i=1nai means: let i run through 1,2,…,n and add the numbers ai. For example ∑i=14i=1+2+3+4=10.

Cut the interval from a to b into n equal slices of width Δr=(b−a)/n. Slice number i runs from a+(i−1)Δr to a+iΔr. Three natural choices of height give three sums:

Left, midpoint and right rectangle sums Ln=∑i=1nP(a+(i−1)Δr)Δr Mn=∑i=1nP(a+(i−12)Δr)Δr Rn=∑i=1nP(a+iΔr)Δr
Ten midpoint rectangles from 0 to 10 bohr. Each black dot is the point where the curve fixes a rectangle’s height.

3. Try It: Slide the Number of Slices

Choose where each height is taken, how many slices to use (the slider stops at 200 slices), and a cutoff b, the distance where you stop adding. The sliders work with a mouse, a finger or the arrow keys; while the axis is not stretched, you can also press or drag on the plot to move the cutoff. “Area from 0 to b” is the number the sums settle to as the slices get thinner, which the rest of this page explains.

The sliders need JavaScript. The figure above and the tables below show the same sums.

Things to try: with b=10, go from 5 slices to 10, 20, 40. With b=1, switch between left and right. With 200 slices, pull the cutoff down from 10 and watch how little changes until about 6.

4. Refining the Slices

Here are all three sums from 0 to 10 bohr.

nwidthleft Lnmidpoint Mnright Rn
520.6308671.2705680.630868
1010.9507181.0415760.950718
200.50.9961471.0033420.996147
400.250.9997441.0002220.999744
800.1250.9999831.0000140.999983
1600.06250.9999991.0000000.999999

All three columns head for a number very close to 1. The midpoint sums come down from above; the left and right sums come up from below.

Left and right agree almost perfectly here, and there is a simple reason. Both add the heights at the interior cut points. The left sum also has the height at the start, the right sum the height at the end, and nothing else differs:

Rn−Ln=(P(b)−P(a))Δr.

Between 0 and 10 we have P(0)=0 and P(10) is less than 0.000001, so the two sums nearly coincide. Do not expect that in general.

5. Trapping the Area

Look only at 0 to 1 bohr, where the curve rises all the way (the table in section 1 suggests it, and part 2 proves it). On a rising slice the left height is the smallest height and the right height is the largest. So the left rectangle lies under the curve and the right rectangle covers it:

Ln≤area under the curve≤Rn.
Five slices from 0 to 1 bohr. The left rectangles stay below the curve, the right rectangles reach above it.

The gap between the two bounds is, by section 4,

Rn−Ln=(P(1)−P(0))1n=0.541341n.

We can make this gap as small as we like by taking n large. The area has nowhere to hide.

nLn (too small)Rn (too large)gapMn
50.2690790.3773480.1082680.323420
100.2962500.3503840.0541340.323330
200.3097900.3368570.0270670.323324
1000.3206170.3260300.0054130.323324
10000.3230530.3235940.0005410.323324
100000.3232970.3233510.0000540.323324

With 10 000 slices the area is certainly between 0.323297 and 0.323351. The midpoint column settles much sooner, on 0.323324. A curve that falls all the way works the same, with left and right swapping roles. A curve with a hump can be cut at the top into a rising piece and a falling piece.

6. Limits and the Integral

A limit is the number a process closes in on. Writing lim⁡n→∞an=A means: name any tolerance, however small, and from some n onward every an is within that tolerance of A. For example lim⁡n→∞1/n=0: to get within 0.001 of zero, take any n larger than 1000.

The area under the curve from a to b is defined as the limit of rectangle sums, and it gets its own symbol:

The definite integral∫abP(r)dr=limn→∞∑i=1nP(ri)Δr

with Δr=(b−a)/n, where ri is any point you like in slice i.

Read it as a sentence. The sign ∫ is a stretched S for “sum”. P(r)dr is one rectangle, height times a very thin width. The numbers a and b say where the adding starts and stops. A theorem, used here without proof, says that for a function whose graph has no breaks (a continuous function) this limit exists and is the same wherever in each slice you take the height. Where a function is negative its rectangles count as negative.

Three rules follow directly from the sums, and we will use them in the next two parts.

  1. Sums split. Rectangles of height f+g are a rectangle of height f plus one of height g, so ∫ab(f+g)dr=∫abfdr+∫abgdr.
  2. Constants come out. Making every height c times taller makes the total c times larger: ∫abcfdr=c∫abfdr.
  3. Neighbouring intervals add. For a≤m≤b, ∫abfdr=∫amfdr+∫mbfdr.

The letter inside is a label only: ∫01P(r)dr and ∫01P(s)ds are the same number.

7. How Good Is a Sum?

The error of a sum is the sum minus the limit. Here are the errors from 0 to 2 bohr, where the limit is 0.761897.

nwidtherror of Lnerror of Rnerror of Mn
100.2−0.0303880.0282220.000581
200.1−0.0149030.0144020.000128
400.05−0.0073880.0072650.000031
800.025−0.0036780.0036480.000008
1600.0125−0.0018350.0018280.000002

Read down the columns. Each time the width is halved, the left and right errors are roughly halved, but the midpoint error is divided by about four.

Picture one narrow slice, where the curve is nearly a slanted straight line. The left rectangle misses a whole thin triangle between its flat top and the slant. Its area is about (slope × width) × width / 2. There are n slices and n is proportional to 1/width, so the total error is proportional to the width. The midpoint rectangle crosses the slant in the middle: it has a little triangle too much on one side and an equal one too little on the other. They cancel, and only the bending of the curve is left over. That is why the midpoint rule is so much better for the same work.

You may notice that the sums from 0 to 10 in section 4 improve even faster than this: for the thinner slices in that table, halving the width divides all three errors by roughly sixteen. That is a special gift of this interval. The curve has very nearly the same height, zero, at 0 and at 10, and it is level at 0 and very nearly level at 10. The errors that would come from a difference between the two ends therefore almost cancel.

8. The Tail Beyond a Cutoff

A computer cannot add slices forever. Stopping at b throws away the tail, the area to the right of b. Here is what is kept.

cutoff b (bohr)area from 0 to b
10.3233236
20.7618967
30.9380312
40.9862460
60.9994777
80.9999837
100.9999995

The numbers crowd up toward 1. But a table cannot show that nothing large hides far out. We can prove how small the tail beyond 10 bohr is, using only the formula. We use one fact proved in part 2: beyond r=1 the curve only falls.

  1. Move out by one bohr and compare: P(r+1)P(r)=(r+1r)2e−2.
  2. For r≥10 the bracket is at most 1.1, so the ratio is at most q=1.21e−2=0.163756.
  3. The curve falls, so on the one-bohr slice from 10+k to 11+k it is nowhere higher than P(10+k), which is at most P(10)qk. (Apply step 2 once for each of the k moves.) The slice is one bohr wide, so its area is at most the same number.
  4. Call S=1+q+q2+…+qK. Then qS=q+q2+…+qK+1. Subtracting, (1−q)S=1−qK+1≤1, so S≤1/(1−q) however large K is.
  5. Hence the whole tail is at most P(10)1−q=9.86×10−7, less than one millionth of an electron.

The integral all the way out is written ∫0∞Pdr and means lim⁡b→∞∫0bPdr. The symbol ∞ is not a number; it says that the cutoff is pushed out without end.

Two separate errors

With b=10 and n=40 the midpoint sum is 1.000222. The area from 0 to 10 is 0.9999995 (part 3 derives it exactly). So the slice error is 0.000223, curable by thinner slices, while the cutoff error is only 4.56×10−7, curable only by moving b outward. Thinner slices never repair a short cutoff.

The evidence says ∫0∞4r2e−2rdr=1: one electron. In part 3 we prove it with no slices at all.

9. Exercises

Exercise 1. Compute the midpoint sum for P from 0 to 2 bohr with two slices.

Answer to exercise 1

The width is 1 and the midpoints are 0.5 and 1.5. P(0.5)=e−1=0.367879 and P(1.5)=9e−3=0.448084. The sum is 0.815963. The limit is 0.761897, so two slices are already within about 0.05.

Exercise 2. Find ∫01xdx from right sums, using 1+2+…+n=n(n+1)/2.

Answer to exercise 2

The width is 1/n and the right end of slice i is i/n. So Rn=∑i=1nin⋅1n=n(n+1)2n2=12+12n. As n→∞ this tends to 12, the area of the triangle.

Exercise 3. How many slices from 0 to 1 bohr make sure that the gap Rn−Ln is below 0.001?

Answer to exercise 3

We need 0.541341/n<0.001, so n>541.341. Take n=542 or more.

Exercise 4. About how many electrons lie between 0.99 and 1.01 bohr? Divide by the volume of that shell, about 4πr2Δr, and compare with e−2r/π at r=1.

Answer to exercise 4

One slice: P(1)×0.02=0.010827 electrons. The shell volume is 4π×0.02=0.25133 cubic bohr. The quotient is 0.04308 electrons per cubic bohr, which is e−2/π=0.04308.

Exercise 5. Using the table of section 8, how many electrons (what fraction of one) lie between 1 and 3 bohr?

Answer to exercise 5

Neighbouring intervals add, so ∫13=∫03−∫01. That is 0.9380312−0.3233236, or 0.6147076.

10. What Comes Next

We can now total a density. Part 2 asks how fast that running total grows, and finds the distance where the radial density is largest.

Further Reading

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