derivatives calculus
it's just reverse derivative and then for the range minus the lower by the bigger index