# Is my formula for the coefficients of the product $\left(\sum_{i=0}^n f_i x^i \right)\cdot\left(\sum_{i=0}^m g_i x^i \right)$?

Let's assume that $$f(x)=\sum_{i=0}^n f_i x^i$$ and $$g(x)=\sum_{i=0}^m g_i x^i$$ where $$\{f_i\}_{i=0}^n\cup\{g_i\}_{i=0}^m\subset\mathbb{F}$$ and $$n,m\in\mathbb{N}$$, where $$\mathbb{F}$$ is a field. I tried to find a formula for the given product $$f(x)\cdot g(x)$$. For simplicity, I tried to figure out a formula for $$n=2,m=3$$. Namely $$f(x)\cdot g(x)= \left(\sum_{i=0}^2 f_i x^i\right)\cdot\left(\sum_{i=0}^3 g_i x^i\right)=$$ $$=f_0 g_0+ \left(f_0 g_1+f_1 g_0\right)x+\left(f_0 g_2+f_1 g_1+f_2 g_0\right)x^2+\left(f_0 g_3+f_1 g_2+f_2 g_1+f_3 g_0\right)x^3 +\left(f_1 g_3+f_2 g_2+f_3 g_1\right)x^4+\left(f_2 g_3+f_3 g_2\right)x^5=$$ $$=\left(\sum_{i+j=0} f_i g_j\right)x^0+ \left(\sum_{i+j=1} f_i g_j\right)x^1+ \left(\sum_{i+j=2} f_i g_j\right)x^2+ \left(\sum_{i+j=3} f_i g_j\right)x^3+ \left(\sum_{i+j=4} f_i g_j\right)x^4+ \left(\sum_{i+j=5} f_i g_j\right)x^5$$ $$=\left(\sum_{k=0}^5 \left(\sum_{i+j=k} f_ig_j\right)x^k\right)$$ Thus I ended up to the form $$f(x)\cdot g(x)=\left(\sum_{k=0}^{n+m} \left(\sum_{i+j=k} f_ig_j\right)x^k\right)$$ where $$f(x)=\sum_{i=0}^n f_i x^i$$ and $$g(x)=\sum_{i=0}^m g_i x^i$$, for $$\{f_i\}_{i=0}^n\cup\{g_i\}_{i=0}^m\subset\mathbb{F}$$ and $$n,m\in\mathbb{N}$$. Is the above formula correct? If not, could you, please, indicate my mistakes? Thank you very much in advance!!

• Yes, that's right. Sep 17, 2020 at 17:26
• See Cauchy Product.
– robjohn
Sep 17, 2020 at 17:31

I expect that it’s just a typo, but you want $$f_ig_{\color{red}j}$$ in the inner summation.
$$\sum_{\substack{i+j=k\\0\le i\le n\\0\le j\le m}}f_ig_j\,.$$
A better approach in my view is simply to say that any coefficients outside those ranges are $$0$$.