I'm given the Euler summation formula in it's simplest terms, namely
$$
\sum_{v = 0}^{n} f(v)=\frac{1}{2}\left( f(n)+f(0) \right)
+ \int_{0}^{n} f(x)\textrm{d}x + \int_{0}^{n} \left(
x - \left\lfloor x \right\rfloor -\frac{1}{2}
\right) f'(x)\textrm{d}x
.$$
Given the information that $f$ has $k$ continuous derivatives, I should extend this formula by repeated integration by parts. Denoting $\left(x-\left\lfloor x \right\rfloor-\frac{1}{2}\right)$ with $P_1(x)$ I obtain
$$
\int_{0}^{n} P_1(x) f'(x)\textrm{d}x
= \left[ P_2(x)f'(x) \right]_0^n- \int_{0}^{n} P_2f''(x)\textrm{d}x
$$
but now the question arises how one should define $P_2(x)$ (i.e.
the antiderivative of $P_1(x)$)
$$
P_1(x) = \begin{cases}
x-\frac{1}{2}, \quad 0\le x < 1\\
x-n-\frac{1}{2}, \quad n \le x < n+1 \ (n \ge 1)
\end{cases}
$$
so I thought one could choose
$$
P_2(x) = \begin{cases}
\frac{1}{2}x^2-\frac{1}{2}x, \quad 0\le x < 1 \\[5pt]
\frac{1}{2}x^2-nx-\frac{1}{2}x, \quad n \le x < n+1 \ (n \ge 1)
\end{cases}
$$
Is my choice for $P_2$ reasonable?
When trying to verify the correctness of my choice I considered
\begin{align*} \sum_{i = 0}^{n} i = \int_{0}^{n} x\textrm{d}x + \frac{1}{2}\left( n + 0 \right) + \left[ P_2 \right]_0^n - \int_{0}^{n} 0\cdot P_3\textrm{d}x = \frac{1}{2}n^2 + \frac{1}{2}n + \left[ \frac{1}{2}n^2 - n^2 - \frac{1}{2}n \right] = 0 .\end{align*} So apparently I made some mistake ...