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.

Since $S(f,P) = \sum_{j=1}^n f(\xi_j)(x_j - x_{j-1})$ and $S(g,P) = \sum_{j=1}^n g(\xi_j)(x_j - x_{j-1})$ where $\xi_j \in [x_{j-1},x_j]$, the difference of sums is zero unless $c$ is an intermediate point for both $f$ and $g$ where $f(c) \neq g(c)$.
If $c = \xi_j \in (x_{j-1} , x_j)$ then only one subinterval has a non-vanishing contribution to the difference
$$|S(f,P) - S(g,P)| = |f(c) - g(c)|(x_j - x_{j-1}) \leqslant (|f(c) + |g(c)|) \|P\|$$
The only other cases where the two sums are not identical are where $c = \xi_j = x_j \text{ or } x_{j-1}$ for some $j$ and here is where the factor of $2$ is introduced in the inequality.
For example, if $c = \xi_j = x_j$, then $$|S(f,P) - S(g,P)| = |(f(c) - g(c))(x_j - x_{j-1}) + (f(c) - g(c))(x_{j+1} - x_{j})| \\ \leqslant (|f(c) + |g(c)|)(x_j - x_{j-1}) + (|f(c) + |g(c)|)(x_{j+1} - x_{j}) $$