A number consisting of two parts, called

real and

imaginary. Complex numbers are written in the form

*a + bi*, where

*a* is the real part,

*b* is the size of the imaginary part, and

*i* is the square root of -1. If the size of the imaginary part is 0 (i.e. b = 0), the number is equal to a real number.

Unlike real numbers, complex numbers can produce negative numbers when squared; because of this, all polynomials have complex roots even though some of them may lack real roots. Another use of complex numbers is to represent a vector in two-dimensional space. In this case, the x-axis is the real part of the number, and the y-axis is the imaginary part.

Arithmetic on complex numbers obeys the same laws of algebra real numbers do.

(a + bi) + (c + di) = (a + c) + (b + d)i
(a + bi) - (c + di) = (a - c) + (b - d)i
(a + bi) * (c + di) = ac + adi + bci + bdi^{2}
= (ac - bd) + (ad + bc)i