# How can I generate a polynomial? [closed]

Suppose, z1 = 0.1 + 0.5i and z2 = 0.1 - 0.5i are from in a unit circle.

How can I find a polynomial of the form $z^2 - az -b$ from (z - z1)*(z - z2)

I tried,

z1 = 0.1 + 0.5i;
z2 = 0.1 - 0.5i ;

Expand[(z-z1)(z-z2)]


It gave the folowing output in Mathematica7

$0.01+0. i-0.25 i^2-0.2 z+0. i z+z^2$

And,

$-0.25 i^2+z^2-0.2 z+0.01$

in Mathematica-11.

• There's no such thing as i. For an imaginary unit, type I - capitalization matters. Use also Chop. – corey979 Dec 6 '16 at 0:51
• You need to use a capital I to represent the complex part of your z1 and z2. This will help. – user6014 Dec 6 '16 at 0:52
• @user6014 Imaginary part; the whole number is complex. In fact, a real number is also complex - it just has its imaginary part equal to zero. – corey979 Dec 6 '16 at 0:53
• Ah, I was sloppy with it. Thanks for clarifying. – user6014 Dec 6 '16 at 0:55

Consider (with the capital I's):

z1 = 0.1 + 0.5 I;
z2 = 0.1 - 0.5 I;
Chop@Expand[(z - z1) (z - z2)]


which will give you

0.26 - 0.2 z + z^2


where your $a =$ -0.2 and $b =$ 0.26.