Complex Numbers in Quadratic Equations
Complex Numbers in Quadratic Equations
1. Complex Numbers
x2 + 1 = 0
x 2 = −1
√
x = ± −1?
1
we use the symbol R to denote the set of all real numbers
2 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Imaginary Numbers
√
We define −1 = i (or j in some texts)2
2
If you read engineering books rather than maths books you may see j used
in place of i - this is just a quirk in notation
3 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Imaginary Numbers
4 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Imaginary Numbers
5 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Examples:
√ √ √ √
−16 = 16 × −1 = 16 × −1 = ±4i
√ √ √ √ √
−3 = 3 × −1 = 3 × −1 = ±i 3
1 √ √ √ √
(−121) 2 = −121 = 123 × −1 = 121 × −1 = ±11i
6 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
7 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Example:
2i × 5i = 10 × i 2
√
but we know i = −1 , and therefore i 2 = −1
Hence 10 × i 2 = 10 × −1 = −10
8 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Examples:
i 3 = i 2 × i = − − 1 × i = −i
√ √ √
i −1 = 1
= √1 = √1 × √−1 = −1
= − −1 = −i
i −1 −1 −1 −1
9 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Complex Numbers
So x = −1 + i or−1 − i
x is now a number with a real number part (1) and an
imaginary number part (±i).
70
20
15 60
50
15
10
40
10
5 30
20
5
0
10
0
0 −5 −5 −4 −3 −2 −1 0 1 2 3 4 5
−5 −4 −3 −2 −1 0 1 2 3 4 5 −5 −4 −3 −2 −1 0 1 2 3 4 5
(i) Two equal roots (ii) Two distinct roots (iii) No real roots
The above diagrams of ax 2 + bx + c (a 6= 0) show the three
possible cases:
In (i) the curve touches the x-axis, i.e. for y = 0 there are
two equal values of x — b 2 − 4ac = 0.
In (ii) the curve cuts the x-axis, i.e. for y = 0 there are two
real distinct values of x, i.e. real roots — b 2 − 4ac > 0.
In (iii) the does not cut the x-axis, i.e. for y = 0 there is no
real values of x, i.e. complex roots — b 2 − 4ac < 0.
11 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Complex Numbers
Case 2: The need for Complex Numbers
Very Useful Mathematical Representation, to name a few:
Widely used in many branches of Mathematics, Engineering,
Physics and other scientific disciplines
Control theory
Advanced calculus: Improper integrals, Differential equations, Dynamic
equations
Fluid dynamics — potential flow, flow fields
Electromagnetism and electrical engineering: Alternating current, phase
induced in systems
Quantum mechanics
Relativity
Geometry: Fractals (e.g. the Mandelbrot set and Julia sets), Triangles —
Steiner inellipse
Algebraic number theory
Analytic number theory
Mathematical Notation:
The set of all real numbers is denoted by R
The set of all complex numbers is denoted by C
The real part of a complex number z is denoted by
Re(z) or <(z)
The imaginary part of a complex number z is denoted by
Im(z) or =(z)
14 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
15 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Examples:
(2 + 3i) + (4 − i) = 6 + 2i
(4 − 2i) − (3 + 5i) = 1 − 7i
16 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Examples:
4 + 5i and 4 − 5i are conjugate complex numbers.
7 − 3i is the conjugate of 7 + 3i
Example:
z = 7 − 3i then z = 7 + 3i
18 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
a + bi
z= , a, b, c, d ∈ R
c + di
a + bi
z= , a, b, c, d ∈ R
c + di
20 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
2 + 9i
z=
5 − 2i
2 + 9i 5 + 2i 10 + 4i + 45i + 18i 2
× =
5 − 2i 5 + 2i 25 − 4i 2
−8 + 49i
=
29
−8 49
= + i
29 29
21 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
That is to say:
<(z1 ) = <(z2 ) or a = c,
AND
=(z1 ) = =(z2 ) or b = d
22 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Example:
If x + iy = (3 − 2i)(5 + i) what are the values of x and y ?
x + iy = (3 − 2i)(5 + i)
= 15 + 3i − 10i + 2i 2
= 13 − 7i
So x = 13 and y = −7.
23 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
A complex number is zero if and only if the real part and the
imaginary part are both zero i.e.
a + bi = 0 ↔ a = 0 and b = 0.
24 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
25 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
" "
or or
Im Im
b P (a, b) b a + bi
O a ! or Re O a ! or Re
,
This representation is known as the Argand diagram.
26 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
z2
z1 + z2
z1 − z2
27 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
z1
z1 + z2
z1
z2
a P (a, b)
"
r b
φ
!
O
b b
(Simply) φ = arg z = argument z = arctan( ) = tan−1 ( )
a a
(Note: This is a simple application of basic trigonometry)
to make up what is known as the polar coordinates of a point.
30 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
" "
r r
φ
φ
! !
O O
Quadrant 1 Quadrant 2
" "
φ φ
! !
O O
r r
1 1
P P
Quadrant 3 Quadrant 4
31 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
" "
r r
φ
φ
! !
O O
Quadrant 1 Quadrant 2
" "
φ φ
! !
O O
r r
1 1
P P
Quadrant 3 Quadrant 4
All angles given in radians here 32 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
arctan( ba )
if x >0
arctan( ba ) + π
if x <0 and y ≥0
arctan( ba ) − π if x <0 and y <0
φ = arg z = π
2 if x =0 and y >0
− π2 <0
if x =0 and y
indeterminate if x =0 and y =0
The polar angle for the complex number 0 is undefined, but usual
arbitrary choice is the angle 0.
33 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Modulus q q
r = | √12 − i √12 | = ( √12 )2 + (− √12 )2 = 12 + 12 = 1
Sketching the Argand diagram indicates that we are in the
fourth quadrant, therefore angle is negative between 0 and 90
(or between 270 and 360) degrees.
(− √12 )
Argument = arctan( √1 ) = arctan(−1) = −45◦ or 315◦
2
(Radians sim.)
34 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
√
1 3
4 + 4 i
35 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
a P (a, b)
"
r b
φ
!
O
36 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
"
r r sin φ
φ
!
O
a = r cos φ
b = r sin φ
Giving z = a + bi
37 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Exercise
38 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Trigonometric form
From last slide
a = r cos φ
b = r sin φ
Giving z = a + bi
z = r cos φ + r sin φ × i
= r(cos φ + i sin φ)
>> s q r t ( −1)
ans = 0 + 1.0000 i
% S y m b o l i c Eqns S o l n
>> syms x ;
>> f = x ˆ2 + 1 ;
>> s o l v e ( f )
ans =
i
−i
% Polynomial Roots
>> p = [ 1 0 1 ] ;
>> r o o t s ( p )
ans =
0 + 1.0000 i
0 − 1.0000 i
40 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
% Must u s e ∗ o p e r a t o r w i t h i e v e n t h o u g h t h i s i s not d i s p l a y e d
>> c1 = 3 + 4∗ i
c1 =
3.0000 + 4.0000 i
% MATLAB a l s o a l l o w s t h e u s e o f j
>> c2 = 2 + 4∗ j
c2 =
2.0000 + 4.0000 i
1.0000 + 2.0000 i
41 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
>> c = 4+3∗ i
c =
4.0000 + 3.0000 i
% A c o m p l e x number o f m a g n i t u d e 11 and p h a s e a n g l e 0 . 7 r a d i a n s
>> z = 1 1 ∗ ( c o s ( 0 . 7 ) + s i n ( 0 . 7 ) ∗ i )
z =
8.4133 + 7.0864 i
% R e c o v e r t h e m a g n i t u d e and p h a s e o f ” z ”
>> [ a b s ( z ) , a n g l e ( z ) ]
ans =
11.0000 0.7000
42 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
% T r i g . Form : A c o m p l e x number o f
% m a g n i t u d e 11 and p h a s e a n g l e 0 . 7 r a d i a n s
>> z = 1 1 ∗ ( c o s ( 0 . 7 ) + s i n ( 0 . 7 ) ∗ i )
z =
8.4133 + 7.0864 i
% So Need t o u s e a b s ( ) and a n g l e ( ) t o
% R e c o v e r t h e m a g n i t u d e and p h a s e o f ” z ”
>> [ a b s ( z ) , a n g l e ( z ) ]
ans =
11.0000 0.7000
43 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
>> c1 = 3 + 4∗ i ;
>> c2 = 2 + 4∗ j ;
>> c1 + c2
ans = 5.0000 + 8.0000 i
>> c1 − c2
ans = 1
>> i ˆ2
a n s = −1
>> c1 ∗ c2
a n s = −10.0000 +20.0000 i
>> c1 / c2
ans = 1.1000 − 0.2000 i
44 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
45 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
polar() Example
>> z = 1 1 ∗ ( c o s ( 0 . 7 ) + s i n ( 0 . 7 ) ∗ i )
z =
8.4133 + 7.0864 i
>> p o l a r ( [ 0 a n g l e ( z ) ] , [ 0 a b s ( z ) ] , ’ − r ’ ) ;
46 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
10
150 30
180 0
210 330
240 300
270
47 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
compass() Plot
>> c1 = 3 + 4∗ i ;
>> compass ( c1 ) ;
48 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
3
150 30
2
180 0
210 330
240 300
270
Phasor Notation
re iφ = r (cos φ + i sin φ)
51 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
>> exp ( i ∗ ( p i / 4 ) )
>> [ a b s ( z ) , a n g l e ( z ) ]
52 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Phasers on stun!
53 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
54 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
eiφ + e−iφ
cos φ =
2
eiφ − e−iφ
sin φ =
2i
55 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
56 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
z1 z2 = r1 e iφ1 × r2 e iφ2
= r1 r2 e iφ1 e iφ2
z1 z2 = [r1 r2 , φ1 + φ2 ]
√ √ √
z1
If z1 = 3 2 + 3 2i and z2 = 3 2 3 + 32 i, find z1 z2 and z2 ,
leave your answer in polar form.
√
3 3
Evaluate ( 21 + 2 i) , give your answer in Cartesian form.
60 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
61 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
In particular:
62 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
63 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
64 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
% N a t u r a l f r e q u e n c y i s 2∗ p i r a d i a n s
% I f s a m p l e r a t e i s F s HZ t h e n 1 HZ i s 2∗ p i / F s
% I f wave f r e q u e n c y i s F w t h e n f r e q u e n c y i s
% F w∗ ( 2 ∗ p i / F s )
% s e t n s a m p l e s s t e p s up t o sum d u r a t i o n n s e c ∗ F s where
% nsec i s the duration in seconds
% So we g e t y = amp∗ s i n ( 2 ∗ p i ∗n∗F w/ F s ) ;
F s = 11025;
F w = 440;
nsec = 2;
d u r= n s e c ∗ F s ;
n = 0 : dur ;
y = amp∗ s i n ( 2 ∗ p i ∗n∗F w/ F s ) ;
f i g u r e (1)
plot (y (1:500));
t i t l e ( ’N s e c o n d D u r a t i o n S i n e Wave ’ ) ;
65 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
% C o s i n e i s same a s S i n e ( e x c e p t 90 d e g r e e s o u t o f p h a s e )
y c = amp∗ c o s ( 2 ∗ p i ∗n∗F w/ F s ) ;
figure (2);
h o l d on ;
p l o t ( yc , ’ b ’ ) ;
plot (y , ’ r ’ ) ;
t i t l e ( ’ Cos ( B l u e ) / S i n ( Red ) P l o t ( Note Phase D i f f e r e n c e ) ’ ) ;
hold o f f ;
66 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
67 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
% S i m p l e S i n A m p l i t u d e Demo
samp freq = 400;
dur = 800; % 2 seconds
amp = 1 ; p h a s e = 0 ; f r e q = 1 ;
s 1 = m y s i n ( amp , f r e q , p h a s e , dur , s a m p f r e q ) ;
f p r i n t f ( ’ I n i t i a l Wave : \ t A m p l i t u d e = . . . \ n ’ , amp ,
f r e q , phase , . . . ) ;
% change a m p l i t u d e
amp = i n p u t ( ’ \ n E n t e r A m p l i t u d e : \ n\n ’ ) ;
s 2 = m y s i n ( amp , f r e q , p h a s e , dur , s a m p f r e q ) ;
h o l d on ;
p l o t ( a x i s x , s2 , ’ r ’ ) ;
s e t ( gca , ’ XTick ’ , [ 0 : 9 0 : a x i s x ( end ) ] ) ;
68 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
x = 0 : dur −1;
phase = phase ∗ p i /180;
s = amp∗ s i n ( 2∗ p i ∗ x ∗ f r e q / s a m p f r e q + p h a s e ) ;
69 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
0.8
0.6
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1
0 90 180 270 360 450 540 630 720
70 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
% S i m p l e S i n F r e q u e n c y Demo
samp freq = 400;
dur = 800; % 2 seconds
amp = 1 ; p h a s e = 0 ; f r e q = 1 ;
s 1 = m y s i n ( amp , f r e q , p h a s e , dur , s a m p f r e q ) ;
% change a m p l i t u d e
f r e q = i n p u t ( ’ \ n E n t e r F r e q u e n c y : \ n\n ’ ) ;
s 2 = m y s i n ( amp , f r e q , p h a s e , dur , s a m p f r e q ) ;
h o l d on ;
p l o t ( a x i s x , s2 , ’ r ’ ) ;
s e t ( gca , ’ XTick ’ , [ 0 : 9 0 : a x i s x ( end ) ] ) ;
71 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
0.8
0.6
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1
0 90 180 270 360 450 540 630 720
72 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
% S i m p l e S i n Phase Demo
samp freq = 400;
dur = 800; % 2 seconds
amp = 1 ; p h a s e = 0 ; f r e q = 1 ;
s 1 = m y s i n ( amp , f r e q , p h a s e , dur , s a m p f r e q ) ;
% change a m p l i t u d e
p h a s e = i n p u t ( ’ \ n E n t e r Phase : \ n\n ’ ) ;
s 2 = m y s i n ( amp , f r e q , p h a s e , dur , s a m p f r e q ) ;
h o l d on ;
p l o t ( a x i s x , s2 , ’ r ’ ) ;
s e t ( gca , ’ XTick ’ , [ 0 : 9 0 : a x i s x ( end ) ] ) ;
73 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
0.8
0.6
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1
0 90 180 270 360 450 540 630
74 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
76 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Trigonometry Equation
Ae iθ + Be iφ = Ce iγ
77 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
Simplify √
5 cos(ωt + 53◦ ) + 2 cos(ωt + 45◦ )
78 / 81
Imaginary Numbers Complex Numbers MATLAB Phasors
◦ √ ◦
<[5e i53 + 2e i45 ] = (3 + 4i) + (1 + i)
= (4 + 5i)
◦
= 6.4e i51
So:
√ ◦
5 cos(ωt + 53◦ ) + 2 cos(ωt + 45◦ ) = <[6.4e i(wt+51 ) ]
= 6.4 cos(ωt + 51◦ )
◦ ◦ ◦
e i30 + e i150 + e −i90 = e i90 (= i)
So we get:
<[e i90 ] = cos(90◦ )
= 0
So:
or
cos(ωt + 30◦ ) + cos(ωt + 150◦ ) + sin(ωt) = 0