In this part we examine how Mathematica deals with complex numbers.
The imaginary unit is denoted by I(upper-case "eye") in Mathematica. So, to assign 5+3i to a, enter a = 5 + 3*I
Enter the following complex numbers in your worksheet:
a = 5 + 3i
b = 2 - 4i
c = - 3 + i
d = - 2 - 4i
Enter the following lines of Mathematica code, and describe what each of the Mathematica commands does. Check by trying with a number different from a.
Re[a]
Im[a]
Abs[a]
Conjugate[a]
The Arg function needs special attention. Enter each of the following:
Arg[a]
Arg[b]
Arg[c]
Arg[d]
What is the range of the Arg function? Describe carefully what the Arg function does.
It is often useful to consider complex numbers
in their polar form (R, Theta). We can write a simple Mathematica function to
do the conversion since R is just the absolute value of the complex number z and
Theta is z's argument. Enter the following function: PolarForm[z_]:= {Abs[z], Arg[z]}
Now, we can convert the complex number a from above to its polar form. The second
commmand below just gives a decimal answer. Enter ap = PolarForm[a]
N[ap]
Repeat this for b to get bp and find its decimal form.
We can write another simple Mathematica
function to convert from the polar form of a complex number to its "rectangular" form:
z = x + y*I. We know that x = R*cos(Theta) and y = R*sin(Theta). Enter the following
function: ComplexForm[{R_,Theta_}]:= R*Cos[Theta] + R*Sin[Theta]*I
Lets convert ap from polar form back to a normal complex number. Enter ComplexForm[ap]
Repeat this for bp to get the original b back.
Calculate the polar form of a*b.
How is the polar form of the product related to the polar forms of the factors?
(Hint: Look at both the "exact" polar forms and their conversions to decimals.)