Complex number
In mathematics, the complex numbers are an extension of the real numbers obtained by adjoining an imaginary unit, denoted i, which satisfies:
Every complex number can be written in the form a + bi, where a and b are real numbers called the real part and  the imaginary part of the complex number, respectively.
Complex numbers are a field, and thus have addition, subtraction, multiplication, and division operations.  These operations extend the corresponding operations on real numbers, although with a number of additional elegant and useful properties, e.g., negative real numbers can be obtained by squaring complex (imaginary) numbers.
Complex numbers were first discovered by the Italian mathematician Girolamo Cardano, who called them "fictitious", during his attempts to find solutions to cubic equations . The solution of a general cubic equation may require intermediate calculations containing the square roots of negative numbers, even when the final solutions are real numbers, a situation known as casus irreducibilis. This ultimately led to the fundamental theorem of algebra, which shows that with complex numbers, it is always possible to find solutions to polynomial equations of degree one or higher.
The rules for addition, subtraction, multiplication, and division of complex numbers were first developed by the Italian mathematician Rafael Bombelli.  A more abstract formalism for the complex numbers was further developed by the Irish mathematician William Rowan Hamilton, who extended this abstraction to the theory of quaternions.
Complex numbers are used in many different fields including applications in engineering, electromagnetism, quantum physics, applied mathematics, and chaos theory.  When the underlying field of numbers for a mathematical construct is the field of complex numbers, the name usually reflects that fact.  Examples are complex analysis, complex matrix, complex polynomial and complex Lie algebra.

# Definitions

## Notation
The set of all complex numbers is usually denoted by C, or in blackboard bold by \mathbb{C}.
Although other notations can be used, complex numbers are very often written in the form
where a and b are real numbers, and i is the imaginary unit, which has the property i 2 = 1. The real number a is called the real part of the complex number, and the real number b is the imaginary part.
For example, 3 + 2i is a complex number, with real part 3 and imaginary part 2.  If z = a + ib, the real part a is denoted Re(z) or R(z), and the imaginary part b is denoted Im(z) or I(z).
The real numbers, R, may be regarded as a subset of C by considering every real number a complex number with an imaginary part of zero; that is, the real number a is identified with the complex number a + 0i. Complex numbers with a real part of zero are called imaginary numbers; instead of writing 0 + bi, that imaginary number is usually denoted as just bi. If b equals 1, instead of using 0 + 1i or 1i, the number is denoted as i.
In some disciplines (in particular, electrical engineering, where i is a symbol for current), the imaginary unit i is instead written as j,  so complex numbers are sometimes written as a + bj.

## Equality
Two complex numbers are equal if and only if their real parts are equal and their imaginary parts are equal. In other words, if the two complex numbers are written as a + bi and c + di with a, b, c, and d real, then they are equal if and only if a = c and b = d.

## Operations
Complex numbers are added, subtracted, multiplied, and divided by formally applying the associative, commutative and distributive laws of algebra, together with the equation i 2 = 1:
- Addition: \,(a + bi) + (c + di) = (a + c) + (b + d)i
- Subtraction: \,(a + bi) - (c + di) = (a - c) + (b - d)i
- Multiplication: \,(a + bi) (c + di) = ac + bci + adi + bd i^2 = (ac - bd) + (bc + ad)i
- Division: \,\frac{(a + bi)}{(c + di)} = \left({ac + bd \over c^2 + d^2}\right) + \left( {bc - ad \over c^2 + d^2} \right)i\,,
where c and d are not both zero.
It is also possible to represent complex numbers as  ordered pairs of real numbers, so that the complex number a + ib corresponds to (a, b). 
In this representation, the algebraic operations have the following formulas:
Since the complex number a + bi is uniquely specified by the ordered pair (a, b), the complex numbers are in one-to-one correspondence with points on a plane. This complex plane is described below.

