# Algorithm to polynomial multiplication

I need to create algorithm to polynomial multiplication , but I don't know how to do it. Please for help.

Algorithm to polynomial multiplication

Asked: **
2018-04-25 01:02:57 -0500
**

Seen: **37 times**

Last updated: **Apr 25**

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.

Some questions:

I know that SageMath has algorithms for polynomial multiplication, but I must write it myself. Yes, it is my homework I wrote something like this, but in the end should be showed polynomial, not only factors. I don't know how to do it. Could you help me? Please

W1=[1,2,3,4] W2=[5,4,3,2,1] W3=[]

for i in range(0,len(W1)+len(W2)-1): W3.append(0)

for i in range(0,len(W1)): for j in range(0,len(W2)): W3[i+j]=W3[i+j]+W1[i]*W2[j]

print(W3)

Your algorithm is fine for multiplying the polynomials. What you get is the list of coefficients. (I don't know what you mean by "factors".) If you want a polynomial from this list, you have to build a polynomial ring and get the polynomial from the list of coefficients in the following way: