A problem related to arithmetico-geometric sequence Question:

Find the sum of the series: $1 + \frac{2}{3} + \frac{6}{3^2} + \frac{10}{3^3} + \frac{14}{3^4} + ... = 1+\sum_{n=1}^\infty \frac{(4n-2)}{3^n}$

My doubt:
I have taken $\frac{2}{3} + \frac{6}{3^2} + \frac{10}{3^3} + \frac{14}{3^4} + ...$ to be in A.G.P. and calculated the sum using the formula $$S_\infty=\frac{a}{1-r}+\frac{d \cdot r}{(1-r)^2},$$ where $a=\frac23, r=\frac13$ and $d=4$.
I get $S_\infty=4$ and then I add $1$ to it to get the answer $5$.
But my book shows a different method with a different answer ($3$).
Please tell what is wrong with this method.

Let us make the problem more general, replacing $\frac 13$ by 
$x$. So, we have $$S=1+2x+6x^2+10x^3+14x^4+\cdots=1+\sum_{n=1}^\infty(4n-2)x^n$$ that is to say $$S=1+4\sum_{n=1}^\infty nx^n-2\sum_{n=1}^\infty x^n=1+4\color{red}x\sum_{n=1}^\infty nx^{n-1}-2\sum_{n=1}^\infty x^n$$ $$S=1+4x\left(\sum_{n=1}^\infty x^n\right)'-2\left(\sum_{n=1}^\infty x^n\right)$$ $$\sum_{n=1}^\infty x^n=\frac{x}{1-x}\implies \left(\sum_{n=1}^\infty x^n\right)'=\frac{1}{(1-x)^2}$$ All of that makes $$S=1+\frac{4x}{(1-x)^2}-\frac{2x}{1-x}\implies S=\frac{3 x^2+1}{(1-x)^2}$$ Now, replace $x$ by $\frac 13$ to get the answer.
