# Rearranging a general closed form linear recurrence sequence

I have the following general closed form linear recurrence equation:

$$x_n=r^{n-1}a+\left(\frac{r^{n-1}-1}{r-1}\right)d, \qquad (n=1,2,3,...)$$

and the next stage in the text shows the equation rearranged as:

$$x_n=\left(a+\frac{d}{r-1}\right)r^{n-1}-\frac{d}{r-1}, \qquad (n=1,2,3,...)$$

I am having trouble seeing how the rearrangement has been made and why it is preferred? The first version of the equation is more readable to me, but the latter seems to be the default way it is written and referred to.

Can you help me to understand how the rearrangement has been made and why it would be preferred?

Thanks.

-
Which text says the second one is "simpler"? –  Ｊ. Ｍ. Oct 15 '11 at 13:40
In the second form the actual computation is just slightly easier since the same $d/(r-1)$ term appears twice, we can recycle its computation. –  Ragib Zaman Oct 15 '11 at 14:00

What I think you wanted to say was that you already have the solution to a recurrence relation. Anyway, if you start with

$$x_n=r^{n-1}a+\left(\frac{r^{n-1}-1}{r-1}\right)d$$

you can then do

$$x_n=r^{n-1}a+\left(\frac{r^{n-1}}{r-1}-\frac1{r-1}\right)d$$

and then

$$x_n=ar^{n-1}+\frac{dr^{n-1}}{r-1}-\frac{d}{r-1}$$

which can be regrouped to yield

$$x_n=\left(a+\frac{d}{r-1}\right)r^{n-1}-\frac{d}{r-1}$$

which is the second bit you have.

As to why the second one is preferred, I've no idea...

-
Thanks for the clear explanation, it has helped a lot! –  Aesir Oct 15 '11 at 13:53