Quadratic equations

Eukleides of Alexandria (Euclid), a Greek mathematician, produced a general method to solve quadratic equation around 300 BC.

Quadratic equations are problems with squares, or “quadratus” in Latin. We derive a method to solve quadratic equations. In 2000 BC, the Babylonians developed an approach to solve problems which, in current notation would be a quadratic equation [wiki]. A arbitrary example of this is:\(\)

A field has a perimeter of 40 and an area of 96. What are the dimensions of this field?”

Around 300 BC, the Greek mathematician Euclid produced a general method to solve quadratic equations.

Introduction

Before we introduce quadratic polynomials, let’s start by multiplying two linear functions (lines).

Multiplying linear functions

Let \(g(x)\) and \(h(x)\) be linear functions

$$ \left\{ \begin{array}{c} g(x)=x-s\\[5pt] h(x)=x-t \end{array} \right. $$

where \(x\) is a variable and \(s\) and \(t\) are constants.

The function value equals \(0\) at the \(x\)-intercepts.

$$ \left\{ \begin{array}{c} g(x_0)\equiv 0 \Rightarrow & x_0-s\equiv 0 \Rightarrow & x_0=s\\[5pt] h(x_0)\equiv 0 \Rightarrow & x_0-t\equiv 0 \Rightarrow & x_0=t \end{array} \right. $$

First, we define function \(f(x)\) as a scalar \(a\) multiplied with the functions \(g(x)\) and \(h(x)\)

$$ f(x)\equiv a\,g(x)\,h(x)=a(x-s)(x-t) \label{eq:GxHxFactorized} $$

This equation results in the parabola \(f(x)\) that shares \(x\)-intercepts with the two lines.

The interactive graph above visualizes the zero product property:

If the product of two quantities is equal to zero, then at least one of the quantities must be equal to zero. zero-product property

Expand

The expression \((x-s)(x-t)\) from function \(\eqref{eq:GxHxFactorized}\) can be expanded geometrically by representing the quantities \(x, -s, -t\) as line segments, and representing the products of two quantities by the area of a rectangle.

Geometric representation of \((x-s)(x-t)=x^2-(s+t)x+st\)

Now we multiply this expanded form with scalar \(a\):

$$ ax^2-a(s+t)x+a\,s\,t\label{eq:exanded} $$

The equation now fits in the standard form for a single variable quadratic polynomial expression.

$$ \begin{array}{c} ax^2+bx+c \\ \text{where}\ \ t=-a(s+t),\ \ c=a\,s\,t \end{array} \label{eq:quadraticExp} $$

This is called a quadratic expression, or a second order polynomial since the greatest power in the equation is two.

Solutions to Quadratic Equation

In the previous section we showed that multiplying two linear functions creates a quadratic function. Here we will do the opposite and bring the standard form quadratic \(\eqref{eq:quadraticExp}\) back to its factorized form.

$$ ax^2 + bx + c \equiv a(x-r_1)(x-r_2) \label{eq:quadratic} $$

We replaced the constants \(s\) and \(t\) with \(r_1\) and \(r_2\) to clearly denote them as the roots.

According to \(\eqref{eq:quadraticExp}\) these roots should add up to \(-\frac{b}{a}\) and while their product equals \(\frac{c}{a}\)

$$ r_1+r_2=-\frac{b}{a}\quad\land\quad r_1\,r_2=\frac{c}{a} \label{eq:factorize} $$

In the following section, we will derive a general formula for the roots using a method called “completing the square”.

Derive the Quadratic Formula

In the factorized form, \(r_1\) and \(r_2\) are the values of \(x\) for which the expression equals \(0\).

$$ a(x-r_1)(x-r_2)=0\ \Rightarrow\ \left| \begin{array}{l} x=r_1 \\ x=r_2 \end{array} \right. $$

This implies that the expanded form \(\eqref{eq:quadratic}\) must equal \(0\) for the same values of \(x\).

$$ ax^2+bx+c\equiv 0\label{eq:derive0} $$

Now we solve the equation \(\eqref{eq:derive0}\) by isolating \(x\) on the left

$$ x^2+\frac{b}{a}x = -\frac{c}{a} \label{eq:derive1} $$

The variable \(x\) occurs twice, which makes the equation hard to solve. We can find the solutions by working towards the identity:

$$ \color{green}{p}^2+2\color{green}{p}\color{purple}{q}+\color{purple}{q}^2=(\color{green}{p}+\color{purple}q)^2\nonumber $$

Then we multiply equation \(\eqref{eq:derive1}\) by \(4a^2\)and add \(\color{purple}b^2\) to both sides.

$$ \begin{equation} \begin{split} x^2+\frac{b}{a}x &=-\frac{c}{a} & \times 4a^2 \nonumber\\ \Leftrightarrow\quad(\color{green}{2ax})^2+4abx &=-4ac & +b^2 \nonumber\\ \Leftrightarrow\quad(\color{green}{\underline{2ax}})^2+2(\color{green}{\underline{2ax}})\color{purple}{\underline{b}}+\color{purple}{\underline{b}}^2&=-4ac+\color{purple}{b}^2 \end{split} \label{eq:derive2} \end{equation} $$

The left side now fits the format of the identify, where \(\color{green}p=\color{green}{2ax}\) and \(\color{purple}q=\color{purple}b\). Now we apply the identity to equation \(\eqref{eq:derive2}\)

$$ \begin{equation} \begin{split} (\color{green}{2ax}+\color{purple}{b})^2&=b^2-4ac & \text{take the }\sqrt{\color{white}{1}}\nonumber\\ 2ax+b &= \pm\sqrt{b^2-4ac} & \text{solve for }x\nonumber\\ 2ax &= -b\pm\sqrt{b^2-4ac}\nonumber\\ x&=\frac{-b\pm\sqrt{b^2-4ac}}{2a} \end{split}\label{eq:roots} \end{equation} $$

The roots found by this equation are the values of \(x\) that are solutions to \(\eqref{eq:roots}\). This implies that the expression \(ax^2+bx+c\) can be factorized as:

$$ \shaded{ \begin{split} a^2+bx+c &=a(x-r_1)(x-r_2) \nonumber \\ \text{where}\ \ r_{1,2} &=\frac{-b\pm\sqrt{b^2-4ac}}{2a} \nonumber \end{split} } \label{eq:quadroots} $$

Discriminant

A polynomial of the second power always has two roots, though they may or may not be distinct or real.

The expression under the square root sign in \(\eqref{eq:quadroots}\) is called the discriminant, or \(D\).

$$ D = b^2-4ac $$

The discriminant determines the nature of the roots.

  • when \(D>0\), there are two distinct real roots.
  • when \(D=0\), there is a double real root.
  • when \(D\lt0\), there are two complex roots.

The unit Complex Numbers defined the imaginary unit \(i\) as \(i^2=-1\) and showed that each complex number \(z\) consists of a real part \(x\) and an imaginary part \(iy\), where \(x\) and \(y\) are real numbers. Using \(i\) as the imaginary unit, we can denote any complex number \(z\) as:

$$ z = x+iy\label{eq:zdef} $$

These complex numbers extend the number line to a two-dimensional \(\mathbb{C}\)-plane as shown below.

z on the C-plane
Point \(z\) on the \(\mathbb{C}\)-plane

Real roots

The distinct or double real roots can be easily visualized by plotting the function and finding the \(x\)-intercepts. These intercepts are the roots.

\(f(x)=x^2-4x+3\)
\(f(x)=x^2-4x+4\)

In the figures above the function depicted in the graph on the left has real roots at \(1\) and \(3\), and the function on the right has a double root at \(2\).

Where are the imaginary roots?

When the roots of a function are complex, the quadratic function \(\eqref{eq:quadratic}\) has a graph that doesn’t intersect the \(x\)-axis as shown below. So where are those roots?

\(f(x)=x^2-4x+5\)

The quadratic formula \(\eqref{eq:quadroots}\) tells us that the roots for the function depicted in the graph above are \(2+2j\) and \(2-2j\).

$$ x^2-4x+8=(x-2-2j)(x-2+2j)\label{eq:zquadratic} $$

To find these complex roots visually, we need to broaden our perspective and allow the independent variable \(x\) to have complex values. After all, these roots are complex values. From here on we will name the variable \(z\) instead of \(x\) to emphasize that \(z\in\mathbb{C}\). We will reuse \(x\) for the real part of \(z\).

Evaluate quadratic expression \(\eqref{eq:quadratic}\) with variable \(z\) follows

$$ \begin{equation} \begin{split} f(z) &= az^2+bz+c &\forall_{z\in\mathbb{C}}\\ \text{where}\quad z &\equiv x+jy &\forall_{x,y\in\mathbb{R}}\\ \text{and}\ \ f(z) &\equiv u+vj \end{split} \label{eq:fzdef} \end{equation} $$

With a complex function argument \(x+yj\) \(\eqref{eq:zdef}\) and a complex function value \(u+iv\) \(\eqref{eq:fzdef}\), we need four mutually perpendicular axes \(x,y,u,v\) to graph the function. The catch: we can’t graph a 4-dimensional function.

To reduced the graph to a 3-dimensions, either

  1. Only consider variables \(z\) for which the function value is a real number, and graph the function value on z-axis perpendicular to the \(\mathbb{C}\)-plane. The roots will be where the graph intersects the \(\mathbb{C}\)-plane.
  2. Consider all variables \(z\in\mathbb{C}\), but take only the modulus of the function value \(|f(z)|\).

The following sections describe each of two visualization techniques. [1]

Plotting real function values

Now we graph the function \(\eqref{eq:zquadratic}\), considering only values of \(z\) for which the function value \(f(z)=u+jv\) is real (v=0).

We can let the variable be \(z=x+jy\) and split the function value \(\eqref{eq:fzdef}\) into real and imaginary parts

$$ \begin{equation} \begin{split} f(z)&=az^2+bz+c & z\equiv x+iy\nonumber\\ &=a(x+jy)^2+b(x+jy)+c &\text{expand}\nonumber\\ &=ax^2+2axjy-ay^2+bx+jby+c &\text{split Re/Im}\nonumber\\ &=\underbrace{(ax^2-ay^2+bx+c)}_{\text{real part}} + \underbrace{y(2ax+b)j}_{\text{imaginary part}} \end{split} \end{equation} $$

The imaginary part of the function value must be \(0\).

$$ y(2ax+b)=0 \ \Rightarrow\ \left| \begin{array}{l} y=0 \\ x=-\frac{b}{2a} \end{array} \right. $$

Substitute the value \(y=0\) in \eqref{eq:zdef}

$$ \begin{equation} \begin{split} z_r&=x+jy &\text{subst }y=0 \nonumber\\ &=x+0j &\forall_{x\in\mathbb{R}} \end{split}\label{eq:zr} \end{equation} $$

Do the same for \(x=-\tfrac{b}{2a}\)

$$ \begin{equation} \begin{split} z_c &=x+yj &\text{subst }x=-\tfrac{b}{2a} \nonumber \\ &=-\tfrac{b}{2a}+yj &\forall_{y\in\mathbb{R}} \end{split}\label{eq:zc} \end{equation} $$

This implies that the function \(\eqref{eq:zquadratic}\) has a real-value

  1. when evaluated for \(z=x\) where \(x\in\mathbb{R}\), or
  2. when evaluated for \(z=-\frac{b}{2a}+yj\) where \(y\in\mathbb{R}\)

In the first case, evaluating for \(z=x\) where \(x\in\mathbb{R}\), means evaluating along the familiar \(x\)-axis. This is how we visualized the real roots.

$$ \begin{equation} \begin{split} f(z_r) &= az^2+bx+c &\text{subst }z_r=x\text{ from }\eqref{eq:zr}\nonumber\\ \Rightarrow\quad f(x) &= ax^2+bx+c \end{split}\label{eq:fx} \end{equation} $$

In the second case, evaluating for \(z=-\tfrac{b}{2a}+yj\) where \(y\in\mathbb{R}\), means evaluating along a line that intersects the point \(\left(-\frac{b}{2a}+0j\right)\) and runs parallel to the imaginary \(y\)-axis as shown in the figure below.

The lines \(x\) and \(-\frac{b}{2a}+yj\)

Substituting \(-\frac{b}{2a}+yj\) for \(z\) in \(\eqref{eq:zquadratic}\).

$$ \newcommand\ccancel[2][black]{\color{#1}{\cancel{\color{black}{#2}}}} \newcommand\cbcancel[2][black]{\color{#1}{\bcancel{\color{black}{#2}}}} \newcommand\ccancelto[3][black]{\color{#1}{\cancelto{#2}{\color{black}{#3}}}} \begin{equation} \begin{split} f(z) &= az^2+bz+c \quad\quad\quad\text{subst }z=-\frac{b}{2a}+yj\text{ from }\eqref{eq:zc}\\ f\left(-\frac{b}{2a}+yj\right) &= a\left(-\frac{b}{2a}+yj\right)^2+b\left(-\frac{b}{2a}+yj\right)+c\nonumber\\ &= {\ccancel[red]{a}}\frac{b^2}{4a^{\ccancel[red]{2}}}-{\ccancel[red]{2a}}\frac{\cbcancel[blue]{b}}{\ccancel[red]{2a}}{\cbcancel[blue]{yj}}-ay^2-\frac{b^2}{2a}+{\cbcancel[blue]{byj}}+c \end{split}\label{eq:fy0} \end{equation} $$

This makes \eqref{eq:fy0} a function of \(y\) because \(a,b\) and \(j\) are constants.

$$ \shaded{ f(y)=-ay^2-\frac{b^2}{4a}+c\quad\forall_{y\in\mathbb{R}} } \label{eq:fy} $$

Similar to how the graph for \(f(x)\) intersects the \(\mathbb{C}\)-plane at the real roots, the graph for \eqref{eq:fy} intersects the \(\mathbb{C}\)-plane at the complex roots of the function.

The interactive graph shown below visualizes this concept. Click Interact and wait for the model to load.

Interactive graph of quadratic equation showing complex roots

Plotting the modulus of the function values

Here we graph the function \(\eqref{eq:zquadratic}\) by considering all values of \(z\), but only plotting the modules of the function value \(f(z)\). The modulus \(|f(x+jy)|\) is defined as:

$$ |f(x+jy)|\triangleq\sqrt{x^2+y^2}\nonumber $$

To find the modulus of the function value, we can apply the definition \(\eqref{eq:zdef}\) to the quadratic equation \(\eqref{eq:zquadratic}\).

$$ \begin{equation} \begin{split} f(z) &= az^2+bz+c\nonumber\\\ f(x+jy) &= (ax^2-ay^2+bx+c) +y(2ax+b)j\nonumber\\ \Rightarrow\quad |f(x+jy)| &= \sqrt{(ax^2-ay^2+bx+c)^2 +y^2(2ax+b)^2}\\ \text{where}\quad x &\in\mathbb{R}\ \land\ y\in\mathbb{R}\nonumber \end{split} \end{equation} $$

This equation implies that the function arguments are two independent variables. In the graph we depict them as a horizontal complex plane with points \(z=x+jy\). The \(z\)-axis of the graph is used for the modulus of the function value. In this so called modulus surface, color is used to show the angle of the function value.

While this surface is well suited to depict real and complex values, it has some drawbacks. The most obvious one is that it shows the modulus of the function where \(|f(z)|\geq0\). As a consequence, the parabolic shape is harder to recognize.

In the graph below, we added the real function values \(f(z_c)\) from the previous visualization technique that showed negative values. In the surface plot, these same function values are represented on the positive \(z\)-axis but shown in red to signify an angle of \(\varphi=\pi\), where \(\mathrm{e}^{j\pi}=-1\).

To draw a modulus surface, you can either use the model below, or you can using the code shown in Appendix A. Click Interact, wait for the model to load and click on \(|f(z)|\).

Interactive graph of quadratic equation showing complex roots

Appendix A

clear
[x,y] = meshgrid(-10: 0.1: 10);
z = x + i*y;
fz = z.^2 - 4.*z + 8;
surf(x,y,abs(fz), angle(fz));
zlim([0,20]);
xlabel("x"); ylabel("y"); zlabel ("|f(x+jy)|");
shading interp;

References

[1] The Complex Roots of a Quadratic Equation: A Visualization Carmen Q Artino, Professor in Mathematics at The College of Saint Rose, Albany, NY. Parabola Volume 45, Issue 3 (2009)

Functions of complex numbers

Perplexed-Girl doing math

\(\)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

Addition

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

Visualization of complex addition

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

Visualization of complex addition

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

Visualization of complex addition

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

Visualization of complex addition

\(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

Visualization of complex power with real exponent

\(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.

Visualization of complex root with real exponent

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[3]{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.

Complex numbers

Perplexed-Girl doing math

\(\)Instead of projecting the future merits of complex numbers, we will introduce them in an intuitive way. We draw a parallel to negative numbers that have been universally accepted around the same time.

We start this writing with a review of concepts that should be evident. Nevertheless, I encourage you to read through them, as we build on these concepts while introducing complex numbers.

Review

Arithmetic gives us tools to manipulate numbers. It allows us to transform one number into another using transformations such as negation, addition, subtraction, multiplication and division.

Positive numbers

In first grade, we learned the concept of the number line and how numbers can be represented by vectors starting at \(0\). We visualized addition by putting these vectors head to tail, where the net length and direction is the answer.

Number line animation for \(5+3=8\)

Soon thereafter, we learned how to subtract numbers by rotating the subtrahend (the value that you subtract) vector and then putting the head to tail.

Number line animation for \(5-3=2\)

We will expand on this as we discuss negative numbers and imaginary numbers. Before we introduce such numbers, let’s also refresh on the concept of equations with squares and square roots.

Square and square root

When we solve the equation \(2x^2=8\), we look for a transformation (\(\times x\)) that, when applied twice, turns the number \(2\) into \(8\).

$$ 2 \times x \times x = 8 $$

As shown in the animation below, the two solutions \(x=2\) and \(x=-2\), both satisfy the equation \(2x^2=8\).

Number line animation for \(2 \times 2 \times 2=8\)

Negative numbers

Negative numbers have lingered around since 200 BC, but with mathematics based on geometrical ideas such as length and count, there was little place for negative numbers. After all, how can a pillar be less than nothing in height? How could you own something less than nothing?

Even a hundred years after the invention of algebra in 1637, the answer to \(4=4x+20\) would be thought of as absurd as illustrated by the quotes:

Negative numbers darken the very whole doctrines of the equations and make dark of the things which are in their nature excessively obvious and simple. Francis Maseres, British mathematician (1757)
To really obtain an isolated negative quantity, it would be necessary to cut off an effective quantity from zero, to remove something of nothing: impossible operation. Lazare Carnot, French mathematician (1803)

Acceptance

Some mathematicians in the 17th century discovered that negative numbers did have their use in solving cubic and quadratic equations, provided they didn’t worry about the meaning of these negative numbers. While the intermediate steps of their calculations may involve negative numbers, the solutions were typically real positive numbers.

Only in the 19th century were negative numbers truly accepted when mathematicians started to approach mathematics in terms of logical definitions.

Physical meaning has given way to algebraic use.

The English mathematician, John Wallis (1616 – 1703) is credited with giving meaning to negative numbers by inventing the number line. Even today, the number line helps students as they actively construct mathematical meaning, number sense and an understanding of number relationships. We learned to use negative numbers without a thinking about the thousands of years it took to develop the principle.

You were probably introduced to the concepts of absolute value and direction through the geometric representation on this number line. With negative numbers so embedded in our mathematics, we accept the solution to \(3-5\) without a second thought.

Number line animation for \(3-5=-2\)

In general, we learned that the negative symbol represents the “opposite” of a number. To change the sign of a number, we rotate its vector 180 degrees (\(\pi\)) around the point \(0\). We will extend on this important concept as we introduce imaginary numbers.

Imaginary numbers

First off, imaginary numbers are called such because for a long time they were poorly understood and regarded by some as fictitious. Even Euler, who used them extensively, once wrote:

Because all conceivable numbers are either greater than zero or less than 0 or equal to 0, then it is clear that the square roots of negative numbers cannot be included among the possible numbers [real numbers]. Consequently we must say that these are impossible numbers. And this circumstance leads us to the concept of such number, which by their nature are impossible, and ordinarily are called imaginary or fancied numbers, because they exist only in imagination. Leonhard Euler, Swiss mathematician and physicist, Introduction to Algebra pg.594

History

Around the same time that mathematicians were struggling with the concept of negative numbers, they also came across square roots of negative numbers.

Girolamo Cardano, an Italian mathematician who published the solution to cubic and quartic equations, studied a problem that in modern algebra would be expressed as \(x^2-10x+40=0\,\land\,y=10-x\)

Find two numbers whose sum is equal to 10 and whose product is equal to 40. Translation of Ars Magna chapter 37, pg 219 (1545) by Girolamo Cardano

Cardano states that it is impossible to find the two numbers. Nonetheless, he says, we will proceed. He goes on to provide two objects that satisfy the given condition. Cardano found a sensible answer by working through his algorithm, but he called these numbers “ficticious” because not only did they disappear during the calculation, but they did not seem to have any real meaning.

This subtlety results from arithmetic of which this final point is as I have said as subtle as it is useless. Translation of Ars Magna chapter 37, pg 219 (1545) by Girolamo Cardano

Acceptance

In 1849, Carl Friedrich Gauß, produced a rigorous proof for complex numbers what gave a big boost to the acceptance of these numbers in the mathematical community.

With this historic perspective, let’s see how these imaginary numbers fit into what we know about number theory.

We learned that the negative symbol represents the “opposite” of a number. On the number line we can represent this by rotating the vector that represents the number 180° (\(\pi\)) around the origin \(0\).

Let’s dive straight in and consider the equation

$$ \begin{align} x^2&=-1\\ \Rightarrow\quad 1\times x\times x&=-1\label{eq:1tomin1} \end{align} $$

What multiplication with \(x\), when applied twice, turn \(1\) into \(-1\)? Multiplying twice by a positive number gives a positive result. Same for a negative number.

Time to take a step back: we said that a negation represents a rotation of \(\pi\) around the origin. What if we rotate the vector \(1\) by \(\frac{\pi}{2}\) twice, and worry about its meaning later.

Number line animation multiplying \(1\) twice so that we get \(-1\)

Indeed, twice rotating the vector \(1\) around the origin by \(\frac{\pi}{2}\) gives us \(-1\). All that we have left to do, is to find a name for the vector where \(1\) is rotated by \(\frac{\pi}{2}\). To credit Euler’s “imaginary or fancied numbers”, we call it \(i\). The first multiplication turns \(1\) into \(i\), and the second multiplication turns \(i\) into \(-1\).

More over, rotating in the opposite direction works as well. The first multiplication turns \(1\) into \(-i\), and the second multiplication turns \(-i\) into \(-1\). So there are two square roots of \(-1\): \(i\) and \(-i\). We have two solutions to \(x^2=-1\)!

Alternate number line animation multiplying \(1\) twice so that we get \(-1\)

Interpretation of “\(i\)”

What is the meaning of this mysterious value \(i\)? The first rotation turned \(1\) into \(i\), so the rotation is a visualization of multiplying with \(i\). Rotating \(i\) once more turns \(i\) into \(-1\).

Number line animation for \(1 \times i \times i=-1\)

Substituting \(x=i\) in \(\eqref{eq:1tomin1}\) implies that \(i\times i=-1\) or written as

$$ \shaded{ i^2=-1 } $$

By introducing an axis perpendicular to the number line, we have extended or number space to a two dimensional plane called \(\mathbb{C}\). This \(\mathbb{C}\)-plane includes the real numbers from the real number line, along with imaginary numbers on the \(i\)-axis and every combination thereof. We call this new number set “Complex Numbers“.

Notation

By introducing \(i\), we have added a dimension to the number line. With that come three new notation forms that each have their own use case. We will express the complex number \(z\) as shown below in these forms.

Point in complex plane as cartesian, polar and exponential form
Relation between cartesian, polar and exponential forms

Cartesian form

Each complex number has a real part \(x\) and an imaginary part \(y\), where \(x\) and \(y\) are real numbers. Using \(i\) as the imaginary unit, we can denote a complex number \(z\) as

$$ \shaded{z=x+iy} $$

The point \(z\) can be specified by its rectangular coordinates \((x,y)\), where \(x\) and \(y\) are the signed distances to the imaginary \(y\) and real \(x\)-axis. This \(xy\)-plane is commonly called the complex plane \(\mathbb{C}\).

This cartesian form is a logical extension of the number line and will prove useful when adding or subtracting complex numbers.

Polar form

The same point \(z\) can be specified by its polar coordinates \((r,\varphi)\), where \(r\) is the distance to the origin and \(\varphi\) is the angle of the vector, in radians, with the positive \(x\)-axis. With \(r\in\mathbb{R}^+\) and \(\varphi\in\mathbb{R}\), we can describe point \(z\) as

$$ \require{enclose} \shaded{ r\enclose{phasorangle}{\small\varphi}=r\,(\cos\varphi+i\sin\varphi) } $$

here \(r\) corresponds to modulus \(|z|\), and \(\varphi\) is called the argument. The value \(z=0\) was excluded because the angle \(\varphi\) is not defined that that point.

The polar form simplifies the arithmetic when used in multiplication or powers of complex numbers.

From the illustration, it is clear how to convert from cartesian to polar form

$$ \shaded{ \begin{align} x&=r\cos\varphi\nonumber\\ y&=r\sin\varphi\nonumber \end{align}} $$ and back $$ \shaded{\begin{align} r&=\sqrt{x^2+y^2}\nonumber\\[6mu] \varphi&=\mathrm{atan2}(y,x)\nonumber\\[10mu] \end{align} } $$

Here \(\mathrm{atan2(y,x)}\) prevents negative signs in \(\arctan\frac{y}{x}\) from canceling each other out. Otherwise, we would not be able to distinguish \(\varphi\) in the 1st from that in the 3rd quadrant, or \(\varphi\) in the 2nd from that in the 4th.

$$ \begin{align} \mathrm{atan2}(y,x) &= \begin{cases} \arctan\left(\frac{y}{x}\right) & x\gt0\nonumber\\ \arctan\left(\frac{y}{x}\right)+\pi & x\lt0 \land y\geq0\nonumber\\ \arctan\left(\frac{y}{x}\right)-\pi & x\lt0 \land y\lt0\nonumber\\ \frac{\pi}{2} & x= 0 \land y\gt0\nonumber\\ -\frac{\pi}{2} & x= 0 \land y\lt0\nonumber\\ \text{undefined} & x= 0 \land y = 0\nonumber \end{cases} \end{align} $$

Consider complex number \(z\) with angle \(\varphi_0\). If you make any integer number of rotation rotate around the origin, you will be back the your initial starting point. Since a full rotation corresponds to an angle of \(2\pi\), the same point \(z\) can be described as

$$ \require{enclose} r\enclose{phasorangle}{\small\varphi+2k\pi}=r\,(\cos(\varphi+2k\pi)+i\sin(\varphi+2k\pi)),\quad k\in\mathbb{Z} $$

We will the effects of this further when discussing multi-valued functions such as square root.

Exponential form

Euler’s formula was introduced in a separate write-up as

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

Using Euler’s formula we can rewrite the polar form of a complex number into its exponential form

$$ \shaded{ z=r\,\mathrm{e}^{i\varphi} } $$

Similar to the polar form, the angle can be expressed in infinite different ways

$$ \begin{align} z &= r\,\mathrm{e}^{i(\varphi+2k\pi)}, & k\in\mathbb{Z} \end{align} $$

This exponential form is often preferred over the polar form, because it reduces the need for trigonometry.

What next?

My follow-up article Complex Functions introduces functions that operate on complex numbers. Such functions include addition, subtraction, multiplication to the most obscure trigonometry functions.

We will use the \(\mathbb{C}\)-plane extensively as we explore electronics and domain transforms. From here on

we will refer to the imaginary unit as “\(j\)”, to avoid confusion with electronics where the variable \(i\) is already used for electrical current.

The same Leonard Euler that once said these numbers “only exist in our imagination” also used imaginary numbers to unite trigonometry and analysis in his most beautiful formula.

Partial fraction expansion

Oliver Heavisite from wiki

Describes particle fraction expansion using the Heaviside method. Decompose rational functions of polynomials in Laplace or Z-transforms.

Oliver Heaviside (1850-1925), was an English electrical engineer, mathematician and physicist who among many things adapted complex numbers to the study of electrical circuits. He introduced a method to decompose rational function of polynomials as they occur when using the Laplace transform to solve differential equations.\(\)

Whenever the denominator of a rational function can be factored into distinct linear factors, the fraction can be expressed as the sum of partial fractions.

$$ \begin{align} f(x)=\frac{b_0+b_1x+b_2x^2+b_3x^3+\ldots+b_Mx^{M}}{1+a_1x+a_2x^2+a_3x^3+\ldots+a_Nx^N}\nonumber\\[10mu] \triangleq\frac{b_0+b_1x+b_2x^2+b_3x^3+\ldots+b_Mx^{M}}{(x-r_1)(x-r_2)(x-r_3)\ldots(x-r_N)}\label{eq:factors} \end{align} $$

A rational function \(\eqref{eq:factors}\) with \(N\) distinct poles \(r_k\), can be expressed as a summation of simple fractions

$$ \shaded{ \frac{b_0+b_1x+b_2x^2+b_3x^3+\ldots+b_Mx^{M}}{(x-r_1)(x-r_2)(x-r_3)\ldots(x-r_N)}\triangleq\sum_{k=1}^N \frac{c_k}{x-r_k} } $$

Written out as

$$ \frac{b_0+b_1x+b_2x^2+b_3x^3+\ldots+b_Mx^{M}}{(x-r_1)(x-r_2)(x-r_3)\ldots(x-r_N)}=\frac{c_1}{x-r_1}+\frac{c_2}{x-r_2}+\cdots+\frac{c_{\small N}}{x-r_{\small N}}\label{eq:distinctpoles} $$

The constants \(c_k\) can be obtained by dividing out the \((x-r_k)\) factor in equation \(\eqref{eq:distinctpoles}\) and evaluating at \(x=r_k\)

$$ c_k = \left.\frac{b_0+b_1x+b_2x^2+b_3x^3+\ldots+b_Mx^{M}}{(x-r_1)(x-r_2)(x-r_3)\ldots(x-r_N)}\right|_{x=r_k} $$

Non-distinct poles

If a pole \(r_k\) is not distinct, the partial fraction expansion for that multiple pole becomes a bit more involved. When the pole occurs \(q\) times as in \((x-r_k)^q\), that pole expands to a summation of decreasing powers of \((x-r_k)\)

$$ \sum_{i=1}^q\frac{d_i}{(x-r_k)^i}\label{eq:nondistict} $$

where the constants \(d_i\) follow to satisfy

$$ d_i=\left.\frac{1}{(q-i)!}\ \left( \frac{\mathrm{d}^{q-i}}{\mathrm{d}x^{q-i}}\ (x-r_k)^q\ f(x) \right)\right|_{x=r_k} $$

In practice, it is easier to first find \(d_q\) by dividing out the highest power \((x-r_k)^q\) in equation \(\eqref{eq:factors}\) and evaluating at \(x=r_k\)

$$ d_q=\left.\frac{b_0+b_1x+b_2x^2+b_3x^3+\ldots+b_Mx^{M}}{(x-r_1)(x-r_2)(x-r_3)\ldots(x-r_N)}\right|_{x=r_k} $$

The remaining \(d_k\) constants are found by substituting known constants and matching like powers.

For example

his is one of those cases where examples might shed some light on the topic.

Example 1

Consider the rational polynomial

$$ f(x)=\frac{-8+24x}{1-2x+x^2}\label{eq:example} $$

The denominator is a second-order polynomial. The roots of any quadratic equation \(ax^2+bx+c=0\) are

$$ r_{1,2} = \frac{-b\pm\sqrt{b^2-4ac}}{2a} \nonumber $$

The two roots of the denominator polynomial in equation \(\eqref{eq:example}\) are

$$ r_{1,2 } = \frac{2\pm\sqrt{4-4}}{2}\quad\Rightarrow\quad\shaded{r_{1,2}=r=1} $$

This gives equation \(\eqref{eq:example}\) with a factorized denominator

$$ f(x) = \frac{-8+24x}{\left(1-x\right)^2} $$

According to \(\eqref{eq:nondistict}\), this can be expressed as partial fractions

$$ f(x)=\frac{-8+24x}{(1-x)^2}\triangleq\frac{c_1}{(1-x)^2}+\frac{c_2}{1-x} \label{eq:heavyside2} $$

Find the constant \(c_1\) using using Heaviside’s cover up method: multiply all terms by \((1-x)^2\) and then evaluate for \(1-x=0\) so that only the term \(c_1\) is left on the right

$$ c_1=\left.\frac{-8+24x}{((1-x)^2}\right|_{x=1}=-8+24\Rightarrow \shaded{c_1=16} $$

Given the value of \(c_1\), constant \(c_2\) can be found by substituting any numerical value (other than \(0\) in equation \(\eqref{eq:heavyside2}\)

$$ \begin{align} \frac{-8+24x}{(1-x)^2} &= \frac{c_1}{(1-x)^2}+\frac{c_2}{1-x} \Big|_{x=2,\,c_1=16} \implies \nonumber \\ \frac{-8+48}{(1-2)^2} &= \frac{16}{(1-2)^2}+\frac{c_2}{1-2} \implies \nonumber \\ 40 &= 16-c_2\Rightarrow\shaded{c_2=-24} \end{align} $$

The sum of partial fractions follows as

$$ \shaded{ f(x)=\frac{-24}{1-x}+\frac{16}{\left(1-x\right)^{2}} } $$

Example 2

Consider the rational polynomial where the order of the numerator is the same as that of the denominator

$$ f(x) = \frac{2x^3+x^2-x+4}{(x-2)^3} $$

Make the degree of the numerator \(1\) less than that of the denominator by dividing both sides by \(x\). This makes \(\frac{f(x)}{z}\) is a strictly proper rational function. According to Heaviside, this can be expressed as partial fractions

$$ \frac{f(x)}{x} = \frac{2x^3+x^2-x+4}{x(x-2)^3}\triangleq\frac{c_1}{x}+\frac{c_2}{(x-2)^3}+\frac{c_3}{(x-2)^2}+\frac{c_4}{x-2}\label{eq:example2a} $$

Multiply both sides of equation \(\eqref{eq:example2a}\) by \(x\) so that only \(c_0\) is left on the right; then evaluate for \(x=0\)

$$ c_1 = \left.\frac{2x^3+x^2-x+4}{(x-2)^3}\right|_{x=0}=\frac{4}{(-2)^3}\Rightarrow \shaded{c_1=-\frac{1}{2}} $$

Use Heaviside’s cover up method to find the constant \(c_3\). (multiply both sides with \((x-2)^3\) so that only \(c_1\) is left on the right; then evaluate for \(x=2\)

$$ c_2 = \left.\frac{2x^3+x^2-x+4}{x}\right|_{x=2}=\frac{16+4-2+4}{2}\Rightarrow \shaded{c_2=11} $$

Bring all the terms into a common denominator

$$ \begin{align} \frac{2x^3+x^2-x+4}{x(x-2)^3}&=\frac{c_1}{x}+\frac{c_2}{(x-2)^3}+\frac{c_3}{(x-2)^2}+\frac{c_4}{x-2}\Rightarrow\nonumber\\[10mu] \frac{2x^3+x^2-x+4}{x(x-2)^3}&=\frac{c_1(x-2)^3}{x(x-2)^3}+\frac{c_2x}{x(x-2)^3}+\frac{c_3x(x-2)}{x(x-2)(x-2)^2}+\frac{c_4x(x-2)^2}{x(x-2)^2(x-2)}\Rightarrow\nonumber\\[10mu] 2x^3+x^2-x+4&=c_1(x-2)^3+c_2x+c_3x(x-2)+c_4x(x-2)^2 \end{align} $$

Substitute the known values \(c_1\) and \(c_2\), expand and regroup

$$ \begin{align} 2x^3+x^2-x+4&=-\frac{1}{2}(x^3-6x^2+12x-8)+11x+c_3x(x-2)+c_4x(x-2)^2\quad\Rightarrow\nonumber\\ 2x^3+x^2-x\cancel{+4}&=-\frac{1}{2}x^3+3x^2-6x\cancel{+4}+11x+c_3x^2-2c_3x+c_4x^3-4c_4x^2+4c_4x\ \Rightarrow\nonumber\\ 2x^3+x^2-x&=(c_4-\frac{1}{2})x^3+(3-4c_4+c_3)x^2+(-6+11+4c_4-2c_3)x \end{align} $$

Match corresponding powers of \(x\)

$$ \left. \begin{align} 2\cancel{x^3}&=(c_4-\frac{1}{2})\cancel{x^3}\Rightarrow 2=c_4-\frac{1}{2}\Rightarrow \shaded{c_4=\frac{5}{2}}\nonumber\\ \cancelto{1}{x^2}&=(3-4c_4+c_3)\cancel{x^2}\Rightarrow 1=3-4c_4+c_3\nonumber\\ -\cancelto{1}{x}&=(-6+11+4c_4-2c_3)\cancel{x}\Rightarrow -1=-6+11+4c_4-2c_3\nonumber\\ \end{align}\right\}\Rightarrow\nonumber $$

Given \(c_4\), we only need one equation to solve for \(c_3\)

$$ c_3 = 4c_4-2=10-2\Rightarrow \shaded{c_3=8} $$

Substitute the values of \(c_{1\ldots4}\) in \(\eqref{eq:example2a}\)

$$ \frac{f(x)}{x}=-\frac{\frac{1}{2}}{x}+\frac{11}{(x-2)^3}+\frac{8}{(x-2)^2}+\frac{\frac{5}{2}}{x-2} $$

Multiplying both sides by \(x\) gives the sum of partial fractions

$$ \shaded{f(x)=-\frac{1}{2}+11\frac{x}{(x-2)^3}+8\frac{x}{(x-2)^2}+\frac{5}{2}\frac{x}{x-2}} $$

Reference: MIT-cu

Euler’s formula

Proofs Euler’s formula using the MacLaurin series for sine and cosine. Introduces Euler’s identify and Cartesian and Polar coordinates.\(\)

Around 1740, the Swiss mathematician, physicist and engineer Leonhard Euler obtained the formula later named after him.

Euler’s Formula

Use the MacLaurin series for cosine and sine, which are known to converge for all real \(x\), and the MacLaurin series for \(\mathrm{e}^x\).

$$ \begin{align} \cos x &= \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}x^{2n}=1-\frac{x^2}{2!}+\frac{x^4}{4!}-\cdots \\ \sin x &= \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}x^{2n+1}=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots \\ \mathrm{e}^z &=\sum_{n=0}^{\infty}\frac{z^n}{n!}=1+z+\frac{z^2}{2!}+\frac{z^3}{3!}+\cdots \label{eq:ez} \end{align} $$

Substitute \(z=j\varphi\) in \(\eqref{eq:ez}\)

$$ \begin{align} \mathrm{e}^{j\varphi}&=\sum_{n=0}^{\infty}\frac{(j\varphi)^n}{n!}=1+j\varphi+\frac{(j\varphi)^2}{2!}+\frac{(j\varphi)^3}{3!}+\cdots \nonumber\\ &=1+j\varphi-\frac{\varphi^2}{2!}-j\frac{\varphi^3}{3!}+\frac{\varphi^4}{4!}+j\frac{\varphi^5}{5!}-\cdots \nonumber\\ &=\underbrace{\left(1-\frac{\varphi^2}{2!}+\frac{\varphi^4}{4!}+\cdots\right)}_{\cos\varphi} +j\underbrace{\left(\varphi-\frac{\varphi^3}{3!}+\frac{\varphi^5}{5!}-\cdots\right)}_{\sin\varphi} \end{align} $$

This leads us to Euler’s formula

$$ \shaded{ \mathrm{e}^{j\varphi}=\cos\varphi+j\sin\varphi } $$

Euler’s Identify

For the special case where \(\varphi=\pi\):

$$ \mathrm{e}^{j\pi} = \cos\pi+j\sin\pi = -1 $$

Rewritten as

$$ \shaded{ \mathrm{e}^{j\pi}+1 = 0 } $$

This combines many of the fundamental numbers with mathematical beauty

  • The number \(0\), the additive identify
  • The number \(1\), the multiplicative identity
  • The number \(\pi\), the ratio between a circle’s circumference and its diameter
  • The number \(j\), used to find the roots of polynomials defined as \(j=\sqrt{-1}\)
  • The number \(e\), from continuous compounding interest and from \(\frac{\mathrm{d}}{\mathrm{d}x}\mathrm{e}^x=\mathrm{e}^x\)

Cartesian and Polar coordinates

Euler’s formula traces out a unit circle in the complex plane as a function of \(\varphi\).  Here, \(\varphi\) is the angle that a line connecting the origin with a point on the unit circle makes with the positive real axis, measured in radians.

Relation between cartesian and polar coordinates (Euler)
Relation between cartesian and polar coordinates

A point in the complex plane can be represented by a complex number written in cartesian coordinates.  Euler’s formula lets you convert between cartesian and polar coordinates.  The polar form simplifies the mathematics when used in multiplication or powers of complex numbers. [wiki]

Any complex number \(z=x+jy\) can be written as

$$ \shaded{ z=x+jy=r(\cos\varphi+j\sin\varphi) = r\,\mathrm{e}^{j\varphi} } $$
where
$$ \begin{aligned} x&=\Re\{z\} & \mathrm{real\ part\ of\ }z\\ y&=\Im\{z\} & \mathrm{imaginary\ part\ of\ }z\\ r&=|z|=\sqrt{x^2+y^2} & \mathrm{magnitude\ of\ }z\\ \varphi&=\angle z=\mathrm{atan2}(y,x) & \mathrm{angle\ of\ }z \end{aligned} $$

Another notation method

$$ \shaded{r\,\mathrm{e}^{j\varphi} = \mathrm{e}^{\ln r}\mathrm{e}^{j\varphi} = \mathrm{e}^{\ln r+j\varphi}} $$

Relation to trigonometry

Euler’s formula connects analysis with trigonometry.  The connections most easy follow from adding or subtracting Euler’s formulas. [wiki]

$$ \left\{ \begin{aligned} \mathrm{e}^{j\varphi}&=\cos\varphi+j\sin\varphi \\ \mathrm{e}^{-j\varphi}&=\cos(-\varphi)+j\sin(-\varphi)=\cos\varphi-j\sin\varphi \end{aligned} \right. $$

Adding gives the \(\cos\varphi\)

$$ \left. \begin{aligned} \mathrm{e}^{j\varphi}&=\cos\varphi+j\sin\varphi \\ \mathrm{e}^{-j\varphi}&=\cos(-\varphi)+j\sin(-\varphi)=\cos\varphi-j\sin\varphi \end{aligned} \right\} \overset{add}{\Rightarrow} $$

Addition

$$ \begin{align} \mathrm{e}^{j\varphi}+\mathrm{e}^{-j\varphi} &= (\cos\varphi+\cancel{j\sin\varphi}) + (\cos\varphi-\cancel{j\sin\varphi}) \nonumber \\ &= 2\cos\varphi \end{align} $$

So

$$ \shaded{ \cos\varphi = \frac{\mathrm{e}^{j\varphi} + \mathrm{e}^{-j\varphi}}{2} } \label{eq:Eulers_sine} $$

Subtracting gives the \(\sin\varphi\)

$$ \left. \begin{align} \mathrm{e}^{j\varphi}&=\cos\varphi+j\sin\varphi \nonumber\\ \mathrm{e}^{-j\varphi}&=\cos(-\varphi)+j\sin(-\varphi)=\cos\varphi-j\sin\varphi\nonumber \end{align} \right\} \overset{subtract}{\Rightarrow} $$

Subtraction

$$ \begin{align} \mathrm{e}^{j\varphi}-\mathrm{e}^{-j\varphi} &= (\cancel{\cos\varphi}+j\sin\varphi) – (\cancel{\cos\varphi}-j\sin\varphi) \nonumber \\ &=2j\sin\varphi \end{align} $$

Thus

$$ \shaded{ \sin\varphi = \frac{\mathrm{e}^{j\varphi} – \mathrm{e}^{-j\varphi}}{2j} } \label{eq:Eulers_cosine} $$

This concludes “Euler’s formula and identify”.

Copyright © 1996-2022 Coert Vonk, All Rights Reserved