Structure of product of two polynominals $\left( \sum_{k=0}^{n} a_k x^k \right) \cdot \left( \sum_{l=0}^{m} b_l y^l \right)$ I am interested in the product
$$ z = f(x) \cdot g(y) = \left( a_0 + a_1 x + a_2 x^2 + \cdots + a_n x^n \right) \cdot \left( b_0 + b_1 y + b_2 y^2 + \cdots + b_m y^m \right) $$
With $n = 1$, $m = 2$ when calculating and renaming the regrouped factors with coefficients $c$ this leads to
$$ z = c_0 + c_1 x + c_2 y + c_3 x y + c_4 y^2 + c_5 x y^2 $$
since I want to approximate k data points I express this in the following matrix notation
$$\begin{bmatrix} z_1 \\ z_2 \\ \vdots \\ z_k \end{bmatrix} = \begin{bmatrix} 1 & x_1 & y_1 & x_1 y_1 & y_1^2 & x_1 y_1^2 \\ 1 & x_2 & y_2 & x_2 y_2 & y_2^2 & x_2 y_2^2 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ 1 & x_k & y_k & x_k y_k & y_k^2 & x_k y_k^2 \\ \end{bmatrix} \cdot \begin{bmatrix} c_0 \\ c_1 \\ c_2 \\ c_3 \\ c_4 \\ c_5 \end{bmatrix}$$
Starting from
$$z = \left( \sum_{k=0}^{n} a_k x^k \right) \cdot \left( \sum_{l=0}^{m} b_l y^l \right)$$
Is there an equivalent representation to express this matrices in general that means without assuming $n = 1$, $m = 2$. I would be very grateful about your help and remarks!
 A: Looking at the expression of $z$ in the special case $n=1, m=2$ we see
\begin{align*}
z &= c_0 + c_1 x + c_2 y + c_3 x y + c_4 y^2 + c_5 x y^2\\
&=\left(c_0 + c_1 x\right)+\left(c_2 + c_3 x \right)y+\left(c_4 + c_5 x \right)y^2\tag{1}
\end{align*}
We have in (1) a sum of terms ordered in increasing powers of $y^j, 0\leq j\leq 2$ and within $y^j$ we have an order in increasing powers of $x^i, 0\leq i\leq 1$.

In general we have
\begin{align*}
z&=\left(\sum_{i=0}^na_ix^i\right)\left(\sum_{j=0}^m b_jy^j\right)\\
&=\sum_{j=0}^mb_j\sum_{i=0}^na_ix^iy^j\tag{2.1}\\\
&=\sum_{j=0}^m\left(\sum_{i=0}^n\underbrace{a_ib_j}_{c_t} x^i\right)y^j\tag{2.2}\\
\end{align*}

Comment:

*

*In (2.1) we rearrange the sums in increasing powers of $y$.


*In (2.2) we write the inner sum to easily see the coefficients $a_ib_j=c_t$ with $0\leq i\leq n, 0\leq j\leq m$ or equivalently $0\leq t\leq mn+m+n$.

We can write (2.2) as
\begin{align*}
z&=\sum_{j=0}^m\left(\sum_{i=0}^n\underbrace{a_ib_j}_{c_t} x^i\right)y^j\\
&=\left(x^{i(t)}y^{j(t)}\right)^{T}_{0\leq t \leq mn+m+n}{\left(a_i(t)b_j(t)\right)}_{0\leq t \leq mn+m+n}\tag{3.1}\\
&=\left(x^{i(t)}y^{j(t)}\right)^{T}_{0\leq t \leq mn+m+n}(c_t)_{0\leq t \leq mn+m+n}\tag{3.2}
\end{align*}

Comment:

*

*In (3.1) we have a product of a row vector (i.e. a transposed column vector) with a column vector and take a bijective mapping between the sets
\begin{align*}
\{(j,i):0\leq j\leq n, 0\leq i\leq m\}\qquad\text{and}\qquad \{t:0\leq t\leq (n+1)(m+1)-1=nm+m+n\}
\end{align*}
We consider the pair $(i,j)=(i(t),j(t))$ dependent on $t$ via the relation
\begin{align*}
t=(n+1)j+i\qquad &0\leq j\leq m\\
&0\leq i\leq n
\end{align*}


*In (3.2) we set  $c_t:=a_{i(t)}b_{j(t)}$ and have a representation of (2.2) in matrix form of order
\begin{align*}
\left(1\times 1\right)\quad\text{equal to}\quad\left(1\times (nm+m+n+1)\right)\times\left((nm+m+n+1)\times 1\right)
\end{align*}

We finally derive from (3.2) a matrix equation for $k$ data points $\left(z_q\right)_{1\leq q\leq k}$. We obtain from (2.2) and (3.2)
\begin{align*}
\color{blue}{\begin{pmatrix}
z_q\\
\end{pmatrix}_{1\leq q\leq k}}
&=
\begin{pmatrix}
\sum_{j=0}^m\sum_{i=0}^na_ib_jx_{1}^iy_{1}^j\\
\sum_{j=0}^m\sum_{i=0}^na_ib_jx_{2}^iy_{2}^j\\
\vdots\\
\sum_{j=0}^m\sum_{i=0}^na_ib_jx_{k}^iy_{k}^j\\
\end{pmatrix}\\
&=
\color{blue}{\begin{pmatrix}
x_{q}^{i(t)}y_{q}^{j(t)}\\
\end{pmatrix}_{{1\leq q\leq k}\atop{0\leq t \leq mn+m+n}}
\begin{pmatrix}
a_i(t)b_j(t)\\
\end{pmatrix}_{0\leq t \leq mn+m+n}}
\end{align*}

