<s>[INST] Find the sum to n term of the series. $1+3x+5x^2+7x^3................, X\ne1$ Here, $a=1, d=2, b=1, r=x$
\begin{align}
S_n&= \frac{ab}{1-r}+\frac{bdr(1-r{^n}^{-1})}{(1-r)^2}-\frac{[a+(n-1)d]br^n}{1-r}\\
S_n&=\frac 1 {1-x}+\frac{ 2x(1-x{^n}^{-1})} {(1-x)^2}-\frac{[1+(n-1)(2)]x^n} {1-  x}\\
&= \frac 1 {1-x}+\frac{2x}{(1-x)^2}-\frac {2x.x{^n}^{-1}}{(1-x)^2}-\frac{[1+2n-2]x^n}{(1-x)}\\
&= \frac 1 {1-x}+\frac{2x}{(1-x)^2}-\frac {2x^n}{(1-x)^2}-\frac{[2n-1]x^n}{(1-x)}\\
\end{align}
Is it correct. I have not got the answer, please show me how to move to this answer without skipping any line
$\frac {1-3x} {(1-x)^2}+\frac {2x^n}{(1-x)^2}-\frac{(2n-1)x^n}{(1-x)}$
 [/INST] Here's a pretty simple approach:
$
S = 1 + 3x + 5x^2 + 7x^3 + \cdots + (2t + 1)x^t \\
\implies xS = x + 3x^2 + 5x^3 + \cdots + (2t - 1)x^t + (2t + 1)x^{t+1} \\
$
where $t = n - 1$. Subtracting $xS$ from $S$,
$$
(1 - x)S = 1 + 2x + 2x^2 + 2x^3 + \cdots + 2x^t + (2t+1)x^{t+1}.
$$
Replacing $t$ by $n - 1$,
$
(1-x)S = [-1 + (2n - 1)x^n] + 2(1 + x + x^2 + \cdots + x^{n-1})\\
\implies (1-x)S = [-1 + (2n - 1)x^n] + 2\frac{1 - x^n}{1 - x} \\
\implies S = \frac{(2n - 1)x^n}{1 - x} - \frac{1}{1-x} + 2\frac{1-x^n}{(1-x)^2}.
$
By the way, it's not important for the condition $0<x<1$ to hold, unless you're summing an infinite series.
</s>