Why do the first two terms of Euler's summation by parts formula not cancel each other out?

121 Views Asked by At

Euler's summation by parts formula states that: $$ \sum_{y < n \leq x} f(n) = \int_y^x{f(t)dt} + \int_y^x(t - \lfloor t \rfloor)f'(t)dt +f(x)(\lfloor x \rfloor - x) -f(y)(\lfloor y \rfloor -y)$$ (source: https://asgarli.files.wordpress.com/2013/02/euler-summation-formula.pdf)

Lets only look at the first of those two terms (for the time being):

$$\int_y^x{f(t)dt} + \int_y^x(t - \lfloor t \rfloor)f'(t)dt$$

$$\int_y^x(t - \lfloor t \rfloor)f'(t)dt = \int_y^xtf'(t)dt - \int_y^x\lfloor t \rfloor f'(t)dt$$

Taking $\int_2^xtf'(t)dt$ we have through integration by parts, where $u=t$ and $f'(t)=dv$

$$\int_y^xtf'(t)dt = tf(t)\Big|_y^x - \int_y^xf(t)dt = xf(x) - yf(y) - \int_y^xf(t)$$ Substituting into our original equation we have: $$ \sum_{y < n \leq x} f(n) = \\\int_y^x{f(t)dt} + \int_y^x(t - \lfloor t \rfloor)f'(t)dt +f(x)(\lfloor x \rfloor - x) -f(y)(\lfloor y \rfloor -y) = \\\int_y^x{f(t)dt} + xf(x) - yf(y) - \int_y^xf(t)dt - \int_y^x\lfloor t \rfloor f'(t)dt+f(x)(\lfloor x \rfloor - x) -f(y)(\lfloor y \rfloor -y) =\\xf(x)-yf(y)+(\lfloor x \rfloor - x)f(x) -f(y)(\lfloor y \rfloor -y) -\int_y^x\lfloor t \rfloor f'(t)dt= \\f(x)(x+\lfloor x \rfloor -x) - f(y)(y+\lfloor y \rfloor -y) - \int_y^x\lfloor t \rfloor f'(t)dt= \lfloor x \rfloor f(x) - \lfloor y \rfloor f(y) - \int_y^x\lfloor t \rfloor f'(t)dt$$

This result is obviously incorrect (it is significantly shorter and simplet than the original formula for one), also, take, for instance $f(n) = 1$, $y=1$, $x=2$

I particularly find it suspicious that the first term is cancelled out in its entirety by the second. But I can not seem to understand where my flaw is. Any help would be much appreciated.

1

There are 1 best solutions below

3
On BEST ANSWER

It appears the function is completely correct. In fact, in the link you gave, they derive the exact same expression, a few lines from the bottom. And if you try your example, there is only one term in the sum, and it equals $1$, whereas on the other side of the equation, we get $2f(2)-f(1)=1$, which is exactly as we wanted. What's the problem?