# Formula for $f(1) + f(2) + \cdots + f(n)$: Euler-Maclaurin summation formula

Let $$f\colon \mathbb{R}\to \mathbb{R}$$ be a function with $$k$$ continuous derivatives. We want to find an expression for $$S=f(1)+f(2)+f(3)+\ldots+f(n).$$ I'm currently reading Analysis by Its History by Hairer and Wanner. They first consider the shifted sum and arrive at the expression $$f(n)-f(0)=\sum_{i=1}^{n} f^{\prime}(i)-\frac{1}{2 !} \sum_{i=1}^{n} f^{\prime \prime}(i)+\frac{1}{3 !} \sum_{i=1}^{n} f^{\prime \prime \prime}(i)-\frac{1}{4 !} \sum_{i=1}^{n} f^{\prime \prime \prime \prime}(i)+\ldots$$

using Taylor series (provided that the Taylor series actually converges to $$f$$).

In order to turn this formula for $$\sum f^{\prime}(i)$$ into a formula for $$\sum f(i)$$, we replace $$f$$ by its primitive (again denoted by $$f$$ ): $$\sum_{i=1}^{n} f(i)=\int_{0}^{n} f(x) d x+\frac{1}{2 !} \sum_{i=1}^{n} f^{\prime}(i)-\frac{1}{3 !} \sum_{i=1}^{n} f^{\prime \prime}(i)+\frac{1}{4 !} \sum_{i=1}^{n} f^{\prime \prime \prime}(i)-\ldots$$ The second idea is to remove the sums $$\sum f^{\prime}, \sum f^{\prime \prime}, \sum f^{\prime \prime \prime}$$, on the right by using the same formula, with $$f$$ successively replaced by $$f^{\prime}, f^{\prime \prime}, f^{\prime \prime \prime}$$ etc.

I don't really understand the step which replaces $$f$$ by its primitive. Using $$F$$ for denoting the primitive of $$f$$ I obtain $$F(n)-F(0)=\sum_{i=1}^{n} F^{}(i)-\frac{1}{2 !} \sum_{i=1}^{n} F^{\prime}(i)+\frac{1}{3 !} \sum_{i=1}^{n} F^{\prime \prime}(i)-\frac{1}{4 !} \sum_{i=1}^{n} F^{\prime \prime \prime}(i)+\ldots$$ but I don't obtain any expression in terms of an integral. Clearly, $$F(n) - F(0) = \int_0^n f(x) \textrm{d}x$$ but since the author mentions that he again denotes the primitive by $$f$$ this doesn't match up with the above formula. Can anyone explain me what my mistake is here?

• Have a look at the Euler's summation formula. An example here. Aug 2 '21 at 9:39
• @rtybase I know that it's the Euler-Mclaurin formula, but I want to understand its above derivation Aug 2 '21 at 9:41
• Then you need to add more context to the question, like specify the textbook and the formula they try to prove in the textbook. Aug 2 '21 at 9:45
• @rtybase they try to give a short derivation of the euler mclaurin formula Aug 2 '21 at 10:32

If you simply replace $$f$$ by $$F$$ with $$F'=f$$, you would get $$F(n)-F(0)=\sum_{i=1}^nF'(i)-\frac 1{2!}\sum_{i=1}^n F''(i)+\frac 1 {3!}\sum_{i=1}^n F'''(i)+\cdots,\qquad (1)$$ which implies $$\int_0^n f(x)~dx=\sum_{i=1}^n f(i)-\frac 1 {2!}\sum_{i=1}^n f'(i)+\frac 1{3!}\sum_{i=1}^n f''(i)+\cdots$$
$$\Leftrightarrow \sum_{i=1}^n f(i)=\int_0^n f(x)~dx+\frac 1 {2!}\sum_{i=1}^n f'(i)-\frac 1{3!}\sum_{i=1}^n f''(i)+\cdots.$$
Your mistake is on the right hand side of (1), where you didn't literally replace $$f$$ by $$F$$ as you did on the left hand side.
• why does the author then say that the primitive is denoted by $f$? Or did I just misunderstand this formulation? Aug 3 '21 at 10:54
• @Sebastian That might be the reason why the author got you confused. What he might mean is that denote its derivative again by $f$. Note that sometimes it is not good to read too much. When you read the line "in order to turn this formula for $\sum f'(i)$ into a formula for $\sum f(i)$", probably you can guess what the author is trying to do: shift the the order of differentiation. Aug 3 '21 at 11:12