<s>[INST] Sum of infinite series with variable range between -1 to 1 Let $S$ denote the infinite sum $2 + 5x + 9x^2 + 14x^3 + 20x^4 + ....$, where   $| x | < 1$, then what is the value of $S$?
I am not able to find the generalized form. What is the trick to solve it?
 [/INST] HINT:
$$S=2+5x+9x^2+14x^3+20x^4+\cdots$$
$$(1-x)S=2+(5-2)x+(9-5)x^2+(14-9)x^3+(20-14)x^4+\cdots$$
Let $T=(1-x)S$
$$T(1-x)=2+(3-2)x+(4-3)x^2+(5-4)x^4+\cdots=1+\dfrac1{1-x}$$ for $|x|<1$
</s>