A complex number is any number that can be written in the form a + bi where a and b are real numbers. a is called the real part, b is called the imaginary part, and i is called the imaginary unit.
If x2 = -1, then x = √-1
Because the square of a real number is never negative, there is no real number x such that x2 = -1. Mathematicians wanted this equation to have a solution.
Therefore, they defined i to be the solution of the equation x2 = -1 and called i imaginary number or imaginary unit. By doing this, they invented a new system of numbers called complex numbers.
What they basically did is this.
Now we use complex numbers in electromagnetism, signal processing, and many others!
Consider again the complex number a + bi. If a is not equal to 0 and b = 0, the complex number a + 0i = a and a is a real number. Therefore, all real numbers are also complex numbers.
If b is not equal to zero and a is any real number, the complex number a + bi is called imaginary number.
In other words, if the imaginary unit i is in it, we can just call it imaginary number.
Here is a diagram that shows the difference between a complex number, a real number, an imaginary number, and a pure imaginary number.