$S=1+2i+3i^2+4i^3+\dots+(n+1)i^n$; $4\mid n$; closed form for $S$ $$S=1+2i+3i^2+4i^3+\dots+(n+1)i^n$$
where $4\mid n$. How can I simplify this exprerssion so as to obtain a general expression?
 A: Hint...consider $$S-iS$$ and use the formula for the sum of a geometric series...
A: Consider functions $f(x) = 1 + 2x + 3x^2 +\ldots +(n+1)x^n$ and $F(x) = 1+ x + x^2 +\ldots + x^{n+1}$. We have $F'(x) = f(x)$. On the other hand, $F(x)(x-1) = x^{n+2} -1$ which implies $F(x) = \frac{x^{n+2}-1}{x-1}$ for $x\neq 1$. From this we have $$f(x) = F'(x) = \frac{(n+2)x^{n+1}(x-1)-(x^{n+2}-1)}{(x-1)^2}$$
All you have to do is evaluate at $i$.
A: Hint.
You have $i^2=-1$, $i^3=-i$ and $i^4=1$.
So because $n$ is a multiple of $4$:
$$S=\sum_{k=0}^n (k+1)i^k=\sum_{k=0}^{n/4} 4(k+1)+i\sum_{k=0}^{n/4} (4(k+1)+1)-\sum_{k=0}^{n/4} (4(k+1)+2)-i\sum_{k=0}^{n/4} (4(k+1)+3).$$
You now just have to simplify all the four sums.
A: Let $n=4m$.
$$\begin{align}
S&=\boxed{\begin{array}
&\;\;\;\;1&+2i&+3i^2&+4i^3\\
+5i^4&+6i^5&+7i^6&+8i^7\\
+\vdots\\
+(4m-3)i^{4m-4}&+(4m-2)i^{4m-3}&-(4m-1)i^{4m-2}&+4mi^{4m-1}\\
+(4m+1)i^{4m}\\
\end{array}}\\\\
&=\boxed{\begin{array}
&\;\;\;1&+2i&-3&-4i\\
+5&+6i&-7&-8i\\
+\vdots\\
+(4m-3)&+(4m-2)i&-(4m-1)&-4mi\\
+(4m+1)\\
\end{array}}\\\\
&=\;\;\;\;\;\;[1-3+5-7+\cdots+(4m-3)-(4m-1)]\\
&\;\;\;\;+i\;[2-4+6-8+\cdots +(4m-2)-4m]\\
&\;\;\;\;\;\;\;\;\;+(4m+1)\\
&=[\overbrace{-2-2-\cdots-2}^m]+i[\overbrace{-2-2\cdots-2}^m]+(4m+1)\\
&=-2m+i(-2m)+(4m+1)\\
&=2m+1-i2m\\
&=\left(\frac n2+1\right)-i\frac n2
\end{align}$$
