This material has been adapted from material by Fergus Cooper and others from the "Essential Mathematics" module at the Doctoral Training Centre, University of Oxford.
This course material was developed as part of UNIVERSE-HPC, which is funded through the SPF ExCALIBUR programme under grant number EP/W035731/1
Complex numbers
Learning outcomes
Understand the concept of imaginary numbers
Understand complex numbers as having real and imaginary components
Be able to express complex numbers in the complex plane
Understand the conjugate of a complex number
Understand the modulus of a complex number
Be able to perform algebraic operations on complex numbers
Be able to express comples numbers in polar coordinates
Understand the relationship between complex numbers and trigonometric functions
YouTube lecture recording from October 2020
A recording of this lecture from October 2020; the material has changed a little since.
Why complex numbers?
Some equations, like x2+1=0, have no solutions among the real numbers.
Complex numbers give every polynomial a full set of roots.
We will meet them again when we study systems of differential equations.
There, complex roots tell us that the system oscillates (e.g. populations of predators and prey that rise and fall in turn).
The link is eiθ=cosθ+isinθ, which we show at the end of this lecture.
Imaginary numbers
The imaginary number i:
The polynomial x2−1=0 has two real roots: 1 and −1
The polynomial x2+1=0 has no real roots.
Consider solving:
x2=1andx2=−1
We introduce an "imaginary" number i so that there are two solutions to x2=−1: i and −i.
That is, i is a number with the property that i2=−1.
Complex numbers
The complex numbers are the set of all expressions of the form a+bi where i2=−1 and a and b are real numbers:
C={a+bi∣a,b∈R}
For z=a+bi∈C we define the real and imaginary
parts of z to be ℜ(z)=a and ℑ(z)=b.
The imaginary number i has no home on the real number line.
Instead, we locate it on the complex plane at the point (0,1).
We can represent any complex number z=a+bi as the point (a,b) in the complex plane.
The coordinates (a,b) are usually called the Cartesian coordinates for z.
(Named after the mathematician and philosopher René Descartes).
In this plane, the real numbers lie on the horizontal axis.
We usually refer to the horizontal axis of C as the real axis.
The following plot shows a complex number with a real component of 18 and an imaginary component of 12:
Complex conjugates
The complex plane C contains all of the roots of every polynomial.
E.g., let's look at a quadratic equation.
Recall the quadratic formula:
ax2+bx+c=0⟺x=2a−b±b2−4ac
Now, let's consider this specific quadratic equation:
x2−8x+25=0
which we can solve using the quadratic formula:
x=28±64−100=28±−36=28±6i=4±3i
Note that these two roots are reflections of one another through the
real axis. They are conjugates of one another.
In general, let z=a+bi. The conjugate of z is the complex number
zˉ=a−bi.
We can also use SymPy's solve method to solve polynomials:
import sympy as sp
x = sp.symbols('x')sp.solve(x**2-8*x +25)
[4−3i,4+3i]
Modulus (size) of a complex number
The distance to a point on the complex plane from 0 is called its modulus, and we find this by calculating the hypotenuse of the triangle with base ℜ(z) and height ℑ(z):
E.g. The modulus of 4±3i is 32+42=9+16=25=5
In general, the modulus of z=a+bi is the real number
∣z∣=a2+b2.
The modulus is connected to the conjugate by means of the formula
z⋅zˉ=∣z∣2. Indeed:
Division is even more awkward in Cartesian coordinates: we have to multiply the numerator and the denominator by the complex conjugate of the denominator.
It is often convenient to represent the complex number z=a+bi in terms of its polar coordinates ⟨r,θ⟩.
The angle θ is called the argument of z.
We take θ in the range (−π,π], so that each non-zero z has exactly one argument.
A round bracket leaves out its end point and a square bracket includes it: θ=π is allowed, but θ=−π is not.
The real number r=∣z∣ is sometimes denoted mod(z).
Connection between Cartesian and polar
Let z=x+iy.
If we are given the polar coordinates of z and want to express the Cartesian coordinates use
x=rcosθy=rsinθz=rcosθ+risinθ=r(cosθ+isinθ)
If we are given the Cartesian coordinates and want to find the polar coordinates, use:
Note: all of the fuss about the value of θ in the formula above is to make sure that z gets into the proper quadrant.
Beware of the sign of this tangent: it depends on which quadrant you are in.
The positive x axis is defined as having θ=0 and positive θ goes in an anticlockwise sense around the x−y plane.
Some examples
Example 1
Find the Cartesian coordinates for the complex number z with polar coordinates r=2 and θ=π/6.
For the imaginary part too, the moduli multiply while the arguments add.
This gives a relatively compact and highly geometric result for the product:
z1⋅z2=r1r2(cos(θ1+θ2)+isin(θ1+θ2))
It is multiplicative in the modulus and additive in the argument:
∣z1z2∣arg(z1z2)=∣z1∣⋅∣z2∣=arg(z1)+arg(z2)(adding or subtracting 2π if needed, to stay in (−π,π])
This means that when we multiply by z, we are rotating through the angle arg(z) and radially stretching by a factor of ∣z∣.
A remarkable connection with eiθ
First, think of z=cosθ+isinθ as a function of θ and differentiate with respect to θ:
dθdz=dθd(cosθ+isinθ)=−sinθ+icosθ(1)
Next notice that the right-hand side is just the product iz:
iz=i(cosθ+isinθ)=icosθ+i2sinθ=−sinθ+icosθ(2)
Thus, from (1) and (2),
dθdz=iz
This is a separable differential equation (we cover differential equations properly in the next lecture):
∫izdz=∫dθ⇒i1lnz=θ+c⇒lnz=iθ+ic
In exponential form:
z=eiθ+ic=eiθeic=AeiθwithA=eic
When θ=0, z=1, giving A=1, so:
cosθ+isinθ=eiθ(3)
Putting (3) into the polar form r(cosθ+isinθ), any complex number can now be written:
z=x+iy=r(cosθ+isinθ)=reiθ
Several important consequences
Any complex number can be written in the polar form z=reiθ where r=∣z∣ and θ=arg(z).
The unit circle in C consists exactly of those complex numbers with
modulus equal to 1, that is the numbers eiθ.
Multiplication on the unit circle r=1 can be carried out by adding the
angles:
eiθ1⋅eiθ2=ei(θ1+θ2)
Exponentiation on the unit circle r=1 can be done by multiplying the angle by the index (for integer n).
Written with cos and sin, this is known as de Moivre's theorem.
(eiθ)n=eiθn=ei(nθ)
This makes powers quick. For example, 1+i=2eiπ/4, so:
(1+i)8=(2)8(eiπ/4)8=16e2πi=16
Finally, the famous identity by Leonhard Euler
eπi+1=0
Introductory problems
For more practice, an AI tool can write new problems like the ones below.
Ask it for problems of the same type and difficulty, or for problems set in your own field.
For example, you could ask it to "write five physics problems on complex numbers, at the level of these ones".
Work them on paper first, then ask the tool to check your answers and to explain any step you are unsure of.
Introductory problems 1
Simplify:
2−2i+3+i
4−6i+19+4i
(1−i)2
(2+i)2
(4−3i)/(2+6i)
(1+2i)/(1−3i)
(2−i)−2+(2+i)−2
(5−i)−2−(5+i)−2
Add the real and imaginary parts separately, use i2=−1 when multiplying, and divide by multiplying the numerator and the denominator by the complex conjugate of the denominator.
The quadratic formula works for complex numbers too:
z=2−(1+4i)±(1+4i)2−4(15+27i)
The number under the square root is (1+4i)2−4(15+27i)=−15+8i−60−108i=−75−100i.
Following the hint, (a+bi)2=a2−b2+2abi, so we need
a2−b2=−75and2ab=−100
The second equation gives b=−50/a.
Substituting into the first gives a4+75a2−2500=0, which is a quadratic in a2 with roots a2=25 and a2=−100.
Since a is real, a2=25, so a=5 and b=−10 (or a=−5 and b=10, the same root with the opposite sign).
So, the square root is ±(5−10i), and
zorz=2−1−4i+(5−10i)=2−7i=2−1−4i−(5−10i)=−3+3i
We can check by multiplying out: (z−(2−7i))(z−(−3+3i))=z2+(1+4i)z+(15+27i).
Main problems 2
Represent the complex numbers z1=5−2i and z2=−2+4i on a sketch/plot of the complex plane (an Argand diagram).
Write down z1 and z2 in polar form (either give r and θ for each, or write them as exponentials).
What is the product of z1 and z2?
z1 is the point (5,−2), below the real axis on the right, and z2 is the point (−2,4), above the real axis on the left.
from matplotlib import pyplot as plt
z1 =5-2jz2 =-2+4jfor z in[z1, z2]: plt.plot([0, z.real],[0, z.imag], marker='o')plt.axhline(0, color='black', linewidth=0.5)plt.axvline(0, color='black', linewidth=0.5)plt.xlabel('Real axis')plt.ylabel('Imaginary axis')plt.gca().set_aspect('equal')
For z1, which is in the fourth quadrant:
r1=52+22=29≈5.39,θ1=arctan(5−2)≈−0.381
For z2, which is in the second quadrant, we add π to the arctangent:
Find the complex numbers represented by the vertices of a square if one vertex represents 3+3i and the centre of the square represents 1+2i.
From the centre to the given vertex is (3+3i)−(1+2i)=2+i.
The other vertices are the same distance from the centre, rotated by a right angle each time.
Multiplying by i rotates through π/2, so the steps from the centre to the other vertices are
(2+i)i=−1+2i,(2+i)i2=−2−i,(2+i)i3=1−2i
Adding each to the centre 1+2i gives the vertices
3+3i,4i,−1+i,2
Extension problems
Extension problems 1
Use Python's complex numbers to check your answers to Introductory problems 1 and Main problems 1.
Python writes i as j, so we can type each expression in directly:
These agree with our answers: 6/25=0.24 and 5/169≈0.0296.
Python works with decimals, so a few answers carry a tiny rounding error, like 0.49999999999999994 for 1/2.
To solve the equations in Main problems 1, SymPy keeps the answers exact (it writes i as I):
import sympy as sp
z = sp.symbols('z')print(sp.solve((7+ sp.I)* z -3* sp.I -6, z))print(sp.solve((z - sp.I)/(z + sp.I)- sp.Rational(2,3), z))print(sp.solve(z**2+(1+4* sp.I)* z +(15+27* sp.I), z))