I am studying from Bartle-Shebert and the book says this-
Let $c$ be the point where $f$ and $g$ are not equal.Then, the Riemann sums of $f$ and $g$ are identical with the exception of atmost two points (in the case $c=x_i=x_{i-1}$ is an endpoint). Then, $$|S(f,P)-S(g,P)|=|\sum(f(x_i)-g(x_i))(x_i-x_{i-1})|\le2(|g(c)|+|f(c)|)||P|| $$
Now I can't understand how the last inequality follows. Also I don't see why there are atmost two points at which the Riemann sums are different. If someone can provide a geometrical explanation of this then it would be very helpful.
Note: $P$ is a tagged partition of the interval $[a,b]$ of our consideration and $\{x_0,x_1, ...,x_n\}$ is the partion of $[a,b]$.
PS: I am uploading a picture of the page of the book for reference.
