ExamsCourses
Sign in
Im(z) 0 Re(z) 0 0 t 0 Im(z) 0 Re(z) 0 0 f(z)=

Complex Functions

This is an interactive article:

Throughout, we will introduce you to the wonderful world of complex functions, and by the end you’ll be able to understand a beautiful proof of the fundamental theorem of algebra , which we introduce later.

A complex function f , takes a complex number z and maps it to another complex number w . Since both z and w are two dimensional , we’re going to need a set of four axis to visualize them! In general, we can write a complex function as:

f z w w = f(z)

The plane on the top represents the input z plane, and the bottom represents the output w plane. To make the most of this simulation let’s take a moment to understand how it all works.

The Interactive

The input values to the complex function can be input in one of two ways:

Choose a method to input z values into f

In the parametric mode , you can set two functions of time (t) , so that z(t) = x(t) + iy(t) :

z(t)= x(t) y(t) +i

You can try inputting . Once you’ve chosen one, you can then choose boundaries for t :

t in [ t_"min" , t_"max" ]

The following slider is used to highlight a single t value , and the point that it is mapped to as shown:

t

Alternatively, in the free mode , we drag around the input point to form some shape.

These input points are then mapped through a complex function to get the output points . You can set the complex function of your choosing below:

f(z)=

There are a number of amazing facts that we can demonstrate with this. When you see buttons click them to update the simulation .

Some Simple Functions

Imagine the complex function:

If you tried inputting the complex number 3 + 4i , we would get the following output:

f(3 + 4i) = (3^2 + 4^2) + 2(3)(4)i

So the function above maps the complex number z=3+4i to the output 25+24i . We can also define a complex function more directly with:

In this case, if we randomly input z = 2-i , we would just get:

f(2-i) = (2-i)^2 - 1

We know that i^2= -1 , so:

f(2-i) = 2 - 4i

So therefore, inputting z= 2-i into f(z) = z^2-1 , produces an output of w=2-4i . Just to check that you understand this, how about trying some of these yourself:

  • Given f(z) = z^2 - 3z , what is the output when ?
  • Given f(z) = x i + (z)/(z+4) , what is the output when ? You may need to rationalize your answer.

Affine Transformations

Complex numbers are often used in 2d video games to transform a character on screen as shown:

translate rotate scale

To demonstrate how complex numbers do this let’s start with a picture of a little fishy, with an identity function that just leaves the fish alone:

Now we can translate the fish by adding a constant complex number to every point on it. So if we used the following complex function:

You can see that the fish has moved two units right and three units upwards. Similarly, we can scale up the fish by multiplying every point by a number. So if we set:

The fish gets two times larger . We can also rotate the fish by using a special complex number called a rotor. For example, the following function:

Just rotated the fish by \pi \over 3 radians. We call cos(pi/3) + i sin(pi/3) the rotor for pi/3 rad . We can also rewrite this rotor as:

R = e^(i pi/3 )

Which we will explain in the upcoming section on complex exponentials. But this means that something like:

Would just rotate the fish by 3 pi//4 radians. We can also combine these transformations to put the fish into any configuration we like, for example:

Makes the fish twice as large and moves it up by 5 units in succession . So why don’t you try finding the transformations to put the fish into the following configurations:

  • Make the fish three times as large, and move it right by ten units :
  • Move the fish 2 units right, 3 units up and rotate it by 2pi//3 radians :

Translating, scaling and rotating are examples of affine transformations. An affine transformation is just a transformation that keeps parallel lines parallel. Notice that the box I drew around the fish in each of these transformations keeps its outer edges parallel.

Trigonometry

I’m not going to prove it here, but the sine of a complex number x+iy can be written as:

sin(x+iy) = sin(x)cosh(y) + i cos(x)sinh(y)

Where cosh and sinh are just the hyperbolic cos and sin functions respectively. So let’s go ahead and set our complex function to:

First, let’s make sure that this is the sine you’re familiar with. Let’s draw:

Which means that all inputs are real numbers . Notice that as we change t , the output just oscillates back and fourth between -1 and 1 just as sine should. But how about we just try moving the input up:

Notice that vertical lines always form ellipses . This is clear from the equation above:

  • Setting y to a constant gives us A sin(x) + B cos(x) , where A is the value of cosh(y) and B is the value of sinh(y) respectively
  • This plots the equation (A sin(x), B cos(x))
  • This is the parametric equation of an ellipse

Now if vertical lines form ellipses, what would a horizontal line turn into? Try putting one in:

This time, we get a hyperbola instead, which is also clear from the equation above:

  • Setting x to a constant value gives us A cosh(y) + B sinh(y) , where A is the value of sin(x) and B is the value of cos(x) respectively
  • This plots the equation (A cosh(y), B sinh(y))
  • This is the parametric equation of a hyperbola

Both ellipses and hyperbolas are examples of conic sections. Horizontal and vertical lines always produce conic sections, but slanted lines don’t. For example, check out this shape:

This is definitely not a conic section! So to summarize the shape of f(z) = sin(z) :

  • horizontal lines form ellipses
  • Vertical lines form hyperbolas
sin(z)

Maybe you should try exploring the shape of f(z)=cos(z) in the same way. Remember that you can scroll to the top to access the controls ⏫.

Exponentials

Next, lets investigate the behavior of a complex exponential. The well known Euler’s identity tells us that:

e^(i theta) = cos(theta) + i sin(theta)

So if f(z)=e^z and z = x+iy , then we can use the index laws to write:

e^(x+iy) = e^x(cos(y) + i sin(y))

So let’s try setting the exponential function:

This function takes some complex number z and it maps the:

  • Real part of z to a magnitude of e^x
  • Complex part of z to an angle of y rad

So lets try this out, lets try something where the complex part is fixed to 1:

Notice that it draws a angle of exactly one radian . If we set the complex part to 2 this time, so:

Then the angle is just two radians . This then continues into larger angles. You can then also try keeping the real part constant, so let’s set it to 1:

Notice that this draws a circle with a radius of e , or approximately 2.72 units. Similarly if we try:

The radius is now e^2 , or approximately 7.38 units, this also continues . Given this behavior, we can easily explain the famous Euler identity :

e^(i pi ) = -1

Just imagine the input line:

We know that:

  • Vertical lines just turn into circles , and the higher we go, the larger the angle.
  • The x-coordinate tells us the radius of the circle. Since the x-coordinate is zero, then e^0=1 , and this forms a unit circle.

So if we let z=pi , we just end up at w=-1 . So for this reason:

f(pi) = -1 e^(i pi) = -1

These complex exponentials have a huge number of applications. But to summarize the shape of f(z) = e^{iz} :

  • Horizontal lines form rays with increasing angles
  • Vertical lines form circles of increasing radiuses
Im(z) 0 Re(z) 0 0 0 t 0 ² Im(z) 0 Re(z) 0 0 0 f(z)

The Fundamental Theorem of Algebra

The fundamental theorem of algebra states that for a polynomial like:

There should be exactly five complex roots , since the highest power is five. Or in other words, you can factor this polynomial into:

f(z) = (z-alpha_1)(z-alpha_2)(z-alpha_3)(z-alpha_4)(z-alpha_5)

Where every alpha is a root. A root is therefore just a z value that makes f(z) output zero. So for example:

  • When the input is
  • Since f(3+2i) = 0 , the output is

Note that most z values do not produce an output (w) of zero. For example, if we randomly tried:

  • An input of
  • Here f(2-i)=10-80i , so:
  • The function f sends w all the way to

But this begs two questions. If we believe that this function does in fact have five roots, then:

  1. How can we be sure that we have exactly five roots?
  2. How do we find these roots?

If you’d like to, try to find the other roots yourself:

Drag the point around yourself

Remember, roots occur when the output value is equal to zero. To understand why this theorem is true, read on.

Raising Powers

Before we look at harder polynomials, let’s start with a very simple polynomial:

If we input a point like which we can write in exponential form as:

z = sqrt(2) e^(ipi/4)

If we substitute into f(z) , and apply the index laws:

f(sqrt(2) e^(i pi/4)) = (sqrt(2) e^(i pi/4))^4 f(sqrt(2) e^(i pi/4)) = (sqrt(2))^4 (e^(i pi/4))^4 f(sqrt(2) e^(i pi/4)) = 4 e^(i pi)

Notice two things about this output.

  • Its distance from the origin has been raised to the power of four. It used to be sqrt(2) and now the length is 4 .
  • Its angle to the x-axis is now four times larger. It used to be pi/4 rad , and now ts pi rad

We can make this more obvious by imagining that z is some circle with the parametric equation:

z(t) = R cos(t) + iR sin(t)

Show the circle

We can then control the radius (R) with a slider and the t value with another slider:

R

t

Notice a few things here:

  • When the initial radius is 2 , then the resulting radius is 16 , which is just 2^4 again
  • If we do one lap around the input circle, we complete four laps around the output circle

This final fact, that one lap on the top makes four laps on the bottom is going to be incredibly important for the proof of the fundamental theorem. If you tried again for:

Since the power is now two, one lap on the top will only count for two laps of the bottom. This continues, if the highest power is n, then we complete n laps around the bottom .

Roots of Unity

Now we can tackle a slightly harder problem. The roots of unity polynomial for the power of 3 is:

We can start with the function f(z) = z^3 and then we just shift it left by one unit. To find the roots:

  • We need to find w = 0 , but since w=f(z)
  • We need to find every occurrence where z^3-1=0 , which of course occurs whenever z^3 = 1
  • Now since the right hand side of this equation has a magnitude of one, then the magnitude of z^3 , and also z must be one as well, so we set
  • So the solutions for the left hand side must also exist on the unit circle in the z-plane

So lets look carefully at the unit circle:

t

Try sliding around the t slider to move around the circle and notice that:

  • the output point on the w plane crosses zero three times .
  • If we show the crossings on the z-plane, they are equally spaced

If we tried the function:

If we again moved around the circle , we find that we hit zero five times . So in general, given:

f(z)=z^n-1

We will have n solutions that are equally spaced around the unit circle.

The Fundamental Theorem

Now we are ready to tackle the fundamental theorem! Let’s think about the same polynomial from earlier:

We want to find all of the roots, and we now know that drawing circles on the z plane can really help with this. Let’s start by focusing on where z=0 moves to under this transformation:

Show f(0) on the plane

Notice that this particular function lands on f(0)=-260 , So:

  • When the input circle all the way towards zero, we expect to approach -260 on the w plane.
  • If we made the circle , only the z^5 term will have any important effect on the shape of the curve.
  • So as you can see, this means that the curve will look like it’s been wrapped around five times

Now as we the radius of this circle:

R

We notice that the bottom image of the circle will cross zero . We can make this more apparent by actually showing the solutions on the input plane:

Show the approximate solutions

Try shrinking R with the slider above and zooming in as you do. Notice that:

  • Whenever the input circle crosses any of the zeroes
  • there must be some point on the bottom curve that crossed zero as well
  • So as we make the top circle , the bottom shape must cross zero five times!

So to summarize:

We can prove the fundamental theorem of algebra by realizing

  • Polynomials with a degree of n will wrap around on the w plane n times for a large value of z
  • When we shrink z to zero, we eventually approach the constant f(0)
  • Each of the wrappings must cross zero exactly once
  • Therefore, a polynomial of degree n, will output zero exactly n times

This is a very pretty proof. But we’ve only really just scratched the surface of what complex functions can do. Feel free to try as well:

R

But for now, that completes our visual proof (QED 🤷‍♂️).