# How to simplify power series?

My textbook was simplifying a power series. I was able to follow their work until the last line.

Where did the "$$-2$$" come from?

Why were they able to cancel out one of the $$(n+r)'s$$, $$C_n$$'s, and $$x^{n+r-1}$$'s?

$$\underline{\textrm{Image from textbook}}$$

They didn't show some simplification. In the line above the last line, look at the first two terms. You can factor out the entire second term and get: $$3(n+r-1) + 1$$
$$3(n+r)\cdot (n+r-1)+(n+r)$$
Now we factor out $$(n+r)$$:
$$(n+r)\cdot (3\cdot (n+r-1)+1)=(n+r)\cdot (3n+3r\underbrace{-3+1}_{-2})=(n+r)\cdot (3n+3r-2)$$