fixing numerical integration input, omit the last sample since it's not needed