# Complex numbers and operations with them

Content
 DSPL-2.0 is free digital signal processing algorithms library Distributed under v3 LGPL v3 license GitHub project page.
Found a mistake? Select it with the mouse and press
Introduction

It is known that the domain of definition of some functions on the set of real numbers is limited. For example, the function is defined for , similarly we can recall that the function is defined for , and the function is defined for .

However, the limited domain of functions on the set of real numbers does not mean that , or are useless. The limited domain of functions on the set of real numbers only means that cannot be represented by a real number. Indeed, among real numbers one cannot find such a number whose square is equal to .

When solving quadratic equations, a situation often arises when the discriminant is negative. In this case, this means that the parabola does not cross the direct abscissa at any point. In other words, the squares of the quadratic equation do not exist among the real values and they must also be sought outside the real numbers.

The entire infinite set of real numbers can be represented as a single number line (see Figure 1), on which we can put aside rational and irrational real numbers. But there is no number on this line, so it must be sought outside the number line. Thus, we must expand the set of real numbers to the set in which the values , , or are no longer meaningless, but are the same ordinary numbers in this expanded set, like on the set of real numbers.

Complex plane and imaginary unit

A natural extension of a number line is a plane, which is called a complex plane. The number line of real numbers and its extension to the complex plane is shown in Figure 1. Any point on the complex plane defines one complex number. For example, Figure 1 shows the number .

Figure 1. Extending the set of real numbers to the set of complex numbers

The value of a real number uniquely determines its position on the number line, however, to determine the position on the plane, one number is not enough.

For «navigation», two straight lines are introduced along the complex plane and , two straight lines are introduced along the complex plane. Straight line is a numerical line called the real axis on which all real numbers lie. Straight line is called the imaginary axis; it is perpendicular to the real axis . The axes and divide the complex plane into quarters, as shown in the figure 1.

Any point on the complex plane is defined by two coordinates and along the axes and , respectively. In this case, the complex number itself can be written as , where is called the real part and sets the coordinate of the complex plane point on the real line , and is called the imaginary part; sets the coordinate of the complex plane point on the imaginary axis .

In order to separate one coordinate from another (real and imaginary parts) enter the number , which is called an imaginary unit. This is just the number that does not exist on the set of real numbers. It has a special property: . Then the complex number can not only move along the real line to the right and left, but also move along the complex plane because we added a term with an imaginary unit to it .

In the mathematical literature, the imaginary unit is usually denoted as , but in technology, the letter is used to define electric current, therefore, to avoid confusion, we will denote the imaginary unit by the letter .

If and , then the number is valid and is located on the real axis .

If and , then the number is purely imaginary and is located on the imaginary axis .

If and , then the number is located in one of the quarters of the complex plane.

The modulus and phase of the complex number

The representation of a complex number as is called the algebraic form of writing. If we restore the vector (see Figure 1)from the origin of the complex plane to the point , then we can calculate the length of this vector as

(1)
— non-negative real number characterizing the length of the vector; it is called the modulus of the complex number. In this case, the vector of the complex number is rotated relative to the real axis by some angle , which is called the phase. The phase of the complex number can be positive or negative, depending on which direction to calculate the angle relative to the axis . If the angle of rotation of the vector on the complex plane is calculated counterclockwise (as shown in Figure 1), then the phase will take positive values, and if it is done clockwise — then the values will be negative.

The relationship of the real and imaginary parts of the complex number with its amplitude and phase is represented by the following expression:

(2)
Then the complex number can be represented in trigonometric form:
(3)

The relation of the angle of rotation of the complex number vector with the real and imaginary parts of the complex number, represented in algebraic form:

(4)
then
(5)
where takes into account a quarter of the complex plane, in which the number is located :
(6)
The need for correction arises because the function is a periodic function with period rad. As a result, returns valid values only in the interval . Thus, the arctangent function does not distinguish quarter I from quarter III (in both cases the relation is positive), and does not distinguish quarter II from quarter IV (the relation is negative).

Figure 2 shows the values of the parameter , depending on which quarter of the complex plane the number is located.

Figure 2. The phase correction of the complex number depending on the location on the complex plane.

In Figure 2a the initial complex number is located in the first quarter of the complex plane and .

Then and the phase value of the complex number is equal to:

(7)

Consider the case when the complex number is located in the second quarter of the complex plane (Figure 2b), that is, and . In this case, and the angle will also be negative (red dotted line). Then, in order to get the correct value of the phase , it is necessary to introduce the correction rad:

(8)

Let the complex number be located in the third quarter of the complex plane (Figure 2c), that is, and . In this case, and the angle will be positive (red dotted line). Then, in order to get the correct phase value , it is necessary to introduce the correction rad:

(9)

If is located in the fourth quarter of the complex plane (Figure 2d), that is, and , then in this case, and the angle will be negative and equal to the phase of the complex number without corrections ( rad):

(10)

The function, which allows you to get the phase of the complex number taking into account a quarter of the complex plane, in which the complex number is located is called the arc tangent-2 function and is denoted by .

The arc tangent-2 function is present in all mathematical applications and can be used to calculate the correct rotation angle of the complex number's vector.

The exponential form of a complex number. Euler's formula

We have already considered the algebraic and trigonometric forms of writing a complex number. In addition to the algebraic and trigonometric forms, there is also an exponential form of a complex number:

(11)
associated with the trigonometric form of the Euler formula:
(12)

The relation (12) is easy to prove if we decompose the exponential into a Taylor series:

(13)

Let's put the series (13) in the form of a sum of even and odd members of a sequence:

(14)

Let us consider in more detail the imaginary unit in even and odd degrees.

From the definition of the imaginary unit, we can conclude that , then , in turn, .

Thus, we can conclude that .

In a similar way, we construct the relation for odd degrees: , then , in turn, , and we can finally write: . Then (14) can be represented as:

(15)

In the expression (15), the first sum over even powers gives a Taylor expansion of the function , and the second sum over odd powers gives a Taylor expansion of the function . Thus, we have proven the validity of the Euler formula (12).

It should be noted that the Euler formula is one of the most important in the theory of functions of a complex variable. Thus, for example, using the Euler formula, we can connect mathematical constants and using the imaginary unit :

(16)

Operations on complex numbers. Complex conjugate numbers

In this section, we briefly consider operations on complex numbers. The sum of two complex numbers and is the complex number

(17)

In addition, the real and imaginary parts of the complex number also add up. On the complex plane, the addition operation can be realized as the addition of vectors of complex numbers according to the parallelogram rule (Figure 3a).

Figure 3. Operations on complex numbers

The difference of two complex numbers and is a complex number

(18)

When subtracting, the real and imaginary parts of the complex number are also subtracted. On the complex plane, the subtraction operation can be implemented as the subtraction of vectors according to the parallelogram rule (Figure 3b). At the first step, the vector (indicated by a dotted line in Figure 3b) is formed from the vector , after which the vector is added to the vector according to the parallelogram rule.

n order to obtain a formula for multiplying complex numbers, it is necessary to multiply two complex numbers according to the rule of multiplying polynomials:

(19)

Multiplication of complex numbers is easier to do if the numbers are presented in exponential form:

(20)

When multiplied in exponential form, the moduli of complex numbers multiply, and the phases add up. The operation of the product of complex numbers is shown in Figure 3c.

Let us introduce the concept of a complex conjugate. The number is is a complex conjugate number of .

Complex conjugate numbers differ in sign in front of the imaginary part.

Graphically, complex conjugate numbers are shown in Figure 3d.

In this case, it can be seen that the moduli of complex conjugate numbers are equal to , and the phases have opposite signs.

The product of complex conjugate numbers

(21)
represents a real number equal to the square of the modulus of these numbers.

Of the elementary operations, we only need to consider the division of complex numbers. Consider the result of dividing complex numbers in exponential form:

(22)

Thus, when dividing complex numbers, the modulus of the quotient is equal to the quotient of the moduli of the original numbers, and the phase is equal to the phase difference of the original numbers.

In this case, it is necessary to require that be non-zero, otherwise, we will have a division by zero when calculating the modulus of the quotient.

Now consider the division of complex numbers in algebraic form:

(23)

We multiply both the numerator and the denominator by the number complex conjugate to the denominator:

(24)

Conclusions

In this article, the concept of a complex number is introduced, and its main properties are considered. The concept of an imaginary unit is introduced.

The complex plane and the representation of complex numbers in algebraic, trigonometric and exponential forms are considered in detail. The concepts of module and phase of a complex number are introduced.

The basic arithmetic operations on complex numbers are considered.

It is shown how to perform operations of addition, subtraction in algebraic form, the concept of complex conjugate numbers is introduced, as well as operations of multiplication and division in exponential and algebraic forms.

Page update: 30.08.2020 (13:06:45)