# Unveiling the Elegance of the Euler–Maclaurin Summation Formula

Written on

## Chapter 1: Introduction to the Euler–Maclaurin Formula

The appearance of the number 691 in your calculations might just be a humorous quip among mathematicians, but it often indicates the presence of Bernoulli numbers. While this is more anecdotal than factual, my own experiences align with this notion; each time I encountered 691, the elusive Bernoulli numbers surfaced soon after. Initially concealed within complex calculations, they eventually became prominent. Though you don’t need a background in Bernoulli numbers to grasp this article, we will start from the basics—summing a function.

As we progress, you will witness the elegance of mathematics unfold, culminating in the renowned Euler-Maclaurin formula, which we will even prove alongside an explicit remainder term. Along the way, we’ll pick up essential insights, including a brief introduction to the fascinating Bernoulli numbers. For now, it suffices to know that these rational numbers are infinite in number and play a significant role in number theory.

### Working with Sums

Let’s consider a general scenario of summation. Suppose you wish to compute the following sum:

S = sum_{k=m}^{n} f(k)

where ( m ) and ( n ) are integers such that ( m leq n ) and ( f ) is a differentiable function. For instance, if we let ( f(x) = x^3 ) and select ( m = 1 ), our sum simplifies to ( 1^3 + 2^3 + cdots + n^3 ).

Similar to how we manipulate integrals, we can adjust sums by modifying the index and summands. We also utilize the principle that the sum of a difference equals the difference of the sums. Consider the following transformation:

S = f(n)n - f(m)(m-1) + sum_{k=m}^{n} f'(k)

By employing the fundamental theorem of calculus, we can express this difference as an integral.

Before continuing, we need to familiarize ourselves with two important functions: the floor function and the fractional part function. The floor function, denoted ( lfloor x rfloor ), returns the largest integer less than or equal to ( x ). For example, ( lfloor 2.3 rfloor = 2 ). In contrast, the fractional part function, represented as ( {x} ), is defined by ( {x} = x - lfloor x rfloor ), yielding ( {2.3} = 0.3 ). Notably, the fractional part function exhibits periodicity with a period of 1.

Continuing with our sum, we observe that if ( x in [k, k+1) ), then ( lfloor x rfloor = k ). This allows us to rewrite our sum:

S = int_{m}^{n} f(x) , dx + text{(error terms)}

While the integrand may appear complicated due to the discontinuity of the floor function, we have merely scratched the surface.

The transformation we've initiated is a specific instance of the more general Abel summation formula. Before progressing, let’s recall the integration by parts rule:

int u , dv = uv - int v , du

where ( F(x) ) is the antiderivative of ( f(x) ). This rule will be instrumental as we move forward, and it holds even when ( f ) is discontinuous, which we will exploit.

After applying integration by parts, we can express our integral in terms of the floor function:

int lfloor x rfloor , dx = int (x - {x}) , dx

This transformation reveals that a sum can be approximated by an integral with an error linked to the fractional part function.

The next step demands some mathematical insight. We are integrating over a whole number interval, and one factor in the integrand is the fractional part function. Though this "error" integral might not be excessively large, it would be advantageous to shift the fractional part function down by ( frac{1}{2} ) to ensure that the integral over a whole number interval equals zero.

In essence, let’s adjust the error integral to involve ( {x} - frac{1}{2} ) through a common mathematical technique: adding and subtracting the same value.

Now we find ourselves with something quite remarkable!

Before we advance, we should learn how to integrate the fractional part function. Specifically, we need to determine the area beneath the curve from 0 to ( x ) as an "antiderivative," which will aid in our integration by parts later.

To achieve this, we require the following integral result:

int_{0}^{x} {t} , dt = frac{x^2}{2} - frac{{x}^2}{2}

You can verify this through various methods, and I leave it as an exercise for the reader.

Now, it becomes evident why we subtracted ( frac{1}{2} ). Upon integrating ( {x} - frac{1}{2} ), the linear term disappears, allowing us to maintain periodicity and a bounded result.

Continuing with integration by parts on the previous result, we derive:

int left({x} - frac{1}{2}right) , dx

While we are not finished yet, let’s take a moment to reflect. Perhaps a warm cup of coffee is in order.

We will resume our exploration of the formula, though it is already shaping up beautifully.

### The Bernoulli Numbers

Bernoulli numbers appear throughout number theory and analysis, from the Taylor expansion of the tangent function to values of the Riemann zeta function. Initially, these numbers were studied for their role in closed-form formulas for power sums. The first to recognize this sequence was the Swiss mathematician Jakob Bernoulli (1654–1705).

The Bernoulli numbers form a sequence of rational numbers, beginning with:

B_0 = 1, , B_1 = -frac{1}{2}, , B_2 = frac{1}{6}, ldots

It's worth noting that ( B_1 ) has two conventions: one where ( B_1 = frac{1}{2} ) and another where ( B_1 = -frac{1}{2} ). All odd-indexed Bernoulli numbers, except for ( B_1 ), equal zero, while the even-indexed numbers diminish in size, albeit with complexity.

So, how are these numbers defined? There exist numerous definitions and formulas for generating Bernoulli numbers. One such formula is:

