difficulty to simplyfy a sum expression
I am trying to find the sum of a sequence, the problem is already solved in the book but not in a detailed way. While I understand the sum calculation process I don't understand the simplification result. I have marked in red the difference in the solution. In particular it says:
(na/2) - (a/2)*(g^1 + g^2 + ... + g^n) + (nb/2) + (b/2)*(g^1 + g^2+ ... + g^n) =
=(n/2)(a+b) + [(1-g^n)/(1-g)]*[(b-a)/2]
My result is this:
=(n/2)(a+b) + [(g-g^n+1)/(1-g)]*[(b-a)/2]
I thought it could be some error, but there is the same result in an older version of the book. It might be something easy but still I cannot configure it out.
Thank you all in advance,