3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (2023)

We start by defining 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (1) by its principal value, then everything elsefollows from this definition. We could have also used any other branch, butthen most results in this chapter would need to be updated with the newconvention.

Then we define exponential, logarithm, power and so on using simple naturalformulas. From these definitions, everything else follows using a very simplealgebra manipulation, all the “messy” features are hidden in the definition andproperties of the real 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (2) function. In the derivation of each formula,only formulas introduced before (above) are used.

Every formula in this chapter holds for all complex numbers, unless explicitlyspecified otherwise.

3.2.1. Real and Imaginary Part

A complex number 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (3) can be written using its real and imaginary parts:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (4)

The absolute value 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (5) is defined as:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (6)

3.2.2. Argument Function

Principal value of 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (7) is defined as

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (8)

Thus we have 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (9). All operations with 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (10) are thenderived using the properties of the real 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (11) function.

3.2.3. Exponential

Exponential is defined using:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (12)

It follows:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (13)

Any complex number can be written in a polar form as follows:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (14)

The following formula holds:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (15)

and also:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (16)

(Video) This equation will change how you see the world (the logistic map)

and

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (17)

and

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (18)

3.2.4. Logarithm

The logarithm is defined as:

(3.2.4.1)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (19)

The motivation is from the following formula:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (20)

which using our definition becomes:

(3.2.4.2)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (21)

so a logarithm is an inverse function to an exponential. The formula (3.2.4.2)would be satisfied even if we add a factor of 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (22) (where 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (23) is aninteger) to the right hand side of (3.2.4.1). However, the convention is todefine logarithm using the equation (3.2.4.1) exactly.

We can now derive a few important formulas:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (24)

and

(3.2.4.3)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (25)

and

(3.2.4.4)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (26)

3.2.5. Power

A power of two complex numbers is defined as:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (27)

From above we can also write the power 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (28) in two different ways:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (29)

But these two cannot be used as a definition of a power, because both requirethe knowledge of 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (30), which we are trying to define, where 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (31) or 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (32).

It follows:

(3.2.5.1)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (33)

(Video) All physics explained in 15 minutes (worth remembering)

and

(3.2.5.2)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (34)

As a special case for 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (35) one gets:

(3.2.5.3)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (36)

Similarly:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (37)

3.2.6. Examples

For integer 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (38) we get from (3.2.5.2):

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (39)

Using (3.2.5.2):

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (40)

Using (3.2.5.3):

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (41)

Using (3.2.4.3):

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (42)

Code:

>>> from math import floor, pi>>> from cmath import log>>> log((-1)*(-1))0j>>> log(-1)+log(-1)+2*pi*1j*floor((pi-pi-pi)/(2*pi))0j

Another example:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (43)

Code:

>>> from math import exp, pi>>> 1j**1j(0.20787957635076193+0j)>>> exp(-pi/2)0.20787957635076193

Another example, using (3.2.5.1):

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (44)

and

(Video) A Swift Introduction to Spacetime Algebra

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (45)

and

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (46)

Another example, following from (3.2.4.1) and (3.2.4.4):

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (47)

3.2.7. Complex Conjugate

The complex conjugate is defined by:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (48)

Now we can solve for 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (49) and 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (50):

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (51)

Any complex function 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (52) can be written using 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (53) and 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (54), i.e. 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (55) or using 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (56) and 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (57), i.e. 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (58).

Examples

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (59)

3.2.8. Complex Derivatives

The complex derivative is defined by

(3.2.8.1)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (60)

Let’s calculate the complex derivative in the direction 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (61), i.e.we use 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (62) with real 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (63) and we introduce 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (64) with 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (65), 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (66) to simplify the notation:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (67)

In the last step we have expressed the derivatives with respect to 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (68), 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (69) interms of derivatives with respect to 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (70), 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (71), using the relations:

(3.2.8.2)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (72)

(3.2.8.3)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (73)

Let’s repeat the important result:

(3.2.8.4)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (74)

