# To build a complex polynomial

For example I have this polynomiyal:

```
p=(z-2*I)*(z+1*I)
```

I want sage show me someting like:

```
z^2-z*(1*I)-2
```

It doesn't mind the number of roots.

To build a complex polynomial

asked
**
2016-01-17 13:22:11 -0600
**

This post is a wiki. Anyone with karma >750 is welcome to improve it.

For example I have this polynomiyal:

```
p=(z-2*I)*(z+1*I)
```

I want sage show me someting like:

```
z^2-z*(1*I)-2
```

It doesn't mind the number of roots.

add a comment

1

Is that what you want?

```
sage: var('z')
sage: p=(z-2*I)*(z+1*I)
sage: p.expand()
z^2 - I*z + 2
```

Asked: **
2016-01-17 13:22:11 -0600
**

Seen: **55 times**

Last updated: **Jan 17 '16**

Extended Euclid with polynomials

Find minimum value of polynomial

Expand a polynomial into Schubert basis

complex, real, common ring, crash in 'vector' constructor

Problems with computing discriminants and resultants.

Convert all complex numbers in array/matrix to value 0 or remove these numbers

Coefficients of a constant polynomial

Division algorithm in a polynomial ring with variable coefficients

System of polynomial inequalities

Find specific linear combination in multivariate polynomial ring

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.