Overview
Section 1.2.11.2 of TAOCP compares a sum with the integral . The two differ by a short list of boundary terms and a remainder. The boundary terms use the values of the derivatives of at the two ends, and their coefficients are the Bernoulli numbers . The remainder is an integral that has a bound in terms of . The section defines the Bernoulli numbers and polynomials, proves the formula, and bounds the remainder. It then applies the formula twice. For the result is the series for and the value of Euler's constant . For the result is Stirling's series for and, after exponentiation, the series for itself.
The ideas
A sum is a trapezoid sum plus a correction. On one unit interval the average differs from by an integral of against the sawtooth function (eq. (2)). Adding the intervals gives eq. (3). Integration by parts, repeated, replaces the sawtooth by the Bernoulli polynomials and gives eq. (10).
The Bernoulli numbers are fixed by one generating function. The function has the power series (eq. (4)). This one definition gives the values (5), the vanishing of the odd numbers (6), the recursion (7) and the properties (8) and (9) of the polynomials. The proof of Euler's formula needs only that for and that .
The remainder is small, and it has a sign. The periodic function has a Fourier series, and this series gives the bound (eq. (12)). For even it also shows that keeps one sign. This fixes the sign of the remainder and gives eq. (13): the error of the formula lies between and the first omitted term.
The series do not converge, and they still work. The Bernoulli numbers grow faster than any geometric sequence. For fixed the series for and for diverge. Yet each truncation is correct, and the error is at most the first omitted term.
One constant needs a separate argument. The formula for has an unknown constant . Wallis' product gives .
C1 follows the order of the section. It adds three results that later parts of C1 need: the value of (Theorem C1.1.2.11.2.20), the extension of Stirling's series to real arguments (Theorem C1.1.2.11.2.21) and the series with a shift (Theorem C1.1.2.11.2.22). The last one is used in Section 1.2.11.1.
Definitions, results and proofs
Definition C1.1.2.11.2.1 (the fractional part, TAOCP eq. 1.2.11.2(1)). For a real number let be the greatest integer not larger than . The fractional part of is
Node: TA4YMH1RQQ · Lean: TAOCP.S1_2_11.fract_eq · status: not stated yet
Explanation. The value lies in the interval . The function has period , and it rises with slope from up to on each interval . For a negative the value is still non-negative, so and not . The graph is a sawtooth with jumps at the integers.
Example. , and . Also , as the period requires.
Proof. By the definition of the floor, , so . Since , it follows that . On the floor is , so .
Lemma C1.1.2.11.2.2 (one interval, TAOCP eq. 1.2.11.2(2)). Let be an integer and let have a continuous derivative on . Then
Node: TAJZCN62RC · Lean: TAOCP.S1_2_11.eq2_euler (partial) · status: not stated yet
Explanation. The left side measures how far the trapezoid rule on one interval is from the exact integral. The weight runs from to and has mean on the interval. The proof is one integration by parts.
Example. Take and . The left side is . The right side is .
Proof. On the value is . Integrate by parts with and :
The bracket is .
Theorem C1.1.2.11.2.3 (the first summation formula, TAOCP eq. 1.2.11.2(3)). Let be an integer and let have a continuous derivative on . Then
Node: TAVWN7C9JT · Lean: TAOCP.S1_2_11.eq3_euler (partial) · status: not stated yet
Explanation. The sum has terms and omits . The first two terms on the right are the integral and half the jump of across the interval. They are the first two terms of the series that Theorem C1.1.2.11.2.10 builds. The last integral is the error of this two-term approximation. It is small when is small.
Example. Let and . The sum is . The integral is . The middle term is . The last integral, with , equals by numerical integration. The three parts add to .
Proof. Add Lemma C1.1.2.11.2.2 over . The left sides add to . The right sides add to . The first sum is , because each value with appears twice with weight . Move the boundary part to the other side.
Definition C1.1.2.11.2.4 (the Bernoulli numbers, TAOCP eq. 1.2.11.2(4)). The Bernoulli numbers are the coefficients of the following power series. The left side has the value at .
Node: TAZDCDM2GZ · Lean: TAOCP.S1_2_11.eq4_bernoulli · status: not stated yet
Explanation. The function is analytic near . Its only singularities are the points where and . So the series converges for . This gives for large even , so the numbers grow faster than any geometric sequence (Theorem C1.1.2.11.2.12 gives the exact form). The numbers are rational, as the example shows.
Example. Write . The reciprocal is . So , and .
Proof that the definition is sound. The series has constant term . A power series with a non-zero constant term has a reciprocal power series, and its coefficients are rational when the original ones are. So the numbers exist, they are unique, and they are rational.
Theorem C1.1.2.11.2.5 (the first Bernoulli numbers, TAOCP eq. 1.2.11.2(5)). The odd numbers with are . The even-index numbers with and the number are
Node: TA81DXSQMW · Lean: TAOCP.S1_2_11.eq5_bernoulli (partial) · status: not stated yet
Explanation. The signs of the non-zero numbers alternate, and their size first falls and then grows without bound. The values come from the recursion of Theorem C1.1.2.11.2.7 and the vanishing of Theorem C1.1.2.11.2.6. Each new number needs the earlier ones.
Example. Use from Theorem C1.1.2.11.2.7 with . It gives . Since , the equation gives , so . The check for in exact arithmetic gives , and , which agrees in size with of Theorem C1.1.2.11.2.12.
Proof. Definition C1.1.2.11.2.4 gives and , and the example above gives . Theorem C1.1.2.11.2.6 gives the zeros. For the even numbers use the recursion in the form with . Each step is an exact rational computation. For : , that is , so . The steps give , and in the same way.
Theorem C1.1.2.11.2.6 (the odd Bernoulli numbers, TAOCP eq. 1.2.11.2(6)). For every odd , .
Node: TA0NZSEGE3 · Lean: TAOCP.S1_2_11.eq6_bernoulli · status: not stated yet
Explanation. Apart from there are no odd Bernoulli numbers to compute. The proof shows that the function is even. This is why the formulas of this section have only even powers of after the first term.
Example. The exact values agree with the recursion. For it gives . The first three terms add to , so .
Proof. Let . Then
The factor is odd in , and the factor is odd, so is even. The series of is with the term replaced by . An even function has no odd powers, so for odd .
Theorem C1.1.2.11.2.7 (the recursion, TAOCP eq. 1.2.11.2(7)). For every integer , with for and otherwise,
Node: TAJ8XDASNC · Lean: TAOCP.S1_2_11.eq7_bernoulli · status: not stated yet
Explanation. The relation gives from , because the coefficient of is . For the sum over is and not . The term records this one exception.
Example. For : . The terms for and vanish. For the sum is , which is for .
Proof. Multiply the series of Definition C1.1.2.11.2.4 by :
The coefficient of in the Cauchy product is . The left side has the coefficient for and for . So for . Add to both sides for the first form. For both sides of the first form are .
Definition C1.1.2.11.2.8 (the Bernoulli polynomials, TAOCP eq. 1.2.11.2(8)). For an integer the Bernoulli polynomial of degree is the first display below. It has the generating function of the second display.
Node: TA995SXDS1 · Lean: TAOCP.S1_2_11.eq8_bernoulli · status: not stated yet
Explanation. The polynomial is the "umbral" power , where after expansion the power is replaced by the number . The polynomial has degree , leading coefficient , and constant term . The second form is the generating function. It is the tool for Theorem C1.1.2.11.2.9.
Example. , , and . For the last one: .
Proof that the two forms agree. The series of is . Multiply it by the series of Definition C1.1.2.11.2.4. The coefficient of in the Cauchy product is .
Theorem C1.1.2.11.2.9 (the properties of , TAOCP eq. 1.2.11.2(9)). For every :
- ;
- for ;
- for ;
- for .
Node: TAWQZ5D7S0 · Lean: TAOCP.S1_2_11.eq9_bernoulli, TAOCP.S1_2_11.bernoulli_poly_zero_one (partial) · status: not stated yet
Explanation. The second property says that the polynomials form an Appell sequence: each one is the integral of the one before, with constant of integration chosen so that the mean on is . The fourth property says that is continuous for . Both properties are all that Theorem C1.1.2.11.2.10 uses. The third property gives the sums of powers (exercise 4 below).
Example. For : . Also . For : .
Proof. The first property is the case of Definition C1.1.2.11.2.8, since only the term survives. For the second, differentiate the sum term by term, and use :
For the third, subtract the generating functions of Definition C1.1.2.11.2.8 for and for :
Compare the coefficients of . For the fourth, put in the third property. Then for .
Theorem C1.1.2.11.2.10 (Euler's summation formula, TAOCP eq. 1.2.11.2(10)). Let be integers, let , and let have a continuous derivative of order on . Let be the remainder of Definition C1.1.2.11.2.11. Then
Node: TA1Z5A2RTV · status: not stated yet
Explanation. The case and is the form of the book, with . The term is , which is the boundary term of eq. (3). The next terms are , then , and so on. Only the odd derivatives appear, because for odd . The sum of the corrections need not converge when . The remainder is the exact difference at each .
Example. Let , , , . The sum is . The integral is . The terms are : ; : ; : . Since is constant, the remainder is , so the total is . For and the formula with is worked in Theorem C1.1.2.11.2.14.
Proof. The proof is by induction on . For the statement is Theorem C1.1.2.11.2.3 with the limits and (the same proof), since and .
Assume the statement for , and let have continuous derivatives. Put . On with integer the function is , and by Theorem C1.1.2.11.2.9, . Integrate by parts:
Since , Theorem C1.1.2.11.2.9 gives . The bracket is . Sum over . The brackets telescope, and
Multiply by . The left side becomes . The right side becomes . The factor is when is even. When is odd, it is at least , and by Theorem C1.1.2.11.2.6. So in all cases , and
Substitute this in the formula for . The new term is the term of the sum, so the formula holds for .
Definition C1.1.2.11.2.11 (the remainder, TAOCP eq. 1.2.11.2(11)). Let and let have a continuous derivative of order on . Write for , and write for the -th correction term of Theorem C1.1.2.11.2.10. The remainder of order is
Node: TAQEFSKTG5 · status: not stated yet
Explanation. The remainder is defined by an integral, and Theorem C1.1.2.11.2.10 shows that it equals the exact error of the formula. The relation of that proof says . For even it also gives , since . So the remainder after an even number of corrections equals the remainder after the next odd one.
Example. For , and the second derivative is , and . A numerical integration gives . This equals , the exact error of the two-term formula of Theorem C1.1.2.11.2.14.
Proof of the relation for even . The relation with even has odd, and for this gives . Then , and reads .
Theorem C1.1.2.11.2.12 (the size of the remainder, TAOCP eq. 1.2.11.2(12)). Let . Then:
- for all real ;
- for even , , where ;
- for even , , and is zero or has the sign ;
- if has continuous derivatives on , then , and for even also .
Node: TAQ1B81939 · status: not stated yet
Explanation. The bound shows that the remainder is of the size of the correction term with the same index. It follows that a truncated series has an error of the order of its last term. The closed form for even says how the Bernoulli numbers grow: . The numbers themselves grow like and no geometric bound holds.
Example. The largest value of on is for (it equals ), for and for . The bound is , and . For odd the largest values are for and for , below and . The closed form gives .
Proof. Step 1: the Fourier series. Let . The function has period . It is continuous, because by Theorem C1.1.2.11.2.9. It is also piecewise smooth. So its Fourier series converges to it at every point. The coefficients are . For : . For and integrate by parts. The boundary term vanishes, since and the exponential is at both ends. Then
For : . By induction . So for ,
Step 2: the bounds. Take absolute values: . Since , this is less than .
Step 3: even . Pair with . Since , the two terms add to a cosine:
At this is the formula for . The cosines are at most , so . Also , and each term of the sum is at most . So the difference has the sign or is zero.
Step 4: the bounds for follow from the definition and the bounds on .
Theorem C1.1.2.11.2.13 (the remainder has the sign of the next term, TAOCP eq. 1.2.11.2(13)). Let be even, let have continuous derivatives up to order on , and suppose that and are both on or both . Then:
- for some with ;
- if the same signs hold on , and , then exists, and for some with .
Node: TAXBHY0X7D · status: not stated yet
Explanation. The error of the formula after the correction with index is between and the next correction. So the best place to stop a series of this kind is just before its smallest term, and the error is then at most that term. The condition holds for , for and for any function whose derivatives of order and have one common sign on the interval.
Example. For and the derivatives have the signs , so the condition holds for even . The ratio is for , for and for . All lie in .
Proof. Step 1: a formula for with even . From with , . The definition gives for even , and . So
Step 2: signs. By Theorem C1.1.2.11.2.12, is zero or has the sign , and has the sign . So the factor has the sign of . If has one sign on , then is zero or has the sign of . The correction has the same sign, since has the sign of .
Step 3: the ratio. For even , and , with . Apply Step 2 with to : this has the sign of , the sign of . So . Apply Step 2 with to : this has the sign of . The numbers and have opposite signs, and , have the same sign. So has the sign opposite to , and . Hence . If , then and shows , and any works.
Step 4: the tail. Apply the first part on . The ratio is in . The integral converges when by Theorem C1.1.2.11.2.12 and the integrability of . Also . So the limit lies between and this number, which is the claim.
Theorem C1.1.2.11.2.14 (the formula for , TAOCP eq. 1.2.11.2(14)). For integers and ,
Node: TADJEMRBFT · status: not stated yet
Explanation. This is Theorem C1.1.2.11.2.10 with . The sum is . The corrections have the factor , and the powers of appear with negative exponents. The constants are the same for all . They add up to Euler's constant in the next theorem.
Example. For the sum is . With : , with an error of . With the value is and the error is . With it is and the error is . Each error equals .
Proof. The derivative is . So . The integral is . For the remainder, and .
Theorem C1.1.2.11.2.15 (Euler's constant, TAOCP eq. 1.2.11.2(15)). The limit exists. For every the first display below holds. For even there is a with such that the second display holds.
Node: TAC48KZF81 · status: not stated yet
Explanation. The series does not converge. Its terms fall at first and then grow. Each partial sum after an even index estimates with an error between and the next term, so the accuracy is limited by the smallest term. A better value comes from the formula at a larger , which Theorem C1.1.2.11.2.16 gives.
Example. The partial sums with are , , and . The constant is . The errors are , , and . They alternate in sign and they do not shrink, since the series has been used past its smallest term. For : with .
Proof. For Theorem C1.1.2.11.2.12 bounds by a constant, and is integrable on . For use . So . In Theorem C1.1.2.11.2.14 let . The terms go to . So . Since , the limit of exists and has the same value. For the formula with use . The term is , and the terms with odd vanish. Theorem C1.1.2.11.2.13 with and the tail form gives . Here , so .
Theorem C1.1.2.11.2.16 (the series for , TAOCP eq. 1.2.11.2(16)). Let and . There is a number with such that the first display holds. For it reads as the second display.
Node: TA96315216 · status: not stated yet
Explanation. This is the series of Section 1.2.7. The error is at most the first omitted term and has its sign. It is not claimed that the series converges. For large and fixed the terms eventually grow, and one chooses so that the next term is small.
Example. For the value is . The sum is . The difference is , and . So . For the difference is and the bound is .
Proof. Put in Theorem C1.1.2.11.2.14 and subtract Theorem C1.1.2.11.2.15 for the same :
Here with , the tail of Theorem C1.1.2.11.2.13. For the derivatives of order and have the same sign, and . So with . The terms with and with even are and ; the other terms vanish. Add to pass from to .
Theorem C1.1.2.11.2.17 (the formula for , TAOCP eq. 1.2.11.2(17)). Let and be integers, and let . Then
Node: TAMPNGG8K6 · status: not stated yet
Explanation. This is Theorem C1.1.2.11.2.10 with . The sum is . The integral is . The term with is . The terms with use the derivatives of .
Example. For : . The terms before the sum give . With the value is , with it is and with it is . The errors are , and . Each error is .
Proof. For , . So . For the remainder, and .
Theorem C1.1.2.11.2.18 (Stirling's series for , TAOCP eq. 1.2.11.2(18)). The limit exists. For even the error of the series below is times the first omitted term , with . The first terms of the series are . For every ,
Node: TA2ESFXPF9 · status: not stated yet
Explanation. The constant does not follow from the formula. The formula gives it as a limit, and Theorem C1.1.2.11.2.20 shows that . The first terms of the series agree with the book's and .
Example. With and , the true value is . The sum through gives , with error , and the first omitted term is . Through the error is , and the next term is . The partial sums of for are , and .
Proof. Step 1: the constant. Theorem C1.1.2.11.2.17 gives . By Theorem C1.1.2.11.2.12 and for , the remainder tends to . So the left side has a limit, and it is the constant , because . Thus .
Step 2: the series. Subtract the formula for the constant. Then , with the tail. Add .
Step 3: the error. By Theorem C1.1.2.11.2.12 with in place of , and , the tail satisfies . So the series through has the error . The term with is itself , so the series through has the error .
Step 4: the sign. For even apply Theorem C1.1.2.11.2.13 with , whose derivatives of order and have the same sign. Then and , so , which is times the term with .
Theorem C1.1.2.11.2.19 (Stirling's series for , TAOCP eq. 1.2.11.2(19)). As ,
Node: TA7RWZC321 · Lean: TAOCP.S1_2_11.eq19_stirling (partial) · status: not stated yet
Explanation. This is the exponential of eq. (18) with . The coefficients are the coefficients of with . The next coefficient is , and the proof below can be pushed one step further with one more term of the exponent.
Example. For the exact ratio is . The polynomial gives . The difference times is , close to the next coefficient . For the ratio is and the polynomial gives . For the series gives and the true ratio is .
Proof. Let . By Theorem C1.1.2.11.2.18 with and Theorem C1.1.2.11.2.20, . Exponentiate. Since ,
The first factor is . The second is . Multiply them. The coefficient of is . The coefficient of is . The coefficients of and are and .
Theorem C1.1.2.11.2.20 (the value of , TAOCP Section 1.2.11.2). The constant of Theorem C1.1.2.11.2.18 is . Also .
Node: none
Explanation. Euler's formula gives the form of and leaves one constant open. The central binomial coefficient is the link: it is a ratio of three factorials in which the factors of the form cancel, and only is left. Wallis' integrals give the value of the ratio independently.
Example. The ratio is for and for . These are close to , which is and .
Proof. Step 1: Wallis. Let . Integration by parts gives , with and . So and . On the power falls with , so . Thus , that is
Step 2: Stirling. Theorem C1.1.2.11.2.18 with gives . Then
Compare with Step 1: , so and . The second claim is Step 1.
Theorem C1.1.2.11.2.21 (Stirling's series for real arguments, TAOCP Section 1.2.11.2, exercise 6). For a fixed integer and real ,
Node: none
Explanation. At an integer the left side is , and the right side is the series of Theorem C1.1.2.11.2.18 minus . So the theorem extends that series from the integers to all large real . The integer case cannot reach non-integer by itself. The proof adds two steps: the difference and the behaviour of for .
Example. For the value is . The series with gives , with it gives , and with it gives , with error . The first omitted term for is .
Proof. Let be the right side without the term, and let .
Step 1: the difference of . Put . Since , Theorem C1.1.2.11.2.18 gives on the integers, and . The function has a Taylor expansion for each . A series whose values on the integers are has no term below . So for real . Apply this with in place of : , and .
Step 2: the limit along a shift. Claim: when through the integers, for each real . Write with and a non-negative integer. It is enough to treat . For this is Theorem C1.1.2.11.2.18. Let . The function is convex on , because and Hölder's inequality gives . Since , convexity gives . Since , convexity gives . Together,
The left side tends to . So . A Taylor expansion gives . Subtract: , and by Step 1. So .
Step 3: the sum. For each , . Let . Then . Finally is the term with , which is . So .
Theorem C1.1.2.11.2.22 (Stirling's series with a shift, TAOCP Section 1.2.11.2). Let be a fixed real number and . As ,
Node: none
Explanation. For the sum has the terms of Theorem C1.1.2.11.2.21, so this is the same series. For the numbers are replaced by the polynomials . The theorem is the tool of Lemma C1.1.2.11.1.21: it gives the expansion of in powers of .
Example. Take . For the error with is , , and . Times these are , , and . For the values are , , and . The scaled errors stay bounded, as the term requires.
Proof. Step 1: change of variable. Put in Theorem C1.1.2.11.2.21 with :
Expand and in powers of with the error . The result is , where is a polynomial in . It remains to show .
Step 2: the formal series. With let be the formal power series in that is the expansion of
Its coefficient of is . Let . Both are formal series in with polynomial coefficients in . At the logarithm and the term vanish, and , since . To show , differentiate in .
Step 3: the derivative of . By Theorem C1.1.2.11.2.9, . So .
Step 4: the derivative of . Let , which is the expansion of . Then . The first two parts of have the derivative . For the derivative of is . Since , the term equals . So
Step 5: the coefficient identity. By Steps 3 and 4 it is enough to show
Take the coefficient of . On the left it is , by Definition C1.1.2.11.2.8. On the right, and . So the term with index contributes, with , the amount . Since , this equals the term on the left. The term on the left is , the coefficient of in . So the identity holds.
Step 6: the conclusion. The series has and value at . A polynomial in with zero derivative and zero value at is zero. So every coefficient of vanishes, and .
Algorithms and programs
Section 1.2.11.2 has no algorithm and no program. The recursion of Theorem C1.1.2.11.2.7 is a short procedure for the Bernoulli numbers: start with and use for in exact rational arithmetic. The values of Theorem C1.1.2.11.2.5 and all the checks in this chapter come from this procedure and from the closed form of Theorem C1.1.2.11.2.12.
The exercises
The table has the exercises of Section 1.2.11.2. The kind is the class of spec 06.3, and the indexer of S0 fixes it in the map.
| Exercise |
Rating |
Markers |
Kind |
Lean |
Solution |
| 1.2.11.2-1 |
18 |
M |
K1 |
not yet stated |
X1, 1.2.11.2-1 |
| 1.2.11.2-2 |
20 |
HM |
K1 |
not yet stated |
X1, 1.2.11.2-2 |
| 1.2.11.2-3 |
20 |
HM |
K1 |
not yet stated |
X1, 1.2.11.2-3 |
| 1.2.11.2-4 |
20 |
HM |
K3 |
not yet stated |
X1, 1.2.11.2-4 |
| 1.2.11.2-5 |
30 |
HM |
K1 |
not yet stated |
X1, 1.2.11.2-5 |
| 1.2.11.2-6 |
30 |
HM |
K1 |
not yet stated |
X1, 1.2.11.2-6 |
| 1.2.11.2-7 |
32 |
HM |
K4 |
not yet stated |
X1, 1.2.11.2-7 |
| 1.2.11.2-8 |
23 |
M |
K4 |
not yet stated |
X1, 1.2.11.2-8 |
| 1.2.11.2-9 |
25 |
M |
K4 |
not yet stated |
X1, 1.2.11.2-9 |
Notes on the exercises. Each note uses only results proved above.
- Exercise 1 is Theorem C1.1.2.11.2.7. The proof there multiplies the generating function by .
- Exercise 2: the derivative rule of Theorem C1.1.2.11.2.9 fixes up to an additive constant. The condition gives and so fixes the constant. The proof of Theorem C1.1.2.11.2.10 uses exactly these two properties, because the boundary terms of the integration by parts cancel only when . A sequence that satisfies the first property alone gives a formula with extra terms.
- Exercise 3: let be even and let have one sign, say . By Step 1 of the proof of Theorem C1.1.2.11.2.13, and . By Theorem C1.1.2.11.2.12, . So lies in , and .
- Exercise 4: Theorem C1.1.2.11.2.9 gives . Add this over . Then . For and the value is .
- Exercise 5 is Theorem C1.1.2.11.2.20, and exercise 6 is Theorem C1.1.2.11.2.21.
- Exercise 7: apply Theorem C1.1.2.11.2.10 with and add . The result is , where is a constant (the constant of Glaisher and Kinkelin). For the error times is , and , close to , which is the next correction term.
- Exercise 8: put in Theorem C1.1.2.11.2.18 and expand . The result is . The same expansion carried one step further gives the coefficient of . For , this is , and the residual times is , and for .
- Exercise 9: apply Theorem C1.1.2.11.2.19 to and to . The result is . For and the relative error times is and .
Lean
The Lean code of tamnd/taocp-lean at main has the file TAOCP/V1/S1_2_11.lean, in the namespace TAOCP.S1_2_11. It states eqs. (1) to (9) and the leading term of eq. (19). The Node lines name the declarations. Where the Lean statement differs from the handbook, the Node line says "partial".
- Eq. (1) is
TAOCP.S1_2_11.fract_eq, with TAOCP.S1_2_11.fract_eq_sub_nat for the open interval. Eqs. (2) and (3) are TAOCP.S1_2_11.eq2_euler and TAOCP.S1_2_11.eq3_euler.
- Eqs. (4) to (8) are
TAOCP.S1_2_11.eq4_bernoulli to TAOCP.S1_2_11.eq8_bernoulli. Eq. (9) is TAOCP.S1_2_11.eq9_bernoulli, with TAOCP.S1_2_11.bernoulli_poly_zero_one.
- Eq. (19) is
TAOCP.S1_2_11.eq19_stirling.
- The files
TAOCP/Notation/Bernoulli.lean and TAOCP/Notation/Harmonic.lean have TAOCP.bernoulli_zero_eq, TAOCP.bernoulli_one_eq, TAOCP.bernoulli_two_eq and TAOCP.harmonicPow.
The Lean statement differs from the handbook in these places.
- Eqs. (2) and (3) assume
ContDiff ℝ 1 f, so has a continuous derivative on the whole real line. Eq. (3) is stated for with the sum over Finset.Ico 1 n.
- Eq. (4) is stated without division: the series of times is .
- Eq. (5) states to only. The handbook lists the numbers up to .
- Eq. (9) states and for . The other rules of the theorem are not stated.
- Eq. (19) states the leading term only: the ratio of to tends to .
Not yet stated: the Node lines that say "Lean: not yet stated", which include Euler's formula with the remainder, the bounds on the remainder and the series for .
Notes and history
The formula was found by L. Euler, in papers of 1732 to 1736, and independently by C. Maclaurin, who printed it in his Treatise of Fluxions of 1742. The Bernoulli numbers appear in the work of Jakob Bernoulli on sums of powers, printed in 1713 after his death. Exercise 4 gives the form of that result in the notation of this section.
A. de Moivre found the series for with an unknown constant, and J. Stirling found that the constant is . Both results were printed in 1730. Wallis' product was printed in 1656.
The series of Theorems C1.1.2.11.2.16 and C1.1.2.11.2.18 are asymptotic series in the sense that H. Poincaré defined in 1886. For fixed they diverge, since the closed form of Theorem C1.1.2.11.2.12 shows that grows like . The bound "between and the next term" is the reason that they are still useful.
Theorem C1.1.2.11.2.22 is not a separate result of the book. It is the form of Stirling's series that Section 1.2.11.1 uses to expand , and this chapter proves it for that reason.
The project has no errata of Section 1.2.11.2 to report.
Section 1.2.11.2 of TAOCP turns a sum into an integral plus correction terms. The corrections have the Bernoulli numbers as coefficients, and the error after each stage is bounded. The section applies the formula to and to . This gives the series for the harmonic numbers, the value of Euler's constant, and Stirling's series for . This chapter of C1 states and proves each equation of the section, adds the facts that the book leaves to the reader, and checks each series against exact values.