This might be an insanely dumb question but I just spent about four hours figuring out how to show that for $0<a<1$ and $N\leq b<N+1$, the following holds
$$\sum_{n=1}^{N}f(n)=\int_{a}^{b}f(x)dx+\int_{a}^{b}f'(x)\langle x\rangle dx+f(a)\langle a\rangle-f(b)\langle b\rangle$$ where $\langle x\rangle$ is the fractional part of $x$. My proof goes like this:
Let $$E=\sum_{n=1}^{N}f(n)-\int_{a}^{b}f(x)dx$$ so that $$\sum_{n=1}^{N}f(n)=\int_{a}^{b}f(x)dx+E$$ Skipping over some details, we can write $E=\int_{a}^{b}f(x)d\alpha-\int_{a}^{b}f(x)dx$ where $\alpha(x)=\sum_{a<n\leq b}H(x-n)$ where $H$ is the Heaviside step function. It just so happens that when we are summing over 1 to N this is the floor function, so after some rearranging and integrating by parts I get $$E = -\left(f(b)(b-\lfloor b\rfloor)-f(a)(a-\lfloor a\rfloor)-\int_{a}^{b}f'(x)(x-\lfloor x\rfloor)dx\right) = -\left(f(b)\langle b\rangle-f(a)\langle a\rangle-\int_{a}^{b}f'(x)\langle x\rangle dx\right) = \int_{a}^{b}f'(x)\langle x\rangle dx+f(a)\langle a\rangle-f(b)\langle b\rangle$$ and the result follows.
Unfortunately my homework is to show that $$\sum_{a<n\leq b}f(n)=\int_{a}^{b}f(x)dx+\int_{a}^{b}f'(x)\langle x\rangle dx+f(a)\langle a\rangle-f(b)\langle b\rangle$$Is there a nice way to show that the first implies the second without rewriting the entire proof? The issue is the bold part of the proof—if we're not summing from 1 to n but rather, say, m to n then $\alpha$ doesn't turn into the floor function. I can't think of a simple way to generalize this—maybe I'm just not seeing something obvious.