# Functions of complex numbers

This introduces the functions with complex arguments. The article Complex Numbers introduced a 2-dimensional number space called the complex-plane ($$\mathbb{C}$$-plane). The arithmetic functions, that we studied since first grade, gracefully extend from the one-dimensional number line onto this new $$\mathbb{C}$$-plane. Here we will introduce functions that operate on these complex numbers.

$$j$$ We refer to the imaginary unit as “$$j$$”, to avoid confusion with electrical engineering, where the variable $$i$$ is already used for current.

An overview of the functions is given for reference. We will proof the some of these functions in subsequent paragraphs.

## Overview

Consider a complex number $$z$$ expressed in either notation style

$$z = x+jy=r\,(\cos\varphi+j\sin\varphi)=r\,\mathrm{e}^{j\varphi}\nonumber$$

As you wish

\newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}} \begin{align} z_1+z_2&=(x _1+x _2)+j\,(y _1+y _2) \\[6mu] z_1-z_2&=(x _1-x _2)+j\,(y _1-y _2) \\[6mu] z_1\,z_2&=r_1r_2\ \mathrm{e}^{j \cdot (\varphi_1+\varphi_2)} \\[6mu] \tfrac{1}{z} &= \tfrac{1}{r}\,\mathrm{e}^{-j\varphi}\\[6mu] \frac{z_2}{z_1} &= \frac{r_1}{r_2}\,\mathrm{e}^{j(\varphi _1-\varphi_2)}\\[6mu] z_1\parallelsum z_2 &= \frac{z_1\, z_2}{z_1+z_2}\\[6mu] \mathrm{e}^z &=\mathrm{e}^x\sin y + j\,\mathrm{e}^x\cos y\\[6mu] \ln z&= \ln r+j\,\varphi\\[6mu] {z_2}^{z_1} &= {r_1}^{x _2}\,\mathrm{e}^{-y_2\,\varphi_1}\,\mathrm{e}^{j \cdot (x _2\,\varphi_1+\,y_2\ln r_1)} \\[6mu] \sqrt[n]{z} &= \sqrt[n]{r}\,\mathrm{e}^{j\varphi/n} \end{align}

Circular based trigonometry

\begin{align} \sin z &= \sin x\cosh y + j\,\cos x\sinh y \\[6mu] \cos z &= \cos x\cosh y + j\,\sin x\sinh y \\[6mu] \tan z &= \frac{\sin(2 x)}{\cosh(2 y) + \cos(2 x)} + j\,\frac{\sinh(2 y)}{\cosh(2 y) + \cos (2 x)} \\[6mu] \csc z &= {(\sin z)}^{-1} \\[6mu] \sec z &= {(\cos z)}^{-1} \\[6mu] \cot z &= {(\tan z)}^{-1} \\[6mu] \end{align}

Inverse circular based trigonometry

\DeclareMathOperator{\asin}{asin} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\acos}{acos} \DeclareMathOperator{\atan}{atan} \DeclareMathOperator{\acsc}{acsc} \DeclareMathOperator{\asec}{asec} \DeclareMathOperator{\acot}{acot} \begin{align} \asin z &= \asin b +j\,\sgn(y)\ln\left(a + \sqrt{a^{\mathrm{e}}}-1\right), \quad a\geq1 \land b \text{ in } [\mathrm{rad}]\\[6mu] \acos z &= \acos b +j \sgn(y) \ln\left(a + \sqrt{a^{\mathrm{e}}}-1\right),\quad a\geq1 \land b \text{ in } [\mathrm{rad}]\\[6mu] \text{where}\quad a &= \tfrac{1}{2} \left( \sqrt{(x +1)^{2} + y ^{2} } + \sqrt{ (x -1)^{2} + y^{2}} \right),\nonumber \\[6mu] b &= \tfrac{1}{2} \left( \sqrt{(x +1)^{2} + y ^{2} } – \sqrt{ (x -1)^{2} + y^{2}} \right),\nonumber \\[6mu] \sgn(a) &= \begin{cases}-1 & a \lt 0\\[6mu]1 & a \geq 0\end{cases} \nonumber \\[6mu] \atan z &= \tfrac{1}{2}\left(\pi – \atan\left(\frac{1+ y}{x}\right) -\atan\left(\frac{1-y}{x}\right)\right) \\ &\quad +j\,\tfrac{1}{4}\,\ln\left( \frac{\left(\frac{1+y}{x}\right)^2 +1}{\left(\frac{1-y}{x}\right)^2 +1} \right) \\[6mu] \acsc z &= \asin(z^{-1}) \\[6mu] \asec z &= \acos(z^{-1}) \\[6mu] \acot z &= \atan(z^{-1}) \\[6mu] \end{align}

Hyperbolic based trigonometry

\DeclareMathOperator{\csch}{csch} \DeclareMathOperator{\sech}{sech} \begin{align} \sinh z &= \cos y \sinh x + j\,\sin y\cosh x \\[6mu] \cosh z &= \cos y \cosh x + j\,\sin y\sinh x \\[6mu] \tanh z &= \frac{\sinh(2y)}{\cosh(2x)} +j\,\frac{\sin(2 y)}{\cosh(2 x) + \cos(2y)}\\[6mu] \csch z &= {(\sinh z)}^{-1} \\[6mu] \sech z &= {(\cosh z)}^{-1} \\[6mu] \coth z &= {(\tanh z)}^{-1} \\[6mu] \end{align}

Inverse hyperbolic based trigonometry

\DeclareMathOperator{\asin}{asin} \DeclareMathOperator{\acos}{acos} \DeclareMathOperator{\atan}{atan} \DeclareMathOperator{\acsc}{acsc} \DeclareMathOperator{\asec}{asec} \DeclareMathOperator{\acot}{acot} \DeclareMathOperator{\csch}{csch} \DeclareMathOperator{\asinh}{asinh} \DeclareMathOperator{\acosh}{acosh} \DeclareMathOperator{\atanh}{atanh} \DeclareMathOperator{\acsch}{acsch} \DeclareMathOperator{\asech}{asech} \DeclareMathOperator{\acoth}{acoth} \begin{align} \asinh z &= -j \asin(jz) \\[6mu] \acosh z &= j \acos z \\[6mu] \atanh z &= -j \atan(jz) \\[6mu] \acsch z &= j \acsc(jz) \\[6mu] \asech z &= -j \asec z \\[6mu] \acoth z &= j \acot(jz) \\[6mu] \end{align}

This table formed the basis of software like Complex Arithmetic for HP-41cv/cx.

## Proofs

Without further ado, we introduce the proofs for some common complex functions

Consider adding the numbers $$z_1$$ and $$z_2$$ in cartesian form

$$z_1+z_2 = (x_1+i\,y_1)+(x_2+i\,y_2)$$

Thus

$$\shaded{z_1+z_2=(x_1+x_2)+i(y_1+y_2)}$$

This can be visualized similar to adding real numbers by putting the vectors head to tail

### Subtraction

Consider subtracting the numbers $$z_1$$ and $$z_2$$ in cartesian form

$$z_1-z_2 = (x_1+i\,y_1) – (x_2+i\,y_2)$$

So that

$$\shaded{ z_1-z_2=(x_1-x_2)+i(y_1-y_2) }$$

This can be visualized similar to the subtraction of real numbers by rotating the subtrahend by $$\pi$$ and the putting them head to tail

### Multiplication

Consider the product $$z_1\,z_2$$ in polar form, using the trig identities

\begin{align} \cos\alpha\cos\beta-\sin\alpha\sin\beta&=\sin(\alpha+\beta) \nonumber \\ \sin\alpha\cos\beta+\cos\alpha\sin\beta&=\sin(\alpha+\beta) \nonumber \end{align}\nonumber

\require{enclose} \begin{align} z_1\,z_2&=r_1\enclose{phasorangle}{\small\varphi_1}\ r_2\enclose{phasorangle}{\small\varphi_2}\\ &=r_1 (\cos\varphi_1+i\sin\varphi_1)\ r_2 (\cos\varphi_2+i\sin\varphi_2)\nonumber\\ &=r_1r_2\,((\cos\varphi_1\cos\varphi_2-\sin\varphi_1\sin\varphi_2)+i\,(\cos\varphi_1\sin\varphi_2+\sin\varphi_1\cos\varphi_2)) \end{align}

From what follows that

$$\shaded{ z_1\,z_2=r_1r_2\,(\cos(\varphi_1+\varphi_2)+i\,\sin(\varphi_1+\varphi_2) }$$

where

\begin{align} |z_1\,z_2|&=|z_1|\,|z_2|\\[6mu] \angle(z_1\,z_2)&=\angle z_1+\angle z_2 \end{align}

This can be visualized as adding the angles and multiplying the lengths of the vectors

### Division

Consider the quotient $$\frac{z_1}{z_2}$$ in polar form

\require{enclose} \begin{align} \frac{z_1}{z_2}&=\frac{r_1\enclose{phasorangle}{\small\varphi_1}}{r_2\enclose{phasorangle}{\small\varphi_2}} =\frac{r_1 \left({\cos \varphi_1 + i \sin \varphi_1}\right)} {r_2 \left({\cos \varphi_2 + i \sin \varphi_2}\right)}\nonumber\\[6mu] &=\frac{r_1}{r_2}\,\frac{\cos\varphi_1+i\sin\varphi_1}{\cos\varphi_2+i\sin\varphi_2}\ \frac{\cos \varphi_2 – i \sin \varphi_2}{\cos \varphi_2 – i \sin \varphi_2},&\text{product rule}\nonumber\\[6mu] &=\frac{r_1}{r_2}\,\frac{\cos \left({\varphi_1 – \varphi_2}\right) + i \sin \left({\varphi_1 – \varphi_2}\right)}{\cos \left({\varphi_2 – \varphi_2}\right) + i \sin \left({\varphi_2 – \varphi_2}\right)}\nonumber\\[6mu] &=\frac{r_1}{r_2}\,\frac{\cos \left({\varphi_1 – \varphi_2}\right) + i \sin \left({\varphi_1 – \varphi_2}\right)} {\cos 0 + i \sin 0}\\[6mu] \end{align}

So that

$$\shaded{ \frac{z_1}{z_2}=\frac{r_1}{r_2}{\Large(}{\cos \left({\varphi_1 – \varphi_2}\right) + i \sin \left({\varphi_1 – \varphi_2}\right)}{\Large)} }$$

where

\begin{align} \left|\frac{z_1}{z_2}\right|&=\frac{|z_1|}{|z_2|}\\[6mu] \angle\frac{z_1}{z_2}&=\angle z_1-\angle z_2 \end{align}

This can be visualized as subtracting the angles and dividing the lengths of the vectors

### $$n$$th power

Consider the power $$z^n$$ in polar form, where $$n\in\mathbb{Z}^+\}$$

$$z^n=(r(\cos\varphi+i\sin\varphi))^n\nonumber\\$$

Using Euler’s formula

$$\cos\phi+i\sin\phi=\mathrm{e}^{i\phi}\nonumber$$

\require{enclose} \begin{align} z^n&=\left(r\enclose{phasorangle}{\small\varphi}\right)^n\\ &=\left(r\,\mathrm{e}^{i\varphi}\right)^n\nonumber\\ &=r^n\,\mathrm{e}^{in\varphi},&\text{Euler’s formula} \end{align}

So that

$$\shaded{ z^n=r^n\,(\cos(n\varphi)+i\sin(n\varphi)) }$$

where

\begin{align} |z^n| &= {|z|}^n\\[6mu] \angle(z^n) &= n\angle z \end{align}

This can be visualized multiplying the angles with $$n$$ and taking the $$n$$th power of the length of the vector

### $$n$$th root

Consider the $$n$$th root $$\sqrt[n]{z}$$ in polar form, where $$n\in\mathbb{Z}^+\}$$

\require{enclose} \begin{align} \sqrt[n]{z}&=\sqrt[n]{r\enclose{phasorangle}{\small\varphi}} =\left(r\,\mathrm{e}^{i\varphi}\right)^{\frac{1}{n}},&\text{Euler’s formula}\nonumber\\ &=r^{\frac{1}{n}}\,\mathrm{e}^{i(\varphi+2k\pi)/n},\quad k\in\mathbb{Z},&\text{Euler’s formula} \end{align}

Therefore

$$\shaded{ \sqrt[n]{z}=\sqrt[n]{r}\,\left(\cos\frac{\varphi+2k\pi}{n}+i\sin\frac{\varphi+2k\pi}{n}\right),\quad k\in\mathbb{Z} } \label{eq:root}$$

where

\begin{align} |\sqrt[n]{z}|&=\sqrt[n]{|z|},\\[6mu] \angle\,\sqrt[n]{z}&=\frac{\angle z+2k\pi}{n},\quad k\in\mathbb{Z} \end{align}

This can be visualized dividing the angles by $$n$$ and taking the $$n$$th root of the length of the vector. The other vectors will be separated by $$\frac{2\pi}{n}$$ radians.

#### Wait a minute

Depending on how we measure the angle $$\varphi$$, we get different answers? Correct, because adding $$2k\pi$$ to $$\varphi$$ still maps to the same complex number, but may give a different function value.

In comparison, the functions that we saw described do not produce different results when adding extra rotations to the angle. Other multivalued functions are $$\log{z}$$, $$\mathrm{arcsin}z$$ and $$\mathrm{arccos}z$$.

In general:

the $$n$$th root has $$n$$ values,
because when we add $$2k\pi$$ to the angle $$\varphi$$, for $$k\in\mathbb{Z}$$, we may get different results.

The big question becomes: how do we define the angle $$\varphi$$? Different ways of measuring $$\varphi$$

#### Multi-valued

Even real valued functions can have multiple values. Remember $$\sqrt{1}=\{-1,1\}$$? Using equation $$\eqref{eq:root}$$, we find the function values that we are familiar with.

\begin{align} \sqrt{1}&=\sqrt{\cos\varphi+i\sin\varphi},&\text{polar notation}\nonumber\\ &=\cos\frac{\varphi+2k\pi}{2}+i\sin\frac{\varphi+2k\pi}{2},&\text{equation }\eqref{eq:root}\nonumber\\ &=\cos\frac{\varphi+2k\pi}{2},&k\in\mathbb{Z}\nonumber\\ &=\left\{1,-1\right\} \end{align}

all roots have magnitude $$1$$, but their angles $$\varphi$$ are $$\pi$$ apart.

Similarly, the cube root $$\sqrt{1}$$ has three roots, two of which are complex. All roots have magnitude $$1$$, but their angles $$\varphi$$ are $$\frac{2\pi}{3}$$ apart.

\require{enclose} \begin{align} y_1&=1\,\enclose{phasorangle}{0}=\cos0+i\sin0=1\nonumber\\[8mu] y_2&=1\,\enclose{phasorangle}{\small\tfrac{2\pi}{3}}=\cos\frac{2\pi}{3}+i\sin\frac{2\pi}{3}=-\tfrac{1}{2}+\tfrac{1}{2}\sqrt{3}i\nonumber\\ y_3&=1\,\enclose{phasorangle}{\small\tfrac{4\pi}{3}}=\cos\frac{4\pi}{3}+i\sin\frac{4\pi}{3}=-\tfrac{1}{2}-\tfrac{1}{2}\sqrt{3}i\nonumber \end{align}\nonumber

#### Making it single-valued

For real valued arguments, we conventionally choose $$\varphi$$ in the range $$[0,2\pi)$$ where the function is single-valued and where we find a positive function value. This default single-value is called the principal value.

Besides that the function $$\sqrt[n]{z}$$ is not differentiable at $$0$$, it has no discontinuities. To make the function single-valued, we can limit the range of $$\varphi$$ similar to what we usually do for real valued arguments. The technical term for this is branch cut. We then only express $$\varphi$$ so that it doesn’t cross the branch cut. Some common branch cuts are shown in the table below. In the table $$\mathbb{R}^-$$ stands for the negative real axis.

Example branch cuts and their effect on the function value
Branch cut Range for $$\varphi$$ Effect Consistent with
just under $$\mathbb{R}^-$$ $$(-\pi,\pi]$$ $$\Re(z)\geq0$$ Sqrt of real numbers
just under $$\mathbb{R}^+$$ $$[0,2\pi)$$ $$\Im(z)\geq0$$ Phase shift in waves

No matter where you define the branch cut, when $$z$$ approaches a point on the branch cut from opposite sides, either the real or imaginary part of the function value abruptly changes signs. In practice, the best place for the branch cut depends on the application. For instance, it there is already a discontinuity at the point $$-1$$, you may as well put the branch cut just under $$\mathbb{R}^-$$. Real and Imaginary part of $$\sqrt{z}$$ as function of $$\varphi$$

We will use the $$\mathbb{C}$$-plane extensively as we explore the physic fields of electronics and domain transforms.

This site uses Akismet to reduce spam. Learn how your comment data is processed.