The equation (3.2.8.4) states that the complex derivative along thedirection 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (75) of any function can be calculated, but the result in generaldepends on 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (76). The derivatives for all possible angles 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (77) lie on acircle, with the center 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (78) and the radius3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (79).When the derivative has different valuesfor different 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (80), i.e. when 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (81), itmeans that the complex limit (3.2.8.1) does not exist. On theother hand, if the derivative does not depend on 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (82), i.e.when 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (83), then the complex limit(3.2.8.1) exists, and the function has a complex derivative —such functions are called analytic. Analytic functions thus do not depend on3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (84) and we can write just 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (85) for those.

The 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (86) and 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (87)are called Wirtinger derivatives.

We can see that the function is analytic (i.e. has a complex derivative) if andonly if:

(Video) "An Invitation to Mathematical Physics and Its History"; Jont Allen, 4/28/2020

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (88)

We can write 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (89):

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (90)

both the real and imaginary parts must be equal to zero:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (91)

These are called the Cauchy-Riemann equations.

We can derive the chain rule:

(3.2.8.5)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (92)

Another useful formula is the derivative of a conjugate function:

(3.2.8.6)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (93)

Using (3.2.8.6), the chain rule (3.2.8.5) can also be written as:

(3.2.8.7)3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (94)

Which has the advantage that only the 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (95) derivative is needed,the rest is just conjugation and multiplication. If 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (96) is analytic, then3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (97), the second term vanishes and the chainrule is analogous to real functions.

Examples

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (98)

Note that if 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (99) is real, i.e. 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (100), we recover the real derivativeresults by setting 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (101), i.e. taking the derivative along the 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (102)-axis:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (103)

The above approach to first express things in terms of 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (104) and 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (105) andthen differentiate is probably the easiest, but we can do things in any orderwe want. For example the derivative of 3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (106) can also be calculated in this(arguably more complicated) way:

3.2. Complex Numbers — Theoretical Physics Reference 0.5 documentation (107)

3.2.9. Testing Identities Using Computer Code

All the complex identities in this chapter can be tested using the followingcodes. test_complex.py:

