Go to CCP Homepage Go to Materials Page Go to Engineering Mathematics Materials Go to Table of Contents
Go Back One Page Go Forward One Page

Mathematica Tutor

Part 13: Basic operations on complex numbers

In this part we examine how Mathematica deals with complex numbers.

  1. 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:

  2. 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]

  3. 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.

  4. 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.

  5. 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.

  6. 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.)

Go to CCP Homepage Go to Materials Page Go to Engineering Mathematics Materials Go to Table of Contents
Go Back One Page Go Forward One Page


modules at math.duke.edu Copyright CCP and the author(s), 1998, 1999, 2000