In the Gas-Up problem, how is the amount of gas the same up to a cyclic shift regardless of starting city?
This is over a year later, but I also found this question really frustrating, but after reading other explanations, I've finally figured it out. So, I want to share with everyone my findings!

In this problem we're guaranteed that the amount of gas is enough to go around the road once. We then have this equality 
$Amount_{gas}$ = $Amount_{distance}$
$$\sum_{i=1}^{n} x_{i} = 0$$
where $x_{i}$ is the Amount of gas at station i - the cost: 
$$G[i] - D[i]$$ 

If we reach a point $j$ such that: 

$$\sum_{i=1}^{j} x_{i} &lt; 0$$

This must mean 
$$\sum_{i=j + 1}^{n} x_{i} &gt; 0$$

Why!?!??! Because the problem promises us enough gas to cover the distance!
$$\sum_{i=1}^{j} x_{i}  + \sum_{i=j + 1}^{n} x_{i} = 0$$

If we start at point $j + 1$, which is right after we don't have enough gas,
the equation becomes
$$\sum_{i=j + 1}^{n} x_{i} + \sum_{i=1}^{j} x_{i} = 0$$

Starting at $j + 1$ means we have $\sum_{i=j + 1}^{n} x_{i}$ gas before j, so we won't have a negative number.

This agrees with the solution in EPI because we are in fact doing a vertical shift on our piecewise function $\sum_{i=1}^{n} G_{i} - D_{i} $
The pictoral graph in EPI helps us see that it's not good enough to merely spit out the first j that gives us a negative value. If instead, we find the minimum, we will have more than enough gas before we reach j (first point that gives us negative amount of gas left) and cover subsequent negative gas stations until the aforementioned minimum.