0
$\begingroup$

I am trying to figure out how to plot $4z^3-iz^2+7z+5-1$ in maple and am currently having issues on how to make this work. My code so far is

with(plots):

f := (x, i) ->4x^3-ix^2+7x+5-i

complexplot(f(x, i), x=-10 .. 10,i=-5..5)

I am getting this error:

Warning, expecting only range variable ix in expressions [5-Re(-4*x^3+ix^2+i-7*x), -Im(-4*x^3+ix^2+i-7*x)] to be plotted but found names [i, x]

I am trying to get this to plot so I can use the Newton-Raphson Algorithm on it to find its roots.

  • 0
    $i$ is not a variable, it's the number such that $i^2=-1$. In Maple, it is represented by $I$.2017-02-15

2 Answers 2

3
restart;
with(plots):
f:=(z)->4*z^2-I*z^2+7*z+5-I
complexplot(f(z),z=-10..10,axes=boxed)

enter image description here

If you meant to say that z is a complex number then you have to use complexplot3d like @Leox suggested.

complexplot3d(f(z),-2-2*I .. 2+2*I)

enter image description here

2
> with(plots):
> f := z->4*z^3-I*z^2+5*z+5-I;
> complexplot3d(f , -2-I .. 2+I  );

It works.