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)}$

Here's how I did it:
let $S = 1 + 3x + 5x^2 + 7x^3 + ....$
By expansion, $S = \displaystyle\sum_{n=0}^{\infty}(2n+1)x^n .... (1)$
but similarly, $S = \displaystyle\sum_{n=1}^{\infty}(2n-1)x^{n-1} ....(2)$
Examining $(2)$, $(2n-1)x^{n-1} = \displaystyle\frac{1}{x}(2n-1)x^n$
$ = \displaystyle\frac{1}{x}(2n+1-2)x^n = \displaystyle\frac{1}{x}[(2n+1)x^n - 2x^n]$
So $(2)$ becomes
$S = \displaystyle\frac{1}{x}\sum_{n=1}^{\infty}[(2n+1)x^n - 2x^n]$
But using $(1)$, we get 
$S = \displaystyle\frac{1}{x}(S-1)- \frac{2}{x}\sum_{n=1}^{\infty} x^n ....(3)$
(making term limits of $(1)$ as 1 and infinity and subtracting the first term.)
Now $\displaystyle\sum_{n=1}^{r} x^n = x + x^2 + x^3 + .... = x(1 + x + x^2 + ...)$ is the geometric series $\displaystyle\frac{x(1-x^r)}{1-x}$.
Hence $(3)$ becomes 
$S = \displaystyle\frac{1}{x}(S-1)- \displaystyle\frac{2(1-x^r)}{1-x}$
which makes $S = \displaystyle\frac{x+1-2x^{r+1}}{(1-x)^2}$ for $x>1$
or $S = \displaystyle\frac{x+1}{(1-x)^2}$ if $0<x<1$.
