but I am having difficulty understanding how this is achieved.
Can anyone explain how this is done?
Thanks
In the second expression the is one greater than it is in the first one because it starts at 1 (not 0) and goes to n (not n-1). You could account for this by subtracting one from the when changing the limits of the summation: