Complex numbers
Complex functions
BMEG2410: Complex Analysis Part I
Prof. Scott YUAN
Department of Biomedical Engineering
The Chinese University of Hong Kong
September 2020
Lecture notes: Courtesy of Prof. Hongsheng LI
Complex numbers
Complex functions
Outline
1 Complex numbers
Geometry of complex numbers
Polar form
2 Complex functions
Calculus—reminders
Analytic functions
Exponential and trigonometric functions
Logarithm and power functions
Complex numbers Geometry of complex numbers
Complex functions Polar form
Reading materials:
Complex numbers: Kreyszig 13.1, 13.2
Complex functions: Kreyszig 13.3, 13.4, 13.5, 13.6, 13.7
Complex numbers Geometry of complex numbers
Complex functions Polar form
Why we need complex numbers
Consider the following equations
x2 = −1
and
x2 − 10x + 40 = 0
Solution:
√
x = −1
√ and √
−b ± b2 − 4ac 10 ± 100 − 4 × 1 × 40
x= =
2a 2
√
10 ± −60
=
2
For those solutions, we need complex numbers to represent them
Complex numbers Geometry of complex numbers
Complex functions Polar form
Definition of complex numbers
Complex numbers (set C) appeared as an extension of real numbers (set R) to
solve polynomial equations. The modern presentation is to define a complex
number, z as a couple of real numbers (x, y) as
z = x + iy, where i2 = −1
x is called real part, y is called imaginary part, i is the imaginary unit
x = Re{z}, y = Im{z}
Interpretation: z = x + iy has x real ones and y imaginary units
√
Historically, the pure imaginary unit i was written directly as −1; however,
this notation was leading to contradictions like
( √ √
√ √ −1, from a × a = a
6 i × i = −1 × −1 = √ √ √ √
−1×−1 = 1, from a × b = a × b
NOTE: Far beyond polynomial rooting, it is through complex analysis that
complex numbers have become essential to very diverse fields: geometry,
communications, electromagnetism, continuum mechanics.
Complex numbers Geometry of complex numbers
Complex functions Polar form
Algebra of complex numbers
Two complex numbers z1 = x1 + iy1 and z2 = x2 + iy2
Equality:
z1 = z2 ⇐⇒ x1 = x2 and y1 = y2
Addition:
z1 + z2 = (x1 + x2 ) + i(y1 + y2 )
Subtraction:
z1 − z2 = (x1 − x2 ) + i(y1 − y2 )
Multiplication:
z1 × z2 = (x1 + iy1 ) × (x2 + iy2 )
= x1 x2 + ix1 y2 + iy1 x2 + i2 y1 y2 (recall i2 = −1)
= (x1 x2 − y1 y2 ) + i(x1 y2 + x2 y1 )
Division:
z = z1 /z2 ⇐⇒ z1 = zz2 ⇐⇒ x1 + iy1 = (x + iy) × (x2 + iy2 )
z= x1 +iy1
x2 +iy2
= x1 x2 +y1 y2
x2 2 + i x2 xy12 −x 1 y2
+y 2
2 +y2 2 2
Complex numbers Geometry of complex numbers
Complex functions Polar form
Algebra of complex numbers
Complex numbers enjoy the same structure as real numbers
commutative addition: z1 + z2 = z2 + z1
commutative multiplication: z1 × z2 = z2 × z1
distributivity of the multiplication: z1 × (z2 + z3 ) = z1 × z2 + z1 × z3
unique inverse: 1/z if z 6= 0
Additionally, complex-specific operations are available
def
complex conjugation: x +iy = x − iy
Re{x + iy} def
= x
Real and Imaginary part: def
Im{x + iy} = y
The complex conjugation satisfies very useful distributive properties
over the addition: z1 + z2 = z̄1 + z̄2
over the multiplication: z1 × z2 = z̄1 × z̄2
NOTE: Re{z} = (z + z̄)/2 and Im{z} = −i(z − z̄)/2
Complex numbers Geometry of complex numbers
Complex functions Polar form
Examples
Compute the real and imaginary parts of the following complex numbers
z1 + z2 where z1 = 1 + i and z2 = −2 − i
z1 z2 where z1 = 1 + i and z2 = −2 − i
Re{z1 } − Im{z2 } where z1 = 1 + i and z2 = −2 − i
z̄1 z̄2 where z1 = 1 + i and z2 = −2 − i
1/z1 where z1 = 1 + i
z1 /z̄2 where z1 = 1 + i and z2 = −2 − i
Complex numbers Geometry of complex numbers
Complex functions Polar form
Geometrical interpretation
Complex numbers are equivalent to points in a plane: horizontal axis being the
real axis, vertical axis being the imaginary axis of a 2-dimensional Cartesian
coordinate system.
Both axes have the same unit of length.
imaginary axis
y z = x + iy
real axis
x
z̄
NOTE: This plane is called “complex plane”.
Complex numbers Geometry of complex numbers
Complex functions Polar form
Polar form
The geometrical interpretation suggests using polar coordinates (r, θ) to
represent complex numbers. This defines two new operations on complex
numbers z = x + iy
p
modulus/absolute value: |z| = r = x2 + y 2
−π < θ ≤ p π,
argument/phase1 : arg z = θ defined by cos θ = x/p x2 + y 2 ,
sin θ = y/ x2 + y 2 .
Represent real part and imaginary part as x = r cos θ and y = r sin θ
z = x + iy = r(cos θ + i sin θ)
imaginary part
y = r sin θ z = x + iy
r
=
|z | θ = arg z
real part
x = r cos θ
1
Always expressed in radians.
Complex numbers Geometry of complex numbers
Complex functions Polar form
Polar form
An explicit expression of arg z ∈ (−π, π] depends on the location of z = x + iy:
x<0
x>0 y≥0
x<0
y<0
arg z = arctan(y/x) arg z = π + arctan(y/x) arg z = −π + arctan(y/x)
−π/2,
if x = 0 and y < 0
and, otherwise, arg z = π/2, if x = 0 and y > 0
undefined, if x = 0 and y = 0
(NOTE: In the textbook, it use “Arg” (principal value) to denote “arg” in the
slides. “arg z” in textbook equals arctan(y/x).)
Complex numbers Geometry of complex numbers
Complex functions Polar form
Addition and multiplication
Geometric interpretation of complex number addition:
Triangle inequality:
|z1 + z2 | ≤ |z1 | + |z2 |
Algebra of complex numbers in polar form
z1 = r1 (cos θ1 + i sin θ1 ) and z2 = r2 (cos θ2 + i sin θ2 )
Complex number multiplication:
z1 z2 = r1 r2 [(cos θ1 cos θ2 − sin θ1 sin θ2 ) + i(sin θ1 cos θ2 + cos θ1 sin θ2 )]
= r1 r2 [cos(θ1 + θ2 ) + i sin(θ1 + θ2 )]
Modulus and argument:
|z1 z2 | = |z1 ||z2 | and arg(z1 z2 ) = arg(z1 ) + arg(z2 ) − 2kπ where the
integer k is chosen so that −π < arg(z1 z2 ) ≤ π
Complex numbers Geometry of complex numbers
Complex functions Polar form
Division and integer powers of complex numbers
Division:
z1 r1
z2
= r2
[cos(θ1 − θ2 ) + i sin(θ1 − θ2 )]
Modulus and argument:
|z1 /z2 | = |z1 |/|z2 | and arg(z1 /z2 ) = arg(z1 ) − arg(z2 ) − 2kπ where the
integer k is chosen so that −π < arg(z1 /z2 ) ≤ π
Integer powers (De Moivre’s Formula):
z n = rn (cos nθ + i sin nθ)
If in the form of z = x + iy, the integer power can be computed using the
binomial2 formula
n
!
n n
X n n−k k k
z = (x + iy) = x i y
k
k=0
1, if k is a multiple of 4
i, if k − 1 is a multiple of 4
−1, if k − 2 is a multiple of 4
−i, if k − 3 is a multiple of 4
2
n
def n(n − 1)(n − 2) . . . (n − k + 1)
Reminder: = .
k k(k − 1)(k − 2) . . . 1
Complex numbers Geometry of complex numbers
Complex functions Polar form
nth roots of complex numbers
Looking for w such that wn = z amounts to finding the nth roots of z. Given
z = r(cos θ + i sin θ) and w = R(cos φ + i sin φ)
There are exactly n such roots:
wn = Rn (cos nφ + i sin nφ) = z = r(cos θ + i sin θ)
Solving the equation yields
√ √
n n θ + 2kπ θ + 2kπ
z = r cos + i sin , for k = 0, 1, · · · , n − 1
n n
If z = 1, then |z| = 1 and arg(z) = 0. We have nth roots of unity.
√
n 2kπ 2kπ
1 = cos + i sin where k = 0, 1, · · · , n − 1
n n
Complex numbers Geometry of complex numbers
Complex functions Polar form
nth roots of complex numbers
Looking for w such that wn = z amounts to finding the nth roots of z. Given
z = r(cos θ + i sin θ) and w = R(cos φ + i sin φ)
There are exactly n such roots:
wn = Rn (cos nφ + i sin nφ) = z = r(cos θ + i sin θ)
Solving the equation yields
√ √
n n θ + 2kπ θ + 2kπ
z = r cos + i sin , for k = 0, 1, · · · , n − 1
n n
If z = 1, then |z| = 1 and arg(z) = 0. We have nth roots of unity.
√n 2kπ 2kπ
1 = cos + i sin where k = 0, 1, · · · , n − 1
n n
Complex numbers Geometry of complex numbers
Complex functions Polar form
Exercises
Compute the modulus, phase, real part and imaginary part of the following
complex numbers
z 3 , if z = 1 + i
z −1 , if z = 1 + 2i
z1 /z2 , if z1 = 1 + 2i and z2 = 1 + i
fourth root of −1
square root of z1 z̄2 where z1 = 1 + 2i and z2 = 1 + i
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Complex function
S is a set of complex numbers. A function f defined on S is a rule assigning
every z in S a complex number w
w = f (z)
S is the domain of complex function f . All possible values of f is the range of
f
Example: w = f (z) = z 2 + 3z defined on all z. Domain S and range are both
the whole complex plane
Alternative definition: w = f (z) = u(x, y) + iv(x, y), where u and v are real
functions on real variables x and y
NOTE: All functions are single-valued relations. Each z can only be mapped to
one value w = f (z)
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Differentiation of real functions
The derivative f 0 (x0 ) of a real function f (x) at a point x0 indicates how fast
f (x) changes around x = x0
tangential slope = f 0(x0 ) -
0 df (x0 )
f (x0 ) =
dx
f (x0 + h) − f (x0 )
= lim
h→0 h
def
df (x) = f (x + dx) − f (x) x0 x0 +h x0 +h0
Essentials of calculus
0
af (x) + bg(x) = af 0 (x) + bg 0 (x) (Linearity)
0
f (x)g(x) = f 0 (x)g(x) + f (x)g 0 (x) (Leibniz’ rule)
0
= f 0 g(x) g 0 (x)
f g(x) (chain rule)
0
= −f 0 (x)/f (x)2
1/f (x)
NOTE: Alternative notation to f 0 (x) is f˙(x); used when x is not a spatial
variable (e.g., time, curve parameter, etc.)
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Differentiation of real functions
Partial derivatives: A function of more than one variable can be differentiated
separately with respect to each of these variables.
Example for a function f (x, y)
∂f f (x0 + h, y0 ) − f (x0 , y0 )
def
∂x
(x0 , y0 ) = fx (x0 , y0 ) = lim
h→0 h
∂f def f (x 0 , y 0 + h) − f (x0 , y0 )
(x0 , y0 ) = fy (x0 , y0 ) = lim
∂y h→0 h
def
Differential: df (x, y) = f (x + dx, y + dy) − f (x, y)
Exact differential X
∂f (x, y) ∂f (x, y)
df (x, y) = dx + dy
∂x ∂y
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Limit and continuity of complex functions
A function f has the limit l as z approaches a point z0
lim f (z) = l
z→z0
For complex function, z may approach z0 from any direction in the complex
plane
Continuity: A complex function f (z) is said to be continuous at if z = z0 is
defined and
lim f (z) = f (z0 )
z→z0
Derivative (or differentiation) of complex function f at point z0 is defined by:
f (z0 + ∆z) − f (z0 )
f 0 (z0 ) = lim
∆z→0 ∆z
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Examples of continuous complex functions: z, z̄, |z|. Example of a
discontinuous function (at z ≤ 0): arg z
plot of |z| as an image plof of arg z as an image
plot of |z| as a surface plof of arg z as a surface
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Differentiability of complex functions
A complex function f is differentiable at z0 iff the function of z
f (z) − f (z0 )
has a continuous extension at z = z0 ;
z − z0
i.e., iff there exists a complex number l such that the extended function
f (z) − f (z0 ) , if z 6= z
0
g(z) = z − z0
l, if z = z0
is continuous at z0 . The value, l, of the extension at z = z0 is the derivative,
f 0 (z0 ) of f at z0 .
All the usual properties of derivatives extend formally to the complex case:
derivative of a product, of a sum, of a composition of functions.
Examples: (z n )0 = nz n−1 , where n is integer
Analytic (or holomorphic) functions
Analyticity is the property for a function to be differentiable at all points in a
certain domain (i.e., not only at one point).
A function which is analytic in C is entire.
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Recap: examples of a non-differentiable real function
Consider the real function f = |x|, which is non-differentiable at x0 = 0
Proof: assume that ∆x > 0, we have
f (x0 + ∆x) − f (x0 ) f (∆x) ∆x
Approach from 0+ : lim = = =1
∆x→0 ∆x ∆x ∆x
f (x0 − ∆x) − f (x0 ) f (−∆x) ∆x
Approach from 0− : lim = = = −1
∆x→0 −∆x −∆x −∆x
For real functions, just need to check approaching x0 from positive and
negative directions
For complex functions, need to check approaching z0 from all possible
directions in the complex plane
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Examples of analytic functions
z, z n where n is a positive integer: Domain = C
Polynomials: Domain = C
(z − z0 )−n where n is a positive integer: Domain = C \ {z0 }
Rational fractions: Domain = C \ {zeros of the denominator}
On the contrary, neither z̄, |z|, nor arg z are differentiable anywhere. Prove it!
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Analytic characterization
Cauchy-Riemann equations X
If f (z) = u(x, y) + iv(x, y) is analytic in some domain, then
ux = vy and uy = −vx
in that domain. The converse is true provided that all these partial derivatives
are continuous in the domain considered.
Short proof: If f is differentiable at z, then we can either choose
∆z = ∆x + 0i = ∆x or ∆z = 0 + i∆y = i∆y
[u(x + ∆x, y) + iv(x + ∆x, y)] − [u(x, y) + iv(x, y)]
f 0 (z) = lim = ux + ivx
∆x→0 ∆x
[u(x, y + ∆y) + iv(x, y + ∆y)] − [u(x, y) + iv(x, y)]
f 0 (z) = lim = −iuy + vy
∆y→0 i∆y
ux + ivx = −iuy + vy ⇒ ux = vy and uy = −vx
Complex calculus is the same as real calculus; i.e., analytic functions are
functions of two variables, but behave like functions of one variable.
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Examples
Using Cauchy-Riemann equations, check whether the following functions are
analytic, and over which domain
f (z) = x2 + y 2
f (z) = x2 − y 2 + 2ixy
f (z) = x/(x2 + y 2 ) − iy/(x2 + y 2 )
f (z) = y + ix
f (z) = e−x cos y − ie−x sin y
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Laplace’s equation
Harmonic functionsX
If f (z) = u(x, y) + iv(x, y) is analytic in some domain, then, in that domain
∇2 u = uxx + uyy = 0 and ∇2 v = vxx + vyy = 0
def ∂2g ∂2g
where ∇2 g(x, y) = 2
+ .
∂x ∂y 2
Contrariwise, if either Re{f (z)} or Im{f (z)} does not satisfy Laplace’s
equation, then f (z) is not analytic.
Short proof: Since ux = vy , by differentiating w.r.t. x we get uxx = vyx .
Since uy = −vx , by differentiating w.r.t. y we get uyy = −vxy .
Taking into account that vxy = vyx , we get uxx + uyy = 0.
NOTE: Laplace’s equation has a tremendous importance in physics
(gravitation, EM, mechanics, fluids, etc.) and image processing.
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Laplace’s equation
Given u(x, y) that satisfies Laplace’s equation in some domain, how to find
v(x, y) such that f (z) = u(x, y) + iv(x, y) is analytic in the same domain?
Such a v(x, y) is called u’s harmonic conjugate function
Solution: build g(z) = ux (x, y) − iuy (x, y). This function is automatically
analytic in the considered domain (why?). Now, because vx = −uy , we have
that
∂f (x + iy)
g(z) = ux + ivx = = f 0 (z)
∂x
Hence, it suffices to find the function f (z) (unique, up to an addditive
constant) which is such that f 0 (z) = ux − iuy (integration). Its imaginary part
provides v(x, y).
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Examples
Problem: given u(x, y) = xy find v(x, y) such that u + iv is analytic. Solution:
1 Check that u(x, y) is such that ∇2 u = 0
2 Build g(z) = ux − iuy = y − ix = −iz
3 Use f 0 (z) = g(z) = −iz to find that f (z) = −iz 2 /2 + Constant
4 Finally, v(x, y) = Im{−iz 2 /2} + Constant
= (y 2 − x2 )/2 + Constant
Exercise: Check whether the following functions satisfy Laplace’s equation,
and over which domain. Solve for v(x, y) when possible
u(x, y) = x2
u(x, y) = 3xy 2 − x3
u(x, y) = y/(x2 + y 2 )
u(x, y) = ex cos(y)
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Analytic functions
Analytic function properties
The sum, products, and composition of analytic functions are analytic
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Complex exponential
DefinitionX
The function exp defined by
def
exp(x + iy) = ex+iy = ex (cos y + i sin y)
is called the complex exponential. It is the analytic function that extends the
real exponential ex to the complex plane.
Euler’s formulaX
If z = iθ
eiθ = cos θ + i sin θ
which is also equivalent to
eiθ + e−iθ eiθ − e−iθ
cos θ = and sin θ =
2 2i
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Complex exponential
The complex exponential function has the same properties as the real
exponential (prove them!):
f (z1 + z2 ) = f (z1 )f (z2 );
f 0 (z) = f (z).
Polar form of a complex number z = r(cos θ + i sin θ) can be converted to
z = reiθ
In addition, it has essential complex-specific properties
ez = ez̄
z
e = eRe{z} , hence |eiθ | = 1
arg ez = Im{z} + 2nπ, where n is an integer3
(ez )k = ekz where k is an integer number
ez+2iπ = exp z
eiπ = −1
ez 6= 0 for all z ∈ C
3
chosen uniquely, so that the imaginary part of the rhs is > −π and ≤ π.
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Exercise
Compute the complex exponential of the following complex numbers (cartesian
and polar representations)
√
1+ 2
1 + 2i
5i
5πi
0
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Trigonometric functions
Based on Euler’s formula, the trigonometric functions cos and sin are extended
to analytic functions in the complex plane by
def eiz + e−iz def e
iz
− e−iz
cos z = and sin z =
2 2i
sin z 1
tan z = and sec z =
cos z cos z
Same properties as the real trigonometric functions
(cos z)0 = − sin z, (sin z)0 = cos z, (tan z)0 = sec2 z
cos(z1 + z2 ) = cos z1 cos z2 − sin z1 sin z2
sin(z1 + z2 ) = sin z1 cos z2 + cos z1 sin z2
cos2 z + sin2 z = 1
etc.
Euler’s formula is also valid in complex:
eiz = cos z + i sin z
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Hyperbolic functions
The hyperbolic functions are defined from the complex exponential by
def ez + e−z z
def e − e
−z
cosh z = and sinh z =
2 2
Properties derived from their link with trigonometric functions:
cosh z = cos iz and sinh z = −i sin iz
(cosh z)0 = sinh z
(sinh z)0 = cosh z
cosh2 z − sinh2 z = 1
etc.
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Complex logarithm
DefinitionX
The natural logarithm of z = x + iy is defined as the inverse of the exponential
function ew = z:
w = ln z
The complex “natural” logarithm is defined by
ln z = ln |z| + i arg z (NOTE: −π < arg z ≤ π)
Complex natural logartihm is multi-valued. The above definition is called
“principal value” of the logarithm. In textbook, it is denoted by “Ln”.
Properties
1 eln z = z;
ln ez = z + i2kπ, where k is an integer† ;
2
3 ln(z1 z2 ) = ln z1 + ln z2 + i2kπ, where k is an integer† ;
4 ln is analytic in C \ [−∞, 0];
5 (ln z)0 = 1/z (z is not 0 or negative real).
† k is chosen uniquely, so that the imaginary part of the rhs is in the range of (−π, π].
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Selected proofs:
eln z = eln |z|+i arg z = eln |z| cos(arg z) + i sin(arg z)
1
= |z| cos(arg z) + i sin(arg z) = z
4 Let ln z = u + iv for z ∈ C\[−∞, p 0], then from 1 we have
ln z = ln |z| + i arg z = ln x2 + y 2 + i (arc tan(y/x)(±π))
x 1 1
ux = 2 = vy = ·
x + y2 1 + (y/x)2 x
y 1 y
uy = 2 = −v x = − − 2
x + y2 1 + (y/x)2 x
The Cauchy-Riemann equations hold and prove the analyticity of the
function
5 from 4 we have that
x y x − iy 1
(ln z)0 = ux + ivx = −i 2 = 2 =
x2 + y 2 x + y2 x + y2 z
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Power function
DefinitionX
The arbitrary power of a complex number is defined by
z a = ea ln z
Properties
1 ln z a = a ln z + 2ikπ, where k is an integer† ;
2 z a z b = z a+b ;
3 z a is analytic in C \ [−∞, 0];
4 (z a )0 = az a−1 .
b
NOTE: in general, z a 6= z ab .
†
chosen uniquely, so that the imaginary part of the rhs is the range of (−π, π].
Calculus—reminders
Complex numbers Analytic functions
Complex functions Exponential and trigonometric functions
Logarithm and power functions
Exercises
Give the polar and cartesian expressions of
√ def
x + iy = (x + iy)1/2 in function of x and y
ln(1 + i)
ln(−1)
ln(z1 z1 ), if z1 = −1 + i and z2 = −1 + 2i
sin(π + i)