Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction
Students are normally introduced to complex numbers in their high school algebra course when they
study the solution of quadratic equation. There they are introduced to the notation = -1 . Most
undergraduate students in engineering do not take a course in complex variable theory, but they continue to be exposed to complex numbers or more generally complex variables during their studies on
Laplace Transforms, ODEs, Fourier Analysis
These notes are an in depth review on complex numbers, and how complex numbers are represented
and manipulated in Mathematica. Although the notes do not cover complex functions per se, they do
discuss the exponential function and the logarithmic function. The idea of principal values, and multiple
values of a complex function are also illustrated.
In Mathematica the function I represents
sented by or . These forms for
iifl,
-1 is repre-
(1)
where a and b are real numbers, and = -1 . The component a is called the real part of the complex
number z1 , and b is called the imaginary part of z1 . These quantities are denoted by Re Hz1 L, and
Im Hz1 L. If Re Hz1 L = 0, then z1 is a pure imaginary number. The following is a representation of a
complex number in Mathematica:
z1 = 2.34 + 3 I
2.34+ 3
One of the fundamental building blocks (Atoms) in Mathematica is the head Complex. The arguments of
Complex, however, are always numbers. Here is the FullForm expression for a complex number z1 :
z1 FullForm
Complex@2.34`, 3D
ComplexArithmetic.nb
z1 = a - b
(2)
In Mathematica the function Conjugate determines the complex conjugate of a complex number
Conjugate@z1D
2.34- 3
We can also use the complex conjugate to define the real and imaginary parts of a complex number
Re HzL =
1
2
Hz + zL,
Im HzL =
1
2
Hz - zL
(3)
For example
:
Hz1 + Conjugate@z1DL,
2
82.34, 3 + 0. <
1
2
Hz1 - Conjugate@z1DL>
The second part of the computation shows that when Mathematica does complex algebra with approximate numbers, the result is not always what you would expect. We can use the function Chop to
remove residual components of the complex number when it is less than 10-10 .
:
Hz1 + Conjugate@z1DL,
2
82.34, 3<
1
2
a+ b
a2 + b2
In Mathematica the function Abs determines the absolute value of a complex number
Abs@z1D
3.80468
Note that our definition for the absolute value holds also if b=0, that is if z is a real number
Abs@Re@z1DD
2.34
When a complex number is written in polar form (see below for more details), we can determine the
argument of a complex number using Arg
Arg@z1D
0.90837
z1 + z2 = z2 + z1
HiiL
z1 + Hz2 + z3 L = Hz1 + z2 L + z3
(4)
ComplexArithmetic.nb
HiiiL z1 z2 = z2 z1
HivL z1 Hz2 + z3 L = z1 z2 + z1 z3
HDistributive law L
ComplexArithmetic.nb
(5)
The following plot illustrates the transformation of the complex number w1 = 4 + 6 to polar form
w1 = 4 + 6;
Hvec3 = Graphics@8Blue, Arrow@880, 0<, 8Re@w1D, Im@w1D<<D<DL
Hxcomp = Graphics@8Red, Line@880, 0<, 8Abs@w1D Cos@Arg@w1DD, 0<<D<DL ;
Hycomp = Graphics@8Red, Line@
88Abs@w1D Cos@Arg@w1DD, 0<, 8Abs@w1D Cos@Arg@w1DD, Abs@w1D Sin@Arg@w1DD<<D<DL ;
Hangle = Graphics@Circle@80, 0<, 1.5`, 80, Arg@w1D<DDL ;
Show@vec3, xcomp, ycomp, angle, PlotRange 880, 6<, 80, 7<<,
Ticks 8Range@0, 5, 1D, Range@0, 7, 1D<, AspectRatio 1,
Axes True, AxesLabel 8"x", "y"<, ImageSize 8200, 200<,
Epilog 8Text@"r CosHqL", 83, 0.5`<D, Text@"r SinHqL", 85.2`, 3<D,
Text@"r", 81.5`, 3<D, Text@"q", 80.8`, 0.5`<D<D
y
7
6
5
4
r
r SinHqL
2
1
q
0
where
r CosHqL
x
1
ComplexArithmetic.nb
r=
a2 + b2 =
(6)
The variable q is called the amplitude or argument of z1 . In Mathematica the function Arg computes
the argument of z1 and its value lies between -p and p . This is the principal range of z1 , and q is then
the principal value of z1 . Here is another example calculation , using the Mathematica functions Arg,
Abs:
z1 = 2.34 + 3 ;
8Abs@z1D, Arg@z1D, ArcTan@Im@z1D Re@z1DD<
83.80468, 0.90837, 0.90837<
From the plot we can also compute q using sin-1 I br Mor cos-1 I ar M
8Arg@z1D, ArcSin@Im@z1D Abs@z1DD, ArcCos@Re@z1D Abs@z1DD<
80.90837, 0.90837, 0.90837<
x2
2!
x3
3!
(7)
q2
2!
q3
3!
q4
4!
(8)
q2
2!
q4
4!
q6
4!
+ + q-
q3
3!
q5
5
q7
7!
(9)
Thus
x q = Cos HqL + Sin HqL
(10)
(11)
Also if we write a complex number in polar form, it follows from Euler's formula that
z1 = x + y = r 8Cos HqL + Sin HqL< = r q
(12)
If the complex numbers z1 = a1 + b1 , and z2 = a2 + b2 are expressed in polar form then using
Euler's formula we can write
z1 z2 = r1 r2 8Cos Hq1 + q2 L + Sin Hq1 + q2 L<
(13)
= r1 r2 Hq1 +q2 L
Similarly,
ComplexArithmetic.nb
z1
z2
r1
r2
(14)
r1
r2
Hq1 -q2 L
Equations (13) and (14) can be used to find the nth power of a complex number. Suppose we take
n = 3 , then we can use Euler's formula to write
z31 = r1 q r21 2 q = r31 8Cos H3 qL + Sin H3 qL<
(15)
(16)
-2
z-2
1 = r1 8Cos H-2 q1 L + Sin H-2 q1 L<
(17)
z21
r21
or
So in general we have for any integer n
zn = rn 8Cos Hn qL + Sin Hn qL<
(18)
(19)
ComplexArithmetic.nb
z2 = r2 q2
so that
z1 z2 = r1 r2 Hq1 +q2 M
and if z1 = z2 , we get
z2 = r2 2 q
or in general
zn = rn n q
2pk
n
F + SinB
2pk
n
F , k = 0, 1, 2,
ComplexArithmetic.nb
z = CosB
2pk
3
F + SinB
2pk
3
F , k = 0, 1, 2,
z = Cos@0D + Sin@0D = 1
k = 1:
z = CosB
k = 2:
z = CosB
k = 3:
z = CosB
k = 4:
z = z = CosB
k = 5:
z = z = CosB
2p
F + SinB
4p
F + SinB
3
6p
F + SinB
8p
3
2p
3
4p
3
6p
3
F + SinB
10 p
3
F=-
F=-
1
2
1
2
2
3
F=1
8p
F + SinB
F=-
10 p
3
1
2
F=-
1
2
3
2
It is apparent that after k=2, the roots are repeated, and the same repeatablity of roots occurs if we take
negative values. Thus the unique values are given by k = 0, 1, 2, 3, , n - 1.
Consequently, the n roots of zn = 1 are
z = CosB
2pk
n
F + SinB
2pk
n
F , k = 0, 1, 2, , n - 1
General Analysis
A number w is called the nth root of a complex number if wn = z. We can use the results from the
previous section to determine a formula for finding w. Let us the polar form to write
wn = rn 8Cos Hn fL + Sin Hn fL< = r 8Cos HqL + Sin HqL< = z
(20)
(21)
for k an integer
(22)
q+2 k p
n
(23)
, k = 0, 1, 2, , n - 1
Note the values of f are repeated for k n as Sin and Cos are 2p periodic. Thus the nth root of a
complex number z = r q (z > 0)is
z1n = r1n :Cos
q+2 k p
n
+ Sin
q+2 k p
n
>, k = 0, 1, 2, , n - 1
(24)
ComplexArithmetic.nb
Consider the following example. Suppose we have the equation z8 = 1, then the roots are
z = Cos
2kp
2kp
+ Sin
, k = 0, 1, 2, , 7
2kp
F + SinB
2kp
F, 8k, 0, 7<F N
8
8
81., 0.707107+ 0.707107 , 0.+ 1. , - 0.707107 + 0.707107 ,
- 1., - 0.707107 - 0.707107 , 0.- 1. , 0.707107- 0.707107 <
We can rearrange these roots as ordered pairs in the complex plane using the following rules
orderedPairs = roots . x_Real 8x, 0< . Complex@x_, y_D 8x, y<
881., 0<, 80.707107, 0.707107<, 80., 1.<, 8- 0.707107, 0.707107<,
8- 1., 0<, 8- 0.707107, - 0.707107<, 80., - 1.<, 80.707107, - 0.707107<<
Here is a plot of the roots displayed as ordered pairs in the complex plane
ListPlot@orderedPairs, PlotStyle 8Blue, PointSize@LargeD<,
AspectRatio 1, AxesLabel 8"x", "y"<D
y
1.0
0.5
-1.0
-0.5
0.5
1.0
-0.5
-1.0
Example Calculation
In this example we will find the roots of
z3 = 8
First we write the RHS of Eq. (47) as a complex number in polar form
8 8 HCos@0 + 2 p kD + Sin@0 + 2 p kDL, k = 1, 2,
so that
(25)
10
ComplexArithmetic.nb
2pk
3
F + SinB
2pk
3
F , k = 0, 1, 2
k = 1 : z = 2 CosB
k = 2 : z = 2 CosB
2p
F + SinB
3
4p
F + SinB
2p
3
4p
3
F =2 -
F =2 -
1
2
1
2
3
2
3
2
3 , z3 = -1 -
Note that the complex roots appear as a complex conjuagte pair! Let see what Mathematica produces
z . SolveAz3 8E
92, - 1 -
3 , -1 +
3=
2 p + 2 pk
3
F + SinB
2 p + 2 pk
3
F, k = 0, 1, 2
=-
1
2
2p
3
F + SinB
2p
3
3
2
Thus
z2 = 2 H-1L23 = -1 +
p + 2 pk
3
F + SinB
p + 2 pk
3
F, k = 0, 1, 2
ComplexArithmetic.nb
11
1
2
3
2
Thus
z3 = -2 H-1L13 = -1 -
3 , z3 = -1 -
or
z1 = 2, z2 = 2 H-1L23 , z3 = -2 H-1L13
(26)
Thus for a complex number z we can write the complex exponential function as
z = z+2 p = z 2 p = z
(27)
Thus it follows that the exponential function f HzL = z is periodic, with period 2p
f HzL = f Hz + 2 p L
(28)
Hence for any point z = x + y in the infinite horizontal strip -p < y < p of width 2 p, the function
f HzL = f Hz + n p L, where n = 0, 1, 2, etc. The strip -p < y < p is called the fundamental
region for the exponential function. Within this region the exponential function is single valued.
Logarithmic Function
Let z = w be the exponential of a complex number w. Then the inverse of the exponential function is
defined as the logarithm of a complex variable z , i.e.,
w = Log HzL, where z = w
(29)
Note that Log(z) is not defined at z = 0, as w > 0 for all values of w. In polar form Log(z) can be
expressed as
Log HzL = Log Ir q M = Log HrL + Hq + 2 n pL, n = 0, 1, 2, ,
(30)
We have used the fact that Hq+2 n pL = q , for n = 0, 1, 2, , where r = | z |, and q = arg (z).
The above results show that the logarithm of a complex number is multivalued. Let us consider the
following example. Let
12
ComplexArithmetic.nb
(31)
By inspection we find r = 2, and q = p. ( Note we can compute q using q = Cos-1 H-2 2L). Here are
some of the multiple values of Log(-2)
Table@Log@2D + Hp + 2 n pL, 8n, 0, 3<D N
80.693147+ 3.14159 , 0.693147+ 9.42478 , 0.693147+ 15.708 , 0.693147+ 21.9911 <
Consider next the example Log[2]. Then r = 2, and q = Cos-1 H2 2L = 0 and from (31) the multiple
values of Log[2] are
Table@Log@2D + H0 + 2 n pL, 8n, 0, 3<D N
80.693147, 0.693147+ 6.28319 , 0.693147+ 12.5664 , 0.693147+ 18.8496 <
It is customary to choose n = 0 as the principal value for the logarithm of a complex number. In this way
if z is real we get the same value as the logarithm of a real number. Thus the principal value of Log[z] is
Log HzL = Log H z L + Arg HzL = Log HrL + q
(32)
Mathematica automatically computes the principal value of Log HzL as seen below
z1 = 2.34 + 3 ;
8Log@z1D, Log@2.D, Log@- 2.D<
81.33623+ 0.90837 , 0.693147, 0.693147+ 3.14159 <
Note the last result follows from Eq. (31): -2 = r {Cos (q) + Sin (q)} fl r = 2 and q = p; hence
Log@-2D = Log@2D + p
Thus Arg Hz1 L approaches q1 = p from above and Arg Hz2 Lapproaches q2 = -p from below.
z3 = 2 + 0.0001 ; z4 = 2 - 0.0001 ;
8Log@z3D, Log@z4D<
80.693147+ 0.00005 , 0.693147- 0.00005 <
Here is a plot that demonstrates the limiting process for Arg(z) as z1 , z2 approach the negative real
axis.
ComplexArithmetic.nb
13
1
y
0.2
0.4
0.6
0.8
1.0
-1
-2
-3
Here is a similar plot that demonstrates the limiting process for Arg(z) as z1 , z2 approach the positive
real axis.
Plot@Evaluate@8Arg@2 + yD, Arg@2 - yD< . y zD, 8z, 0, 1<,
PlotStyle 8RGBColor@0, 0, 1D, RGBColor@1, 0, 0D<, AxesLabel 8"y", "q1 ,q2 "<D
q1 ,q2
0.4
0.2
y
0.2
0.4
0.6
0.8
1.0
-0.2
-0.4
(33)
(34)
=r
Hq+2 n pL
Since z is a single value, we must have n = 0. Thus if a is a integer (35) is given by the principal
value of Log(z).
2
14
ComplexArithmetic.nb
Since z2 is a single value, we must have n = 0. Thus if a is a integer (35) is given by the principal
value of Log(z).
In our next example we take a=1/2, and z = 24 + 36. In this case Arg HzL = q = tan-1 H36 24L.
Thus (35) becomes
w = z12 = H24 + 36L12 = r12
q +2 n p
2
(36)
I M
2
, w2 = r12
q+2 p
2
(37)
, with n = 1
Of course the roots of w2 = z can also be determined using the polar form of a complex number. In
polar form we can write
w = r12 :Cos
q + 2 kp
2
+ Sin
q+2 k p
2
>, k = 0, 1
(38)
q
2
+ Sin
q
2
>, k = 0
where q = Tan-1 I 36
M = 56.3099 so that q1 =
24
q
2
(39)
= 28.15, and r = 12
q +2 p
.
2
q+2 p
2
+ Sin
q+2 p
2
>, k = 1
(40)
Let us now investigate the multivalued properties of the function w2 = z. In the following plot we show a
plot of the complex number z = x + y = 24 + 26 in the z-plane
ComplexArithmetic.nb
z = 24 + 36;
vec3 =
Graphics@8Blue, Arrow@880, 0<, 8Abs@zD Cos@Arg@zDD, Abs@zD Sin@Arg@zDD<<D<D;
path = Graphics@8Red, Circle@80, 0<, Abs@zD, 80, 2 p<D<D;
angle1 = Graphics@Circle@80, 0<, 20, 80, Arg@zD<DD;
plt2 = Show@vec3, path, angle1,
AspectRatio 1, Axes True, AxesLabel 8"x", "y"<, ImageSize 8200, 200<,
PlotLabel -> "z plane\n", Epilog 8Text@"P", 825, 40<D, Text@"q", 810, 6<D<D
z plane
y
40
20
q
-40
-20
20
40
-20
-40
If we think of z as a function, then for fixed r, the function z maps the point P onto the red circle, for
different values of arg(z). In the next plot we show the two roots of w2 = z in the w-plane, where
wi = ui + vi . We can think of w = z12 as a mapping that takes any point in the z-plane and maps it
into the w-plane. We will show that this mapping is not one-to-one.
15
16
ComplexArithmetic.nb
Abs@zD CosB
Arg@zD
2
F,
Abs@zD CosB
Abs@zD SinB
Arg@zD
2
+ pF,
Arg@zD
2
Abs@zD SinB
Arg@zD
2
+ pF>>F>F ;
5
P= w1
q1 L
-5
P=w2
-5
The above plots show that the point P in the z-plane is mapped into the point w1 in the w-plane, where
w1 given by
r q2 =
w1 = z12 =
r q1 ,
with q1 = 28.15
(41)
If we allow the point P in the z-plane to make a complete circuit (counterclockwise) about the origin,
then q' = q + 2 p and the point P in the z-plane is now mapped into the point w2 in the w-plane,
where w2 is given by
w2 =
q+2p
2
r q2 . with q2 = 208.15
(42)
If we allow the point P in the z-plane to make two complete circuits (counterclockwise) about the origin,
then q'' = q + 4 p and the point P in the z-plane is now mapped back into point w1 in the w-plane since
w3 =
q+4p
2
r q1 +2p =
r q1 = w1 , with q1 = 28.15
(43)
where we have used the fact that 2 p = 1. If the point P makes 3 complete circuits about the origin,
the point P is mapped back into w2 in the w-plane. Thus we say w = z12 is a two-valued function of z,
or w is a collection of two single-valued functions of z, called branches. If we restrict q to be in the range
0 q < 2 p, then w = z12 is single-valued, and we call this the principal branch of the function w. The
principal range of q is 0 q < 2 p .
In the plot above we show the branch cut as the positive real axis. The point z = 0, defines the branch
point.
ComplexArithmetic.nb
17
In the plot above we show the branch cut as the positive real axis. The point z = 0, defines the branch
point.
23
(44)
= 16
Let us attempt to determine the solution to Eq. (44) by hand. If we let w = z2 - 5, then w = 1632 . Thus
w = 64, Solving for z we get:
Case(i) If w = 64, then z2 - 5 = 64, which implies that
z=
69
59
2
We get the same result if we apply Solve when we write our equation Iz2 - 5M == 163
Remove@zD;
2
59 =, 9z
59 =, 9z -
69 =, 9z
69 ==
Now let us take these solutions and see if they satisfy the equation
2
Now suppose we attempt to solve Eq. (44) by expressing the equation in the form
Iz2 - 5M
23
= 16
(45)
Let us apply the solution we found previously to this form of the equation. We see that not all solutions
satisfy Eq. (45)
SimplifyBIz2 - 5M
23
- 16 . solF
The above calculation shows that the solutions z = 59 do not satisfy the equation in its original
form, as it requires H-1L23 == 1, which cannot be true. These are called parasitic solutions of Eq.
(45). We can always force Mathematica to find parasitic solutions by using the option VerifySolutions>False in Solve:
18
ComplexArithmetic.nb
sol = SolveBIz2 - 5M
99z -
69 =, 9z
23
69 ==
On the other hand, if we set the option VerifySolutionsTrue (default value) we get the appropriate
solutions
sol = SolveBIz2 - 5M
99z -
69 =, 9z
23
16, zF
69 ==
We can readily see what the problem is. If z > 5, then z2 - 5 > 0, so that we have w23 = 16.We
can solve this equation to find two real roots. However, if z > 5, then z2 - 5 < 0 and when this
negative quantity is raised to a fractional power, we get a complex number, which is inconsistent with
the RHS of Eqn.(46). Suppose z = - 59 (this is one of the parasitic roots) so that z2 - 5 = -64.
Then the LHS of Eqn.(46) evaluates to
LHS = JIz2 - 5M . z -
59 N
23
- 8. + 13.8564
Thus Iz2 - 5M
23
is a complex number and therefore can never equal the RHS of Eqn(46), even though
References
These notes were compiled from a number of sources. The following were most helpful