When estimating the convergence of a Riemann sum to its integral, or equivalently the error in numerical integration, the commonly used bound is by upper bounding it's first derivative (see, for example the section on wikipedia).
Specifically, the inequality
$\left| \int_a^b f(x)\,dx - (b - a) f(a) \right| \leq {(b - a)^2 \over 2} \sup_{a \leq x \leq b} \left| f'(x) \right|$
implies that the error $E_{n}$ of an $n$ term Riemann sum is bounded by
$E_n \leq \frac{1}{2n}\sup_{0 \leq x \leq 1} \left| f'(x) \right|$
However, this is seemingly poor if the maximum of the first derivative is very peaked. A smooth step function, for example, would have Riemann sum converging faster than the bound suggests: consider the separately the subsets of the domain where the first derivative is small and large, and add the errors together. In the former subset you may use a smaller maximum for the derivative.
My question is about improving this to use the total variation of the function $f$ instead of the derivative. Intuitively if the function has large derivative --- but only briefly, like the step function --- then this should be evident from its total variation. Is such a bound possible?