

# Real and imaginary parts

A complex number is a number that can be expressed in the form $a + bi$, where $a$ and $b$ are real numbers and $i$ is the imaginary unit, defined as $i^2 = -1$. The real part of a complex number, $a$, is the coefficient of the real variable, while the imaginary part, $b$, is the coefficient of the imaginary variable.

Consider the complex number $z = 3 + 4i$. The real part of $z$ is $3$, and the imaginary part is $4$.

In general, the real and imaginary parts of a complex number can be extracted by the following formulas:

$$\text{Re}(z) = \frac{z + \bar{z}}{2}$$
$$\text{Im}(z) = \frac{z - \bar{z}}{2i}$$

where $\bar{z}$ is the complex conjugate of $z$.

## Exercise
Find the real and imaginary parts of the complex number $z = 2 - 5i$.

Complex numbers can be represented in various forms, such as polar form and exponential form. These forms provide alternative ways to visualize and manipulate complex numbers.

# Operations with complex numbers

Complex numbers support various arithmetic operations, including addition, subtraction, multiplication, and division. These operations follow the same rules as for real numbers, with some modifications to account for the presence of the imaginary unit.

Let $z = 3 + 4i$ and $w = 1 - 2i$. The sum of $z$ and $w$ is $(3 + 4i) + (1 - 2i) = 4 + 2i$.

The product of $z$ and $w$ is $(3 + 4i)(1 - 2i) = -7 + 10i$.

## Exercise
Find the sum and product of the complex numbers $z = 2 + 3i$ and $w = 1 - i$.

# Visualizing complex numbers

Complex numbers can be visualized on a two-dimensional plane called the Argand diagram. The real axis represents the real part of the complex number, while the imaginary axis represents the imaginary part.

The complex number $z = 3 + 4i$ can be visualized as a point in the Argand diagram, with the real part $3$ on the horizontal axis and the imaginary part $4$ on the vertical axis.

Complex numbers can also be represented as vectors in the Argand diagram. The magnitude of a complex number represents its distance from the origin, and the angle represents its argument.

## Exercise
Visualize the complex number $z = 2 + 3i$ as a point and as a vector in the Argand diagram.

# Cyclic properties of complex numbers

Complex numbers have cyclic properties that are not present in real numbers. One such property is the periodicity of the exponential function.

The exponential function $e^z$ is periodic with period $2\pi i$. This means that for any integer $n$,

$$e^{z + 2\pi i n} = e^z$$

Another cyclic property of complex numbers is the periodicity of the sine and cosine functions.

## Exercise
Find the period of the sine and cosine functions.

# Introduction to modular arithmetic

Modular arithmetic is a system of arithmetic where numbers are considered as elements of a group formed by the remainder classes of a given modulus. This system is used in number theory and has applications in cryptography and coding theory.

Consider the modulus $m = 7$. The remainder classes are $0, 1, 2, 3, 4, 5, 6$.

Modular arithmetic is defined by the following operations: addition, subtraction, multiplication, and division. These operations are performed within the remainder classes.

## Exercise
Find the remainder classes of $m = 10$.

# Congruence and modular equations

Congruence is a relation between two integers that is preserved under the operation of addition or subtraction. In modular arithmetic, two integers are congruent modulo $m$ if their difference is a multiple of $m$.

The integers $12$ and $25$ are congruent modulo $5$ because $25 - 12 = 13$ is a multiple of $5$.

A modular equation is an equation that involves modular arithmetic. Modular equations can be solved by using the properties of congruence.

## Exercise
Solve the modular equation $x \equiv 3 \pmod{7}$.

# Applications of modular arithmetic

Modular arithmetic has various applications in mathematics and computer science. These include the study of cryptography, coding theory, and the theory of finite groups.

Modular arithmetic is used in the RSA cryptosystem, which is widely used for secure data transmission.

Modular arithmetic is also used in the analysis of algorithms and the design of efficient algorithms.

## Exercise
Discuss the applications of modular arithmetic in computer science.

# Number theory and complex numbers

Number theory is the study of integers, their properties, and the relationships between them. Complex numbers can be used to solve number theory problems and to explore the properties of integers.

The Fibonacci sequence is a series of integers where each number is the sum of the two previous ones. The Fibonacci sequence can be represented as a power series of complex numbers.

The Riemann zeta function is a function that extends the concept of the prime number theorem to all complex numbers. The behavior of the Riemann zeta function near the line $Re(s) = 1$ has connections to the distribution of prime numbers.

## Exercise
Discuss the connection between number theory and complex numbers.

# Quadratic equations with complex roots

Quadratic equations are equations of the form $ax^2 + bx + c = 0$, where $a \neq 0$. These equations can have complex roots if the discriminant $b^2 - 4ac < 0$.

The quadratic equation $x^2 - 5x + 6 = 0$ has complex roots $2 \pm 3i$.

The solutions of quadratic equations with complex roots can be used to solve various problems in physics, engineering, and other fields.

## Exercise
Find the roots of the quadratic equation $x^2 - 7x + 12 = 0$.

The quadratic equation with complex roots can be used to derive the quadratic formula for finding the roots of a general quadratic equation.

## Exercise
Derive the quadratic formula for finding the roots of a general quadratic equation.