def arg(x): """ The argument function. """ from cmath import log return log(x).imagdef generate_values(): """ Create values to test the function at. """ from math import sin, cos, pi from random import random # Generate 3 circles in complex plane, with diameters 0.5, 1 and 2. We # avoid special values like -1, +/- i, etc., because they typically send # the numerical values close to the branch cut, and numerical errors then # flip the sign, e.g.: # In [1]: sqrt((-0.5j)**2) # Out[1]: -0.5j # # In [2]: (-0.5j)**2 # Out[2]: (-0.25-0j) # # In [3]: sqrt(-0.25) # Out[3]: 0.5j # Here [3] is the correct value and [1] is incorrect, but that happens due # to the round off errors in [2] (the small negative imaginary part makes # sqrt() return -0.5j instead of +0.5j). # # For this reason, we chose N=7. N = 7 circle = [] for n in range(N): circle.append(cos(2*pi*n/N)+1j*sin(2*pi*n/N)) values = [] for n in range(N): values.append(0.5*circle[n]) for n in range(N): values.append(1.0*circle[n]) for n in range(N): values.append(2.0*circle[n]) # Add some random points: for n in range(30): values.append((random()-0.5)*20 + 1j*(random()-0.5)*20) return valuesvalues = generate_values()def feq(a, b, max_relative_error=1e-12, max_absolute_error=1e-12): """ Returns True if a==b to the given relative and absolute errors, otherwise False. """ # if the numbers are close enough (absolutely), then they are equal if abs(a-b) < max_absolute_error: return True # if not, they can still be equal if their relative error is small if abs(b) > abs(a): relative_error = abs(a-b)/abs(b) else: relative_error = abs(a-b)/abs(a) #print abs(a-b), relative_error return relative_error <= max_relative_errordef test_zero1(lhs, rhs): """ Tests that a complex function f(x) of one complex variable is zero. """ for x in values: r = feq(lhs(x), rhs(x)) if not r: print "x lhs(x) rhs(x)" print x, lhs(x), rhs(x) assert Falsedef test_zero2(lhs, rhs): """ Tests that a complex function f(x, y) of two complex variables is zero. """ for x in values: for y in values: r = feq(lhs(x, y), rhs(x, y)) if not r: print "x y lhs(x, y) rhs(x, y)" print x, y, lhs(x, y), rhs(x, y) assert Falsedef test_zero3(lhs, rhs): """ Tests that a complex function f(x, y, z) of three complex variables is zero. """ for x in values: for y in values: for z in values: r = feq(lhs(x, y, z), rhs(x, y, z)) if not r: print "x y z lhs(x, y, z) rhs(x, y, z)" print x, y, z, lhs(x, y, z), rhs(x, y, z) assert Falsefrom math import floor, pifrom cmath import sqrt, exp, logI = 1j# Test the various identitiestest_zero1(lambda x: sqrt(x**2), lambda x: (-1)**floor((pi-2*arg(x))/(2*pi))*x)test_zero1(lambda x: sqrt(exp(x)), lambda x: (-1)**floor((pi-x.imag)/(2*pi))*exp(x/2))test_zero1(lambda x: log(exp(x)), lambda x: x+2*pi*I*floor((pi-x.imag)/(2*pi)))test_zero1(lambda x: log(abs(exp(x))), lambda x: x.real)test_zero1(lambda z: z, lambda z: abs(z)*exp(I*arg(z)))test_zero1(lambda z: arg(exp(z)), lambda z: z.imag + 2*pi*floor((pi-z.imag)/(2*pi)))test_zero1(lambda z: sqrt(z).conjugate(), lambda z: (-1)**floor((arg(z)+pi)/(2*pi))*sqrt(z.conjugate()))test_zero1(lambda z: arg(z.conjugate()), lambda z: -arg(z) + 2*pi*floor((arg(z)+pi)/(2*pi)))test_zero2(lambda a,b: exp(a)**b, lambda a,b: exp(a*b)*exp(2*pi*I*b*floor((pi-a.imag)/(2*pi))))test_zero2(lambda x,a: log(x**a), lambda x,a: a*log(x)+2*pi*I*floor((pi-(a*log(x)).imag)/(2*pi)))test_zero2(lambda a,b: log(a*b), lambda a,b: log(a)+log(b)+2*pi*I*floor((pi-arg(a)-arg(b))/(2*pi)))test_zero2(lambda a,b: arg(a*b), lambda a,b: arg(a)+arg(b)+2*pi*floor((pi-arg(a)-arg(b))/(2*pi)))test_zero3(lambda x,a,b: (x**a)**b, lambda x,a,b: x**(a*b)*exp(2*pi*I*b*floor((pi-(a*log(x)).imag)/(2*pi))))test_zero3(lambda x,y,a: (x*y)**a, lambda x,y,a: (x**a)*(y**a)*exp(2*pi*I*a*floor((pi-arg(x)-arg(y))/(2*pi))))

test_complex_diff.py:

def arg(x): """ The argument function. """ from cmath import log return log(x).imagdef generate_values(): """ Create values to test the function at. """ from math import sin, cos, pi from random import random # Generate 3 circles in complex plane, with diameters 0.5, 1 and 2. We # avoid special values like -1, +/- i, etc., because they typically send # the numerical values close to the branch cut, and numerical errors then # flip the sign, e.g.: # In [1]: sqrt((-0.5j)**2) # Out[1]: -0.5j # # In [2]: (-0.5j)**2 # Out[2]: (-0.25-0j) # # In [3]: sqrt(-0.25) # Out[3]: 0.5j # Here [3] is the correct value and [1] is incorrect, but that happens due # to the round off errors in [2] (the small negative imaginary part makes # sqrt() return -0.5j instead of +0.5j). # # For this reason, we chose N=7. N = 7 circle = [] for n in range(N): circle.append(cos(2*pi*n/N)+1j*sin(2*pi*n/N)) values = [] for n in range(N): values.append(0.5*circle[n]) for n in range(N): values.append(1.0*circle[n]) for n in range(N): values.append(2.0*circle[n]) # Add some random points: for n in range(30): values.append((random()-0.5)*20 + 1j*(random()-0.5)*20) return valuesvalues = generate_values()def feq(a, b, max_relative_error=1e-12, max_absolute_error=1e-12): """ Returns True if a==b to the given relative and absolute errors, otherwise False. """ # if the numbers are close enough (absolutely), then they are equal if abs(a-b) < max_absolute_error: return True # if not, they can still be equal if their relative error is small if abs(b) > abs(a): relative_error = abs(a-b)/abs(b) else: relative_error = abs(a-b)/abs(a) #print abs(a-b), relative_error return relative_error <= max_relative_errordef test_zero1(lhs, rhs): """ Tests that a complex function f(x) of one complex variable is zero. """ for x in values: r = feq(lhs(x), rhs(x)) if not r: print "x lhs(x) rhs(x)" print x, lhs(x), rhs(x) assert Falsedef test_zero2(lhs, rhs): """ Tests that a complex function f(x, y) of two complex variables is zero. """ for x in values: for y in values: r = feq(lhs(x, y), rhs(x, y)) if not r: print "x y lhs(x, y) rhs(x, y)" print x, y, lhs(x, y), rhs(x, y) assert Falsedef test_zero3(lhs, rhs): """ Tests that a complex function f(x, y, z) of three complex variables is zero. """ for x in values: for y in values: for z in values: r = feq(lhs(x, y, z), rhs(x, y, z)) if not r: print "x y z lhs(x, y, z) rhs(x, y, z)" print x, y, z, lhs(x, y, z), rhs(x, y, z) assert Falsedef diff(f, z0, theta, eps=1e-8): h = eps*exp(I*theta) return (f(z0+h)-f(z0)) / hdef diff2(dfdz, dfdconjz, z0, theta): return dfdz(z0) + dfdconjz(z0)*exp(-2*I*theta)def test_zero(f, dfdz, dfdconjz, z0, theta, eps=1e-8): assert feq(diff(f, z0, theta, eps), diff2(dfdz, dfdconjz, z0, theta), max_relative_error=eps*1e2, max_absolute_error=eps*1e2)from math import floor, pifrom cmath import sqrt, exp, logI = 1jangles = [0, pi/7, pi/4, pi/2, 3*pi/4, pi]for x in values: for theta in angles: test_zero(lambda x: abs(x), lambda x: x.conjugate()/(2*abs(x)), lambda x: x/(2*abs(x)), x, theta) test_zero(lambda x: log(x), lambda x: 1/x, lambda x: 0, x, theta) test_zero(lambda x: log(exp(x-x.conjugate())), lambda x: 1, lambda x: -1, x, theta) test_zero(lambda x: sqrt(x**2), lambda x: sqrt(x**2)/x, lambda x: 0, x, theta) test_zero(lambda x: sqrt(x**2), lambda x: x/sqrt(x**2), lambda x: 0, x, theta)
(Video) M. Bartelmann | Kinetic Field Theory Applied to Cosmic Structure Formation

Videos

1. The medical test paradox, and redesigning Bayes' rule
(3Blue1Brown)
2. All You Need To Know About Logic Gates 2 Why Transistor Gate Circuits Found On Internet Don't Work
(Learn Electronics Repair)
3. ITER Talks (6): Tokamak Physics for Nuclear Fusion
(iterorganization)
4. How To Learn Blender Part 10 - Fun with Particle Physics Simulation #Blender #ParticleSystem
(Learn Everything About Design)
5. Ancient Civilizations, Multiple Dimensions, Aliens & Time with 19 Keys & Billy Carson
(Earn Your Leisure)
6. 5.17: Introduction to Matter.js - The Nature of Code
(The Coding Train)
Top Articles
Latest Posts
Article information

Author: Eusebia Nader

Last Updated: 01/12/2023

Views: 6339

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.