Complex numbers and functions

Complex numbers is a kind of two-dimensional vectors whose components are the so-called real part and imaginary part. The real part usually corresponds to physical quantities while the imaginary part is a purely mathematical construction. Complex numbers are useful in physics, as well in the mathematics of real numbers, because they open a new dimension that allows to arrive at the results in a much faster and elegant way. Using complex numbers allows sometimes to obtain analytical results that is impossible to obtain in other way, such as exact values of some definite integrals.

Basic definitions

Complex numbers can be introduced in the component form

z=u+iv,

where u and v are real numbers, the real and imaginary parts (components) of z. That is,

u=Re[z],      v=Im[z].

To keep components of z apart, a special new number i is introduced, the so-called imaginary one. The modulus or absolute value of a complex number is defined by

|z|=(Sqrt[(u^2)+(v^2)]),

the same as for 2d vectors. Complex conjugate (SuperStar[z]) of a complex number z=u+iv is defined by

(SuperStar[z])=u-iv.

By default, all symbols in Mathematica can be complex (including u and v) so that unspecified finding the real and imaginary parts of z does not work

z=u+I v;
Re[z]
Im[z]

To make it work, one has to declare u and v as real in Assumptions

z=u+I v;
Simplify[Re[z],Assumptions->{u∈Reals,v∈Reals}]
Simplify[Im[z],Assumptions->{u∈Reals,v∈Reals}]

Addition and subtraction of complex numbers are defined component-by-component,

(Subscript[z, 1])±(Subscript[z, 2])=(Subscript[u, 1])±(Subscript[u, 2])+i((Subscript[v, 1])±(Subscript[v, 2])),

so that the commutation and association properties are fulfilled,

(Subscript[z, 1])+(Subscript[z, 2])=(Subscript[z, 2])+(Subscript[z, 1]),     
((Subscript[z, 1])+(Subscript[z, 2]))+(Subscript[z, 3])=(Subscript[z, 1])+((Subscript[z, 2])+(Subscript[z, 3]))

etc.

Multiplication of complex numbers is defined by imposing the property

(i^2)=-1.

This yields

(Subscript[z, 1])(Subscript[z, 2])=((Subscript[u, 1])+(Subscript[iv, 1]))((Subscript[u, 2])+(Subscript[iv, 2]))=(Subscript[u, 1])(Subscript[u, 2])+i((Subscript[v, 1])(Subscript[u, 2])+(Subscript[u, 1])(Subscript[v, 2]))+(i^2)(Subscript[v, 1])(Subscript[v, 2])=(Subscript[u, 1])(Subscript[u, 2])-(Subscript[v, 1])(Subscript[v, 2])+i((Subscript[v, 1])(Subscript[u, 2])+(Subscript[u, 1])(Subscript[v, 2]))

that is,

Re[(Subscript[z, 1])(Subscript[z, 2])]=(Subscript[u, 1])(Subscript[u, 2])-(Subscript[v, 1])(Subscript[v, 2]),      Im[(Subscript[z, 1])(Subscript[z, 2])]=(Subscript[v, 1])(Subscript[u, 2])+(Subscript[u, 1])(Subscript[v, 2]).

Obviously this new kind of multiplication differs from multiplication of vectors. In two dimensions, vector (cross) product cannot be defined at all while the scalar (dot) product produces a scalar. One can introduce more complicated objects than complex numbers that have three and more components with several kinds of imaginary ones, but these objects do not have much application.

Product of a complex number and its complex conjugate is real

(SuperStar[zz])=(u+iv)(u-iv)=(u^2)-(i^2)(v^2)=(u^2)+(v^2)=((|z|)^2).

Division of complex numbers can be introduced via their multiplication and division of reals by eliminating complexity in the denominator

((Subscript[z, 1])/(Subscript[z, 2]))=((Subscript[z, 1])/(Subscript[z, 2]))((Subscript[z, 2]^( * ))/(Subscript[z, 2]^( * )))=(((Subscript[z, 1])(Subscript[z, 2]^( * )))/((|(Subscript[z, 2])|)^2))=(((Subscript[u, 1])(Subscript[u, 2])+(Subscript[v, 1])(Subscript[v, 2])+i((Subscript[v, 1])(Subscript[u, 2])-(Subscript[u, 1])(Subscript[v, 2])))/((Subscript[u, 2]^2)+(Subscript[v, 2]^2))).

Multiplication and division are also commutative and associative.

Trigonometric / exponential form

Similarly to 2d vectors, complex numbers can be represented by their modulus (length) ρ and angle (phase) ϕ as

z=ρ(Cos[ϕ]+iSin[ϕ]),         ρ≡|z|.

This formula can be brought into a more compact and elegant shape

z=((ρe)^(iϕ))

by introducing the imaginary exponential

(e^(iϕ))≡Cos[ϕ]+iSin[ϕ].

This formula can be proven by expanding the three functions in power series, using (i^2)=-1 and grouping real and imaginary terms on the left. The exponential representation makes multiplication and division of complex numbers very easy

(Subscript[z, 1])(Subscript[z, 2])=(Subscript[ρ, 1])(e^(Subscript[iϕ, 1]))(Subscript[ρ, 2])(e^(Subscript[iϕ, 2]))=(Subscript[ρ, 1])(Subscript[ρ, 2])(e^(i((Subscript[ϕ, 1])+(Subscript[ϕ, 2]))))

In particular,

Re[(Subscript[z, 1])(Subscript[z, 2])]=(Subscript[ρ, 1])(Subscript[ρ, 2])Cos[(Subscript[ϕ, 1])+(Subscript[ϕ, 2])],   Im[(Subscript[z, 1])(Subscript[z, 2])]=(Subscript[ρ, 1])(Subscript[ρ, 2])Sin[(Subscript[ϕ, 1])+(Subscript[ϕ, 2])]

that is much easier than the component formula above. Similarly

((Subscript[z, 1])/(Subscript[z, 2]))=((Subscript[ρ, 1])/(Subscript[ρ, 2]))(e^(i((Subscript[ϕ, 1])-(Subscript[ϕ, 2])))).

Squaring a complex number z yields

(z^2)=(ρ^2)(((Cos[ϕ]+iSin[ϕ]))^2)=(ρ^2)(((Cos[ϕ])^2)-((Sin[ϕ])^2)+2iSin[ϕ]Cos[ϕ])

On the other hand,

(z^2)=(ρ^2)(e^(2iϕ))=(ρ^2)(Cos[2ϕ]+iSin[2ϕ])

Equating the real and imaginary parts of these two formulas, one obtains the trigonometric identities

Cos[2ϕ]=((Cos[ϕ])^2)-((Sin[ϕ])^2)
Sin[2ϕ]=2Sin[ϕ]Cos[ϕ]

One can derive formulas for Sin and Cos of any multiple arguments with this method.

Functions of complex variables

With the help of power series one can extend many functions of real arguments for complex numbers. In particular, the complex exponential is defined as

(e^z)=(e^(u+iv))=(e^u)(e^(iv))=(e^u)(Cos[v]+iSin[v]).

The natural logarithm becomes

Ln[z]=Ln[((ρe)^(iϕ))]=Ln[ρ]+Ln[(e^(iϕ))]=Ln[ρ]+iϕ

As, in fact, the angle ϕ of a complex number is defines up to 2πn, the complex logarithm is a multi-valued function. Combining the formulas

(e^(iϕ))≡Cos[ϕ]+iSin[ϕ]
(e^(-iϕ))≡Cos[ϕ]-iSin[ϕ]

one can obtain the relation between the trigonometric and hyperbolic functions

Cos[ϕ]≡(((e^(iϕ))+(e^(-iϕ)))/2)=Cosh[iϕ]
Sin[ϕ]≡(((e^(iϕ))-(e^(-iϕ)))/(2i))=-iSinh[iϕ].

Accordingly,

Cos[iϕ]≡(((e^(-ϕ))+(e^ϕ))/2)=Cosh[ϕ]
Sin[iϕ]≡(((e^(-ϕ))-(e^ϕ))/(2i))=iSinh[ϕ].

All relations above are also valid for complex z, so that one obtains

Cos[z]≡(((e^(iz))+(e^(-iz)))/2)=(((e^(-v+iu))+(e^(v-iu)))/2)=(((e^(-v))(Cos[u]+iSin[u])+(e^v)(Cos[u]-iSin[u]))/2)=Cos[u]Cosh[v]-iSin[u]Sinh[v]

and many other formulas.

Whereas integer powers of complex numbers are one-valued in spite of ϕ being multi-valued,

(z^m)=(ρ^m)(e^(im(ϕ+2πn)))=(ρ^m)(e^(imϕ)),    m,n=0,±1,±2,...

fractional powers of complex numbers are multivalued. For instance, the square root

(z^(1/2))=(ρ^(1/2))(e^(i(ϕ+2πn)/2))=(ρ^(1/2))(e^(i(ϕ/2+πn))),    n=0,±1,±2

has two different values

(z^(1/2))=(ρ^(1/2))(e^(i(ϕ+2πn)/2))=(ρ^(1/2))(e^(i(ϕ/2+πn))), n=0,1,

whereas all other n result in replicas of these two values. In particular,

(1^(1/2))=(e^(iπn)), n=0,1,

that yields (1^(1/2))=±1. Further,

(((-1))^(1/2))=(e^(i(π/2+πn))), n=0,1,

that yields  (((-1))^(1/2))=±i. Accordingly, the quadratic equation

(z^2)-c==0

has two roots because its solution z=(c^(1/2)) is a two-valued quantity. It can be shown that any other quadratic equation has two roots that in general are complex.

High fractional powers (z^(1/m)) can be considered in a similar way and it can be shown that they are m-valued, Accordingly, any algebraic equation of mth power has m roots.