Need clear explanation to Range updates and Range queries in Binary Indexed trees?
Consider an array $A[0, \cdots, n-1]$ and its cumulative sum array $A'$.
Suppose we want to make a range update of $v$ to $A[i, \cdots, j]$. Then $A'$ is changed in the following way:


For $0 \le x &lt; i$: $A'[x]$ does not change;
For $i \le x \le j$: $A'[x]$ is added by $v \ast \left( x-(i-1) \right)$;
For $j &lt; x &lt; n$: $A'[x]$ is added by $v \ast \left( j-(i-1) \right)$.




For your question, why is $v \ast \left( x-(i-1) \right)$? 

First, the specification of range update of BIT Range-Update(v,i,j) means adding value $v$ to each element of $A[i, \cdots, j]$.

Secondly, $A'$ stores the cumulative sums of $A$. For $A'[x], i \le x \le j$, its increment consists of the cumulatively added values preceding it, which is, along with $v$ of itself, $v \ast \left( x-(i-1) \right)$. The increment of $A'[x], j &lt; x &lt; n$ is the same as that of $A'[j]$, which is $v \ast \left( j-(i-1) \right)$.



An example from the post you mentioned is as follows (thanks @JS1; the indices starts from 1 for consistency):

Suppose you had an empty array:

0  0  0  0  0  0  0  0  0  0  (array)
0  0  0  0  0  0  0  0  0  0  (cumulative sums)


And you wanted to make a range update of +5 to [4..8]:

0  0  0  5  5  5  5  5  0  0  (array)
0  0  0  5 10 15 20 25 25 25  (desired cumulative sums)