There is a mild restriction on a function defined on an interval under which the above statement is true: it is required to be piecewise continuously differentiable. (This means that there are finitely many points in such that is differentiable except possibly at these points, and the derivative is piecewise continuous. We recall that a function is called piecewise continuous if it is continuous except possibly at finitely many points, and at each such point of discontinuity , the one-sided limits and both exist and are finite. Note that both functions in Example 2 satisfy this requirement.