# The field of complex numbers
A field is an algebraic structure with addition, subtraction, multiplication, and division operations that satisfy certain algebraic laws. The complex numbers are a field, known as the complex number field, denoted by C.  In particular, this means that the complex numbers possess:
- An additive identity ("zero"), 0 + 0i.
- A multiplicative identity ("one"), 1 + 0i.
- An additive inverse of every complex number. The additive inverse of a + bi is a  bi.
- A multiplicative inverse (reciprocal) of every nonzero complex number. The multiplicative inverse of a + bi is {a\over a^2+b^2}+ \left( {-b\over a^2+b^2}\right)i.
Other fields include the real numbers and the rational numbers. When each real number a is identified with the complex number a + 0i, the field of real numbers R becomes a subfield of C.
The complex numbers C can also be characterized as the topological closure of the algebraic numbers or as the algebraic closure of R, both of which are described below.

## The complex plane
A complex number z can be viewed as a point or a position vector in a two-dimensional Cartesian coordinate system called the complex plane or Argand diagram (see Pedoe 1988 and Solomentsev 2001) named after Jean-Robert Argand. The point and hence the complex number z can be specified by Cartesian (rectangular) coordinates. The Cartesian coordinates of the complex number are the real part x = Re(z) and the imaginary part y = Im(z). The representation of a complex number by its Cartesian coordinates is called the Cartesian form or rectangular form or algebraic form of that complex number.

## Absolute value, conjugation and distance
The absolute value (or modulus or magnitude) of a complex number z=re^{i\phi} is defined as |z|=r. Algebraically, if z=x+yi, then |z|=\sqrt{x^2+y^2}.
The absolute value has three important properties:
for all complex numbers z and w.   These imply that |1|=1 and |z/w|=|z|/|w|.  By defining the distance function d(z,w)=|z-w|, we turn the set of complex numbers into a metric space and we can therefore talk about limits and continuity.
The complex conjugate of the complex number z=x+yi is defined to be x-yi, written as \bar{z} or z^*\,. As seen in the figure, \bar{z} is the "reflection" of z about the real axis, and so both z+\bar{z} and z\cdot\bar{z} are real numbers. Many identities relate complex numbers and their conjugates:
The latter formula is the method of choice to compute the inverse of a complex number if it is given in rectangular coordinates.
That conjugation commutes with all the algebraic operations (and many functions; e.g. \sin\bar z=\overline{\sin z}) is rooted in the ambiguity in choice of i (1 has two square roots). It is important to note, however, that the function f(z) = \bar{z} is not complex-differentiable (see holomorphic function).

## Geometric interpretation of the operations on complex numbers
The operations of addition, multiplication, and complex conjugation in the complex plane admit natural geometrical interpretations.
- The sum of two points A and B of the complex plane is the point X = A + B such that the triangles with vertices 0, A, B, and X, B, A, are congruent.
- The product of two points A and B is the point X = AB such that the triangles with vertices 0, 1, A, and 0, B, X, are similar.
- The complex conjugate of a point A is the point X = A- such that the triangles with vertices 0, 1, A, and 0, 1, X, are mirror images of each other.
These geometric interpretations allow problems of geometry to be translated into algebra.  And, conversely, geometric problems can be examined algebraically.  For example, the problem of the geometric construction of the 17-gon is thus translated into the analysis of the algebraic equation x17 = 1.

# Polar form
Alternatively to the cartesian representation z = x+iy, the complex number z can be specified by polar coordinates. The polar coordinates are r =  |z|  0, called the absolute value or modulus, and  = arg(z), called the argument or the angle of z. For r = 0 any value of  describes the same number. To get a unique representation, a conventional choice is to set arg(0) = 0. For r > 0 the argument  is unique modulo 2; that is, if any two values of the complex argument differ by an exact integer multiple of 2, they are considered equivalent. To get a unique representation, a conventional choice is to limit  to the interval (-,], i.e.  <   . The representation of a complex number by its polar coordinates is called the polar form of the complex number.

## Conversion from the polar form to the Cartesian form

## Conversion from the Cartesian form to the polar form
(See arg function and atan2.)
The resulting value for  is in the range (, +]; it is negative for negative values of y. If instead non-negative values in the range [0, 2) are desired, add 2 to negative results.

## Notation of the polar form
The notation of the polar form as
is called trigonometric form. The notation cis  is sometimes used as an abbreviation for cos  + i sin .
Using Euler's formula it can also be written as
which is called exponential form.

## Multiplication, division, exponentiation, and root extraction in the polar form
Multiplication, division, exponentiation, and root extraction are much easier in the polar form than in the Cartesian form.
Using sum and difference identities it follows that
= r_1\,r_2\,e^{i(\varphi_1 + \varphi_2)} \,
and that
Exponentiation with integer exponents; according to De Moivre's formula,
from which it follows that
Exponentiation with arbitrary complex exponents is discussed in the article on exponentiation.
The addition of two complex numbers is just the vector addition of two vectors, and multiplication by a fixed complex number can be seen as a simultaneous rotation and stretching.
Multiplication by i corresponds to a counter-clockwise rotation by 90 degrees (/2 radians). The geometric content of the equation i 2 = 1 is that a sequence of two 90 degree rotations results in a 180 degree ( radians) rotation. Even the fact (1)  (1) = +1 from arithmetic  can be understood geometrically as the combination of two 180 degree turns.
If c is a complex number and n a positive integer, then any complex number z satisfying zn = c is called an n-th root of c. If c is nonzero, there are exactly n distinct n-th roots of c, which can be found as follows. Write c=re^{i\varphi} with real numbers r > 0 and , then the set of n-th roots of c is
where \sqrt{r} represents the usual (positive) n-th root of the positive real number r. If c = 0, then the only n-th root of c is 0 itself, which as n-th root of 0 is considered to have multiplicity n.

# Some properties

## Matrix representation of complex numbers
While usually not useful, alternative representations of the complex field can give some insight into its nature. One particularly elegant representation interprets each complex number as a 22 matrix with real entries which stretches and rotates the points of the plane. Every such matrix has the form
\begin{bmatrix}
\end{bmatrix}
where a and b are real numbers. The sum and product of two such matrices is again of this form, and the product operation on matrices of this form is commutative. Every non-zero matrix of this form is invertible, and its inverse is again of this form. Therefore, the matrices of this form are a field, isomorphic to the field of complex numbers. Every such matrix can be written as
\begin{bmatrix}
\end{bmatrix}
a \begin{bmatrix}
\end{bmatrix}
b \begin{bmatrix}
\end{bmatrix}
which suggests that we should identify the real number 1 with the identity matrix
\begin{bmatrix}
\end{bmatrix},
and the imaginary unit i with
\begin{bmatrix}
\end{bmatrix},
a counter-clockwise rotation by 90 degrees. Note that the square of this latter matrix is indeed equal to the 22 matrix that represents 1.
The square of the absolute value of a complex number expressed as a matrix is equal to the determinant of that matrix.
\begin{vmatrix}
\end{vmatrix}
= (a^2) - ((-b)(b)) = a^2 + b^2.
If the matrix is viewed as a transformation of the plane, then the transformation rotates points through an angle equal to the argument of the complex number and scales by a factor equal to the complex number's absolute value. The conjugate of the complex number z corresponds to the transformation which rotates through the same angle as z but in the opposite direction, and scales in the same manner as z; this can be represented by the transpose of the matrix corresponding to z.
If the matrix elements are themselves complex numbers, the resulting algebra is that of the quaternions. In other words, this matrix representation is one way of expressing the Cayley-Dickson construction of algebras.
It should also be noted that the two eigenvalues of the 2x2 matrix representing a complex number are the complex number itself and its conjugate.

## Real vector space
C is a two-dimensional real vector space.
Unlike the reals, the set of complex numbers cannot be totally ordered in any way that is compatible with its arithmetic operations: C cannot be turned into an ordered field. More generally, no field containing a square root of 1 can be ordered.
R-linear maps C  C have the general form
with complex coefficients a and b. Only the first term is C-linear, and only the first term is holomorphic; the second term is real-differentiable, but does not satisfy the Cauchy-Riemann equations.
The function
corresponds to rotations combined with scaling, while the function
corresponds to reflections combined with scaling.

## Solutions of polynomial equations
A root of the polynomial p is a complex number z such that p(z) = 0. A surprising result in complex analysis is that all polynomials of
degree n with real or complex coefficients have exactly n complex roots (counting multiple roots according to their multiplicity). This is known as the fundamental theorem of algebra, and it shows that the complex numbers are an algebraically closed field.
Indeed, the complex number field C is the algebraic closure of the real number field, and Cauchy constructed the field of complex numbers in this way. It can also be characterized as the quotient ring of the polynomial ring R over the ideal generated by the polynomial X2 + 1:
This is indeed a field because X2 + 1 is irreducible over the real numbers, hence generating a maximal ideal, in R. The image of X in this quotient ring is the imaginary unit i.

## Algebraic characterization
The field C is (up to field isomorphism) characterized by the following three facts:
- its characteristic is 0
- its transcendence degree over the prime field is the cardinality of the continuum
- it is algebraically closed
Consequently, C contains many proper subfields which are isomorphic to C.  Another consequence of this characterization is that the Galois group of C over the rational numbers is enormous, with cardinality equal to that of the power set of the continuum.

## Characterization as a topological field
As noted above, the algebraic characterization of C fails to capture some of its most important properties. These properties, which underpin the foundations of complex analysis, arise from the topology of C. The following properties characterize C as a topological field:
- C is a field.
- C contains a subset P of nonzero elements satisfying:
P is closed under addition, multiplication and taking inverses.
If x and y are distinct elements of P, then either x-y or y-x is in P
If S is any nonempty subset of P, then S+P=x+P for some x in C.
- P is closed under addition, multiplication and taking inverses.
- If x and y are distinct elements of P, then either x-y or y-x is in P
- If S is any nonempty subset of P, then S+P=x+P for some x in C.
- C has a nontrivial involutive automorphism xx*, fixing P and such that xx- is in P for any nonzero x in C.
Given these properties, one can then define a topology on C by taking the sets
- B(x,p) = \{y | p - (y-x)(y-x)^*\in P\}
as a base, where x ranges over C, and p ranges over P.
To see that these properties characterize C as a topological field, one notes that P  {0}  -P is an ordered Dedekind-complete field and thus can be identified with the real numbers R by a unique field isomorphism. The last property is easily seen to imply that the Galois group over the real numbers is of order two, completing the characterization.
Pontryagin has shown that the only connected locally compact topological fields are R and C.  This gives another characterization of C as a topological field, since C can be distinguished from R by noting that the nonzero complex numbers are connected, while the nonzero real numbers are not.

# Complex analysis
The study of functions of a complex variable is known as  complex analysis and has  enormous practical use in  applied mathematics as well as in other branches of mathematics. Often, the most natural proofs for statements in real analysis or even number theory employ techniques from complex analysis (see prime number theorem for an example). Unlike real functions which are commonly represented as two dimensional graphs, complex functions have four dimensional graphs
and may usefully be illustrated by color coding a three dimensional graph to suggest four dimensions, or by animating the complex function's dynamic transformation of the complex plane.

# Applications
The words "real" and "imaginary" were meaningful when complex numbers were used mainly as an aid in manipulating "real" numbers, with only the "real" part directly describing the world.  Later applications, and especially the discovery of quantum mechanics, showed that nature has no preference for "real" numbers and its most real descriptions often require complex numbers, the "imaginary" part being just as physical as the "real" part.

## Control theory
In control theory, systems are often transformed from the time domain to the frequency domain using the Laplace transform.  The system's poles and zeros are then analyzed in the complex plane.  The root locus, Nyquist plot, and Nichols plot techniques all make use of the complex plane.
In the root locus method, it is especially important whether the poles and zeros are in the left or right half planes, i.e. have real part greater than or less than zero.  If a system has poles that are
- in the right half plane, it will be unstable,
- all in the left half plane, it will be stable,
- on the imaginary axis, it will have marginal stability.
If a system has zeros in the right half plane, it is a nonminimum phase system.

## Signal analysis
Complex numbers are used in signal analysis and other fields for a convenient description for periodically varying signals. For given real functions representing actual physical quantities, often in terms of sines and cosines, corresponding complex functions are considered of which the real parts are the original quantities. For a sine wave of a given frequency, the absolute value |z| of the corresponding z is the amplitude and the argument arg(z) the phase.
If Fourier analysis is employed to write a given real-valued signal as a sum of periodic functions, these periodic functions are often written as complex valued functions of the form
where  represents the angular frequency and the complex number z encodes the phase and amplitude as explained above.
In electrical engineering, the Fourier transform is used to analyze varying voltages and currents. The treatment of resistors, capacitors, and inductors can then be unified by introducing imaginary, frequency-dependent resistances for the latter two and combining all three in a single complex number called the impedance. (Electrical engineers and some physicists use the letter j for the imaginary unit since i is typically reserved for varying currents and may come into conflict with i.) This approach is called phasor calculus. This use is also extended into digital signal processing and digital image processing, which utilize digital versions of Fourier analysis (and Wavelet analysis) to transmit, compress, restore, and otherwise process digital audio signals, still images, and video signals.

## Improper integrals
In applied fields, complex numbers are often used to compute certain real-valued improper integrals, by means of complex-valued functions. Several methods exist to do this; see methods of contour integration.

## Quantum mechanics
The complex number field is relevant in the mathematical formulation of quantum mechanics, where complex Hilbert spaces provide the context for one such formulation that is convenient and perhaps most standard. The original foundation formulas of quantum mechanics  the Schrodinger equation and  Heisenberg's matrix mechanics  make use of complex numbers.

## Relativity
In special and general relativity, some formulas for the metric on spacetime become simpler if one takes the time variable to be imaginary. (This is no longer standard in classical relativity, but is used in an essential way in quantum field theory.) Complex numbers are essential to spinors, which are a generalization of the tensors used in relativity.

## Applied mathematics
In differential equations, it is common to
first find all complex roots r of the characteristic equation of a 
linear differential equation and then attempt to solve the system
in terms of base functions of the form f(t) = ert.

## Fluid dynamics
In fluid dynamics, complex functions are used to describe potential flow in two dimensions.

## Fractals
Certain fractals are plotted in the complex plane, e.g. the Mandelbrot set and the Julia set.

