answered 9 years ago
Is that what you want?
sage: var('z') sage: p=(z-2*I)*(z+1*I) sage: p.expand() z^2 - I*z + 2