# [Maxima] how to convince Maxima to carry out complex arithmetic

Robert Dodier robert.dodier at gmail.com
Thu Sep 17 11:37:51 CDT 2009

```Hi, I'm trying to convince Maxima to carry out complex arithmetic.
It doesn't seem to want to. What am I missing here?
Branches don't come into play if all you want is 1/z or w/z
where w and z are complex numbers, right?

(%i1) 1/(1 + %i);
1
(%o1)                               ------
%i + 1

Hmm, didn't happen as a simplification.
OK, I'll try it the long way.

(%i2) carg (%o1);
%pi
(%o2)                                - ---
4
(%i3) cabs (%o1);
1
(%o3)                               -------
sqrt(2)
(%i4) %o3 * exp(%i*%o2);
1        %i
------- - -------
sqrt(2)   sqrt(2)
(%o4)                          -----------------
sqrt(2)
(%i5) expand (%);
1   %i
(%o5)                               - - --
2   2

OK, great. Is there some other way?
expand? float? numer? rat? Nope.

(%i6) expand (1/(1 + %i));
1
(%o6)                               ------
%i + 1
(%i7) float (1/(1 + %i));
1
(%o7)                              --------
%i + 1.0
(%i8) 1/(1 + %i), numer;
1
(%o8)                               ------
%i + 1
(%i9) rat (1/(1 + %i));
1
(%o9)/R/                            ------
%i + 1

Am I looking for the wrong thing here?