# What are complex numbers?

As you may know, you can’t add or subtract two different variables to get one. For example, 4a + 3a = 7a but 4a + 3b is still equal to 4a + 3b. In the case of the sum or difference of an imaginary number and a real number, you get a complex number:

$4i+2i=6i$

but

$4+2i=4+2i$

and, more in general, a complex number is written as follows:

$a+bi$

where a and b are real numbers.

Let’s now introduce the complex plane:

As you can see, instead of “x” we have Re (real) and instead of “y” Im (imaginary). Also, the point a+bi has coordinates (a; b), and since b is on the Im axis is an imaginary number, bi. This is why a+bi is between the two axis: it’s got a real part, a, and an imaginary part, b.

Re and Im functions

What is the real part of 4-3i? And what’s the imaginary part? Simply put, the former is the number without the imaginary unit i, the latter is the number that has the i next to it. The function which gives as output the real part of a complex number is Re(), whereas for the imaginary part it is Im().

$\text{Re}\left&space;\{&space;a+bi&space;\right&space;\}=a$ $\text{Im}\left&space;\{&space;a+bi&space;\right&space;\}=b$

You can use ( ) instead of { }, but I prefer the latter. It also looks cooler, doesn’t it?

Examples:

$\text{Re}\left&space;\{&space;12+9i&space;\right&space;\}=12$ $\text{Im}\left&space;\{&space;12+9i&space;\right&space;\}=9i$ $\text{Re}\left&space;\{&space;\pi-\varphi&space;i&space;\right&space;\}=\pi$ $\text{Im}\left&space;\{&space;\pi-\varphi&space;i&space;\right&space;\}=-\varphi$ $\text{Re}\left&space;\{&space;\pi&space;\right&space;\}=\pi$ $\text{Im}\left&space;\{&space;\pi&space;\right&space;\}=0$ $\text{Re}\left&space;\{&space;i&space;\right&space;\}=0$ $\text{Im}\left&space;\{&space;i&space;\right&space;\}=1$ $\text{Re}\left&space;\{&space;3+5i-2\pi&space;i&space;\right&space;\}=\text{Re}\left&space;\{&space;3+(5-2\pi)i&space;\right&space;\}=3$ $\text{Im}\left&space;\{&space;3+5i-2\pi&space;i&space;\right&space;\}=\text{Im}\left&space;\{&space;3+(5-2\pi)i&space;\right&space;\}=5-2\pi$

$\text{Re}\left&space;\{&space;\varphi+\text{Im}\left&space;\{&space;7i\,&space;\text{Im}\left&space;\{&space;\pi&space;i\,&space;\text{Re}\left&space;\{&space;12-\text{Im}\left&space;\{&space;3+4i&space;\right&space;\}&space;\right&space;\}&space;\right&space;\}&space;\right&space;\}&space;\right&space;\}$