# [Maxima] Plotting Function with complex parameter

Sat May 9 02:25:14 CDT 2009

```Maximilian Kreuter pisze:
> Hi there,
>
> can I use Maxima to plot a given function with complex numbers as input?
>
> e.g. ich have the following function:
>
> f(x):=x^3+5;
>
> now I can plot this (using real numbers):
>
> plot2d(f(x), [x,-4,4]);
>
> but to following (using complex numbers fails):
>
> plot2d(f(x), [x,-4*%i,4*%i]);
>
> Is there a way to do this?
>
> Cheers
>
> Maxx
Hi,

Intresting question.
Where you have function using complex number as an input
it can give in output:
- complex number
- real/integer number
In first case you have 4 dimension so one can't draw in 3D. It is
possible to do an animation or 2 3D diagrama showing only real an
imaginary part of output,
see for example :
http://commons.wikimedia.org/wiki/File:Riemann_surface_sqrt.jpg
( BTW : How to do it in MAxima)
In second case it is possible to do it because it is 3D diagram
IMHO Maxima uses only real numbers in ranges, but :

Or if you only want to draw 2D diagram in 3D and use complex numnbers in
range then define your own function :
plot3d_c(f(x,y),c_left_down,c_right_up):=
(plot3d(f(x,y),
[x,realpart(c_left_down),realpart(c_right_up)],[y,imagpart(c_left_down),imagpart(c_right_up)]);

HTH