B_n = sum_{k=0}^{n} binom{n}{k} frac{1}{k + 1} quad (n geq 0)

This exploration of Bernoulli numbers is merely a prelude to our main focus: proving the Euler-Maclaurin formula.

### The Euler-Maclaurin Formula

We derived the integral for the fractional part polynomial and the second derivative of ( f ) by eliminating the linear term after integrating the fractional part. This technique proves beneficial each time we engage in integration by parts, yielding fractional part factors multiplied by higher-order derivatives.

For instance, the integral of ( frac{{x} - {x}^2}{2} ) leads us to:

frac{1}{12}(x - {x}) + frac{1}{4}{x}^2 - frac{1}{6}{x}^3

To eliminate the linear term ( frac{x}{12} ), we must subtract it from the integral, equivalent to subtracting the constant ( frac{1}{12} ) under the integral sign.

We derive:

S = int f(x) , dx + text{(error terms)}

After thorough integration by parts and simplification, we arrive at a remarkable result.

Continuing in this manner reveals a pattern, and with a keen eye, one can spot the hidden Bernoulli numbers. We will refer to the last integral in our formula as the "remainder term."

By establishing recurrence relations from our integration by parts, one can demonstrate how the Bernoulli numbers fit into the equation, ultimately leading to the elegant Euler-Maclaurin summation formula.

This theorem's significance cannot be overstated, as it encapsulates the connection between sums and integrals beautifully.

The Euler-Maclaurin summation formula with an explicit remainder term is as follows:

sum_{k=m}^{n} f(k) approx int_{m}^{n} f(x) , dx + frac{f(m) + f(n)}{2} + R

Here, ( R ) represents the remainder term that we derived.

### Applications of the Euler-Maclaurin Formula

The Euler-Maclaurin formula finds numerous applications, particularly in computations and asymptotic analysis. While we will focus on practical calculations in this article, its versatility is noteworthy.

**Triangular Numbers**

An anecdote recounts how Gauss calculated the sum of the first 100 natural numbers when prompted by his teacher. While most students struggled, Gauss quickly arrived at the correct answer: 5050. Although the story's accuracy is uncertain, it illustrates the elegance of summation.

Using the Euler-Maclaurin formula, we can compute this sum. Let’s set ( f(x) = x ) and ( m = 1 ):

S = sum_{k=1}^{100} k = frac{100(100 + 1)}{2} = 5050

This calculation is straightforward, and we could have summed from 0 instead of 1 for even greater simplicity.

**Riemann Zeta Function**

In recent years, a debate has arisen surrounding the divergent series ( 1 + 2 + 3 + ldots ). Many struggle to comprehend how a formal value of ( -frac{1}{12} ) can be ascribed to such a series. Let’s explore the Riemann zeta function at ( s = -1 ).

Initially, we assume that ( s ) is a complex number with ( text{Re}(s) > 1 ), where the series converges:

zeta(s) = sum_{n=1}^{infty} frac{1}{n^s}

The beauty of the Euler-Maclaurin formula is that it allows evaluation of the zeta function whenever the remainder term converges.

Plugging in ( s = -1 ) results in the remainder term vanishing, yielding:

zeta(-1) = -frac{1}{12}

This remarkable finding arises directly from our formula, without any dubious series manipulation.

Moreover, if ( s = -2 ), the remainder term also vanishes, leading to ( zeta(-2) = 0 )—the first of the trivial zeros of the Riemann zeta function.

**Bernoulli's Formula**

Let’s derive a formula for the sum of powers. We already know the formula for the sum of the first ( n ) natural numbers:

sum_{k=1}^{n} k = frac{n(n + 1)}{2}

But how do we extend this to second, third, and higher powers? Jacob Bernoulli discovered a general formula for these sums, though ironically, it’s named after Faulhaber.

By applying Faulhaber's formula, we simplify calculations by summing from 0 instead of 1:

sum_{k=0}^{n} k^p = frac{1}{p + 1} sum_{k=0}^{p} binom{p + 1}{k} B_k n^{p + 1 - k}

This beautiful result emerged naturally from the Euler-Maclaurin summation.

**Conclusion**

We began our journey with a simple sum of differentiable arithmetic functions and applied various techniques to transform it into a refined version of the Abel summation formula.

Through careful consideration of the fractional part function and its integral properties, we eliminated linear terms, leading us to a weighted sum of differences of higher-order derivatives of the initial function.

Ultimately, these weights correspond to the Bernoulli numbers, giving rise to the exquisite Euler-Maclaurin summation formula.

In this exploration, my aim was to highlight the intuitiveness and beauty of the derivation rather than to focus on formal rigor. I encourage readers to delve deeper into the origins of the Bernoulli numbers and the nuances of this remarkable formula.

Now that we have uncovered the elegance of the Euler-Maclaurin summation formula, we can appreciate its significance in both theoretical and practical realms of mathematics.

This video, titled "Power sum MASTER CLASS: How to sum quadrillions of powers ... by hand! (Euler-Maclaurin formula)," offers a deeper insight into the application of this formula.

Additionally, this video titled "This equation blew my mind // Euler Product Formula" explores fascinating aspects of the Euler product formula and its connections to the zeta function.