Formula for product of polynomial functions Let $f:\mathbb Q \rightarrow \mathbb Q$ be a function such that $f(x)=\displaystyle \sum_{i=0}^n a_ix^i$ with $a_i$ being elements of a subset of rational numbers indexed by non-negative integers from interval $[0;n]$. Let $g:\mathbb Q \rightarrow \mathbb Q$ be defined as $g(x)=\displaystyle \sum_{i=0}^m b_ix^i$ with $b_i$ defined analogically to $a_i$, as a subset of $\mathbb Q$ indexed by an interval of natural numbers $[0;m]$.
We know that $f(x)g(x)= \big (\displaystyle \sum_{i=0}^n a_ix^i \big ) \big ( \displaystyle \sum_{i=0}^mb_ix^i \big )$.
How to prove that $\big (\displaystyle \sum_{i=0}^n a_ix^i \big ) \big ( \displaystyle \sum_{i=0}^mb_ix^i \big )=\displaystyle \sum_{i=0}^{n+m} \big ( \displaystyle \sum_{i=0}^{n+m} a_ib_{n-i} \big)x^i$ - in other words, to achieve the standard formula for polynomial product?
 A: Here is a trick
I often use:
To avoid indexing problems,
define
$a_i = b_j = 0$
for $i > n$ and
$j > m$.
The sums are not really infinite,
since all but a
finite number of terms
are zero.
Then
$\begin{array}\\
\big ( \sum_{i=0}^n a_ix^i \big ) \big ( \sum_{j=0}^mb_jx^j \big )
&=\big ( \sum_{i=0}^{\infty} a_ix^i \big ) \big ( \sum_{j=0}^{\infty}b_jx^j \big )\\
&= \sum_{i=0}^{\infty} \big ( \displaystyle \sum_{j=0}^{i} a_jb_{i-j} \big)x^i\\
&= \sum_{i=0}^{n+m} \big ( \displaystyle \sum_{j=0}^{i} a_jb_{i-j} \big)x^i\\
\end{array}
$
You need to use separate indices
for the $a$-s and $b$-s,
or else confusion and errors follow.
Note that
if $i > n+m$
then $a_j = 0$ if $j > n$
and
$b_{i-j} = 0$
if $j \le n$
because
$i-j
> n+m-n
= m
$.
Therefore,
if $i > n+m$,
$\sum_{j=0}^{i} a_jb_{i-j} 
= 0$.
A: $$\begin{array}\\
S&=\big ( \sum_{i=0}^n a_ix^i \big ) \big ( \sum_{j=0}^mb_jx^j \big )
\\ &=\displaystyle \sum_{i=0}^{n}
\displaystyle \sum_{j=0}^{m} a_ib_{j} x^{i+j}
\\
&=\displaystyle \sum_{k=0}^{n+m}\displaystyle \sum_{i=0}^{n}
\displaystyle \sum_{j=0}^{m} a_ib_{j} x^{i+j} \delta(k-(i+j))
\\
&=\displaystyle \sum_{k=0}^{n+m}\displaystyle \sum_{i=0}^{n}a_i \left[
\displaystyle \sum_{j=0}^{m} b_{j} x^{i+j} \delta(j-(k-i))\right]
\end{array} $$
Note that ...
$$\displaystyle \sum_{j=0}^{m} b_{j} x^{i+j} \delta(j-(k-i)) = b_{k-i}x^k $$
subject to the constraint 
$0 \le \ k-i \le m \implies k-m\le i \le k$
This constraint must be combined with the constraint from the original sum  $ 0 \le i \le n$
together these constraints imply ...
$$ \max(0,k-m) \le i \le \min(k,n)$$
so the final formula should read ...
$$ S =\displaystyle \sum_{k=0}^{n+m}\;\;\displaystyle \sum_{i=\max(0,k-m)}^{\min(n,k)}a_i b_{k-i}x^k$$
