Next: Algebra Up: Numbers Previous: Sums and Products

### Complex Numbers

The imaginary  unit  is denoted by %I in Maxima, and by I in Maple and Mathematica. All three know how to handle complex numbers, although in Maxima you may have to force things a little:

Maxima:

Maple:

Mathematica:

In Maxima you can convert a complex number given in rectangular format  to angular format as follows:

Now the same in Maple:

And now it is Mathematica's term:

Here we had to assemble the number by hand. There is no precooked Polarform function. We can do it by hand in Maxima and Maple too. Here's Maxima:

and now the same in Maple:

Whatever the form of the number, we can always extract its imaginary  and real part. This is how we would do it in Maxima:

Function radcan simplifies an arithmetic expression by converting it into a canonical form.

Now the same in Maple:

and in Mathematica:

All three programs are clever enough to know that . Here's Maxima:

(C33) carg(-1);
(D33)                                 %PI
(C34)

Here's Maple:
> argument(-1);
Pi

>

But Mathematica has just a little problem with it:
In[10]:= Arg[-1];

In[11]:= Arg[-1 + 0 I]

Out[11]= Pi

In[12]:=

Its function Arg works on complex numbers only.

Next: Algebra Up: Numbers Previous: Sums and Products
Zdzislaw Meglicki
2001-02-26