4.4 Complex Numbers
You can enter complex numbers in Mathematica TE just by including the constant I, equal to . Make sure that you type a capital I. If you are using notebooks, you can also enter I as by typing ii. The form is normally what is used in output. Note that an ordinary i means a variable named , not .
Numerical functions of complex variables.
This gives the imaginary number .
In[1]:= Sqrt[-4]
Out[1]=
This gives the product of two complex numbers.
In[2]:= (4 + 3 I) (2 - I)
Out[2]=
This gives their ratio.
In[3]:= w = (4 + 3 I) / (2 - I)
Out[3]=
These are the rectangular coordinates of as a point in the complex plane.
In[4]:= {Re[w], Im[w]}
Out[4]=
Taking the conjugate of reverses the sign of its imaginary part.
In[5]:= Conjugate[z = 3 - 4 I]
Out[5]=
The absolute value of a complex number is .
In[6]:= Abs[z]
Out[6]=
This is an equivalent definition of the absolute value.
In[7]:= Sqrt[ z Conjugate[z] ]
Out[7]=
These are the polar coordinates of .
In[8]:= {Abs[z], Arg[z]}
Out[8]=
Here is the numerical value of a complex exponential.
In[9]:= N[ Exp[2 + 9 I] ]
Out[9]=
This gives a complex number result.
In[10]:= N[ Log[-2] ]
Out[10]=
Mathematica TE can evaluate logarithms with complex arguments.
In[11]:= N[ Log[2 + 8 I] ]
Out[11]=