Rearrange terms in products of power series I'm having trouble to write some functions as a power series when I use the Cauchy product. For example:
$f(z)=\frac{\sin(z)}{z^2 (z-\pi)}$ centered at $z=0$, within the domain $0< \lvert z\lvert < \pi$.
If I write each power series and use the Cauchy product
\begin{equation}
\left(\sum_{n=0}^\infty a_k \right)\left( \sum_{n=0}^\infty b_k \right) = \sum_{n=0}^\infty \sum_{k=0}^n a_k b_{n-k} 
\end{equation}
(considering that the powers of $z$ are within the definition of $a_k$ and $b_k$) then I get:
\begin{equation}
\begin{aligned}
f(z) & = -\frac{1}{\pi} \frac{1}{z^2} \left( \sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)!} z^{2n+1} \right) \left(  \sum_{m=0}^\infty \frac{1}{\pi^m} z^{m} \right) \\
& = -\frac{1}{\pi} \sum_{n=0}^\infty \sum_{k=0}^n  \frac{(-1)^k}{(2k+1)!} \frac{1}{\pi^{n-k}} z^{n+k-1} 
\end{aligned}
\end{equation}
What I don't understand is how I could rearrange the terms in this last series to obtain an expression that looks as $\sum_{n=0}^\infty c_n z^n$.
For example I tried to do the substitution $p=n+k-1$, so $k=p-n+1$, and then (I think):
\begin{equation}
f(z)=\sum_{n=0}^{\infty} \sum_{p=n-1}^{2n-1} \frac{(-1)^{p-n}}{(2(p-n+1)+1)!} \frac{1}{\pi^{2n-p}} z^p
\end{equation}
I'm aware of the question already asked in Laurent series of $\frac {sin(z)}{z^2(z-\pi)}$ , and that I could write the expression for the Cauchy product in that fashion (with the numbers $a_k$ and $b_k$ not including the powers of $z$). But I'm asking this question because I'm courious wether it is possible to make a substition and then arrive at an expression of $f(z)$ in powers of $z$, and thus directly getting the order of the poles.
Thank you very much in advance.
 A: 
We obtain
\begin{align*}
\color{blue}{\frac{\sin(z)}{z^2(\pi-z)}}
&=-\frac{1}{\pi z^2}\left(\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}z^{2n+1}\right)
\left(\sum_{m=0}^{\infty}\frac{1}{\pi^m}z^m\right)\\
&=-\frac{1}{\pi z^2}\sum_{q=0}^{\infty}
\left(\sum_{{2n+1+m=q}\atop{n\geq 0, m\geq 0}}\frac{(-1)^n}{(2n+1)!}\,\frac{1}{\pi^m}\right)z^q\tag{1}\\
&=-\frac{1}{\pi z^2}\sum_{q=0}^{\infty}
\left(\sum_{n=0}^{\left\lfloor\frac{q-1}{2}\right\rfloor}\frac{(-1)^n}{(2n+1)!}\,\frac{1}{\pi^{q-2n-1}}\right)z^q\tag{2}\\
&=-\sum_{q=0}^{\infty}
\left(\sum_{n=0}^{\left\lfloor\frac{q-1}{2}\right\rfloor}\frac{(-1)^n}{(2n+1)!}\,\frac{1}{\pi^{q-2n}}\right)z^{q-2}\\
&\,\,\color{blue}{=\sum_{q=-2}^{\infty}
\left(\sum_{n=0}^{\left\lfloor\frac{q+1}{2}\right\rfloor}\frac{(-1)^{n+1}}{(2n+1)!}\,\frac{1}{\pi^{q-2n+2}}\right)z^{q}}\tag{3}
\end{align*}

Comment:

*

*In (1) we use a convenient notation keeping the coefficients with $m$ and $n$ separately. We only write $z^q$ with $q=2n+1+m$.


*In (2) we observe that since $2n+1$ is odd we have $0\leq n\leq \left\lfloor\frac{q-1}{2}\right\rfloor$ and from $q=2n+1+m$ we substitute $m=q-2n-1$.


*In (3) we shift the index and start with $q=-2$ to obtain a representation with $z^q$.
