I know you can easily expand $(x+y)^n$ using the binomial expansion. However, is there a simple summation formula for the following expansion?
$$(a_0+a_1x+a_2x^2+...+a_nx^n)^2$$
I found something called the multinomial theorem on wikipedia but I'm not sure if that applies to this specific problem. Thanks.
The multinomial formula certainly applies. But for squares it is simpler: $$ (u_0 + u_1 + u_2 + \ldots + u_n)^2 = (u_0^2 + u_1^2 + \ldots u_n^2) + 2 (u_0 u_1 + u_0 u_2 + \ldots u_0 u_n + u_1 u_2 + \ldots u_1 u_n + \ldots + u_{n - 1} u_n) $$ Or just: $$ (u_0 + \ldots + u_n)^2 = \sum_{\substack{0 \le i \le n \\ 0 \le j \le n}} u_i u_j $$ But you are presumably interested in: $$ \left(\sum_{0 \le k \le n} a_k x^k\right)^2 = \sum_{\substack{0 \le i \le n \\ 0 \le j \le n}} a_i a_j x^{i + j} = \sum_{0 \le r \le 2 n} x^r \sum_{0 \le s \le r} a_s a_{r - s} $$ (in this formula assume $a_{n + 1} = \ldots = a_{2 n} = 0$)