# History
The earliest fleeting reference to square roots of negative numbers perhaps occurred in the work of the Greek mathematician and inventor Heron of Alexandria in the 1st century AD, when he considered the volume of an impossible frustum of a pyramid, though negative numbers were not conceived in the Hellenistic world.
Complex numbers became more prominent in the 16th century, when closed formulas for the roots of cubic and quartic polynomials were discovered by Italian mathematicians (see Niccolo Fontana Tartaglia, Gerolamo Cardano). It was soon realized that these formulas, even if one was only interested in real solutions, sometimes required the manipulation of square roots of negative numbers. For example, Tartaglia's cubic formula gives the following solution to the equation x3  x = 0:
At first glance this looks like nonsense. However formal calculations with complex numbers show that the equation z3 = i has solutions i, {\scriptstyle\frac{\sqrt{3}}{2}}+{\scriptstyle\frac{1}{2}}i and  {\scriptstyle\frac{-\sqrt{3}}{2}}+{\scriptstyle\frac{1}{2}}i. Substituting these in turn for {\scriptstyle\sqrt{-1}^{1/3}} in Tartaglia's cubic formula and simplifying, one gets 0, 1 and 1 as the solutions of x3  x = 0.
This was doubly unsettling since not even negative numbers were considered to be on firm ground at the time. The term "imaginary" for these quantities was coined by Rene Descartes in 1637 and was meant to be derogatory (see imaginary number for a discussion of the "reality" of complex numbers). A further source of confusion was that the equation \sqrt{-1}^2=\sqrt{-1}\sqrt{-1}=-1 seemed to be capriciously inconsistent with the algebraic identity \sqrt{a}\sqrt{b}=\sqrt{ab}, which is valid for positive real numbers a and b, and which was also used in complex number calculations with one of a, b positive and the other negative. The incorrect use of this identity (and the related identity \scriptstyle 1/\sqrt{a}=\sqrt{1/a}) in the case when both a and b are negative even bedeviled Euler. This difficulty eventually led to the convention of using the special symbol i in place of \sqrt{-1} to guard against this mistake.
The 18th century saw the labors of Abraham de Moivre and Leonhard Euler. To de Moivre is due (1730) the well-known formula which bears his name, de Moivre's formula:
and to Euler (1748) Euler's formula of complex analysis:
The existence of complex numbers was not completely accepted until the geometrical interpretation (see below) had been described by Caspar Wessel in 1799; it was rediscovered several years later and popularized by Carl Friedrich Gauss, and as a result the theory of complex numbers received a notable expansion. The idea of the graphic representation of complex numbers had appeared, however, as early as 1685, in Wallis's De Algebra tractatus.
Wessel's memoir appeared in the Proceedings of the Copenhagen Academy for 1799, and is exceedingly clear and complete, even in comparison with modern works. He also considers the sphere, and gives a quaternion theory from which he develops a complete spherical trigonometry. In 1804 the Abbe Buee independently came upon the same idea which Wallis had suggested, that \pm\sqrt{-1} should represent a unit line, and its negative, perpendicular to the real axis. Buee's paper was not published until 1806, in which year Jean-Robert Argand also issued a pamphlet on the same subject. It is to Argand's essay that the scientific foundation for the graphic representation of complex numbers is now generally referred. Nevertheless, in 1831 Gauss found the theory quite unknown, and in 1832 published his chief memoir on the subject, thus bringing it prominently before the mathematical world. Mention should also be made of an excellent little treatise by Mourey (1828), in which the foundations for the theory of directional numbers are scientifically laid. The general acceptance of the theory is not a little due to the labors of Augustin Louis Cauchy and Niels Henrik Abel, and especially the latter, who was the first to boldly use complex numbers with a success that is well known.
The common terms used in the theory are chiefly due to the founders. Argand called \cos \phi + i\sin \phi the direction factor, and r = \sqrt{a^2+b^2} the modulus; Cauchy (1828) called \cos \phi + i\sin \phi the reduced form (l'expression reduite); Gauss used i for \sqrt{-1}, introduced the term complex number for a+bi, and called a^2+b^2 the norm.
The expression direction coefficient, often used for \cos \phi + i
\sin \phi, is due to Hankel (1867), and absolute value, for modulus, is due to Weierstrass.
Following Cauchy and Gauss have come a number of contributors of high rank, of whom the following may be especially mentioned: Kummer (1844), Leopold Kronecker (1845), Scheffler (1845, 1851, 1880), Bellavitis (1835, 1852), Peacock (1845), and De Morgan (1849). Mobius must also be mentioned for his numerous memoirs on the geometric applications of complex numbers, and Dirichlet for the expansion of the theory to include primes, congruences, reciprocity, etc., as in the case of real numbers.
A complex ring or field is a set of complex numbers which is closed under addition, subtraction, and multiplication. Gauss studied complex numbers of the form a + bi, where a and b are integral, or rational (and  i is one of the two roots of x^2 + 1 = 0). His student, Ferdinand Eisenstein, studied the type a + b\omega, where \omega is  a complex root of x^3 - 1 = 0. Other such classes (called cyclotomic fields) of complex numbers are derived from the roots of unity x^k - 1 = 0 for higher values of k. This generalization is largely due to Kummer, who also invented  ideal numbers, which were expressed as geometrical entities by Felix Klein in 1893. The general theory of fields was created by Evariste Galois, who studied the fields generated by the roots of any polynomial equation
The late writers (from 1884) on the general theory include Weierstrass, Schwarz, Richard Dedekind, Otto Holder, Bonaventure Berloty, Henri Poincare, Eduard Study, and Alexander MacFarlane.