SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
      1. 1.7.1 Angles, the unit circle, sine and cosineConcept · 30 min
      2. 1.7.2 Complex numbersConcept · 25 min
      3. 1.7.3 Euler's formulaConcept · 25 min
      4. 1.7.4 Practice set: trigonometry and complex numbersPractice set · 20 min

Level 1, Precalculus 1.7 Trigonometry and complex numbers Lesson 3 of 4

ConceptLesson 1.7.3 in Level 1, Precalculus. About 25 minutes.

Euler's formula

Euler's formula

Lesson 1.4.2 built exe^x as the limit of (1+xn)n\left(1 + \frac{x}{n}\right)^n: split a growth xx into nn small pieces. Now try an imaginary growth, x=iθx = i\theta, where θ\theta is an angle in radians. Each factor 1+iθn1 + \frac{i\theta}{n} is a complex number, so multiplying by it turns a point as well as stretching it.

Take θ=π\theta = \pi. The table shows (1+iπn)n\left(1 + \frac{i\pi}{n}\right)^n as nn grows.

nn(1+iπn)n\left(1 + \frac{i\pi}{n}\right)^n
11+3.141593i1 + 3.141593i
10−1.593362+0.156064i-1.593362 + 0.156064i
100−1.05056+0.001085i-1.05056 + 0.001085i
10,000−1.000494-1.000494
1,000,000−1.000005-1.000005

The values close in on −1-1. Multiplying a point zz by 1+iπn1 + \frac{i\pi}{n} adds iπnz\frac{i\pi}{n}z to it. Since multiplying by ii is a quarter turn (lesson 1.7.2), that is a short step at right angles to zz.

Steps at right angles to the radius go round a circle. Their lengths add up to about π\pi, so the path covers about π\pi of the unit circle. That is half a turn, from 1 to −1-1.

With more and smaller steps the path hugs the unit circle, and after an arc of π\pi it lands near −1-1. In the same way, eiθe^{i\theta} is the point an arc θ\theta round the circle: (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta).

The same happens for any angle: the limit is the point an arc θ\theta round the unit circle from 1. Lesson 1.7.1 named that point (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta). Written as a complex number, this is Euler's formula.

Rule: Euler's formula

eiθ=cos⁡θ+i sin⁡θe^{i\theta} = \cos\theta + i\,\sin\theta

With θ\theta in radians, the real part is cos⁡θ\cos\theta and the imaginary part is sin⁡θ\sin\theta. So eiθe^{i\theta} is the point at angle θ\theta on the unit circle.

Why this holds for every θ\theta needs calculus; module 2.7 (Taylor series) shows one way to see it. Here the numbers are the evidence, as they were for ee in lesson 1.4.2.

Try it

cmath is Python's module for complex maths, and cmath.exp computes ee to a complex power.

tidy rounds both parts to 6 places; adding 0.0 turns a -0.0 into 0.0. The loop rebuilds the table, then cmath.exp(1j * math.pi) gives eiπe^{i\pi} directly.

⌘/Ctrl + Enter runs the cell

Going round the unit circle

Every value of eiθe^{i\theta} lies on the unit circle. Its distance from 0 is cos⁡2θ+sin⁡2θ=1\sqrt{\cos^2\theta + \sin^2\theta} = 1, by the identity of lesson 1.7.1. The quarter turns give four values worth knowing.

θ\theta0π2\frac{\pi}{2}π\pi3π2\frac{3\pi}{2}2π2\pi
eiθe^{i\theta}1ii−1-1−i-i1

So eiπ=−1e^{i\pi} = -1: two famous numbers, ee and π\pi, combine to give −1-1. A full turn, e2πie^{2\pi i}, is back at 1.

The facts about angles from lesson 1.7.1 carry over:

  • Period 2π2\pi: ei(θ+2π)=eiθe^{i(\theta + 2\pi)} = e^{i\theta}, because one more full turn changes nothing.
  • Negative angles: e−iθ=cos⁡θ−isin⁡θe^{-i\theta} = \cos\theta - i\sin\theta, the conjugate of eiθe^{i\theta}. Turning clockwise mirrors the point in the real axis.
  • Degrees do not work: e90ie^{90i} is the point 90 radians round, about −0.448074+0.893997i-0.448074 + 0.893997i, not ii.

Example 1. Write eiπ/6e^{i\pi/6} and e−iπ/6e^{-i\pi/6} in the form a+bia + bi. By the exact values of lesson 1.7.1, eiπ/6=32+12i≈0.866025+0.5ie^{i\pi/6} = \frac{\sqrt{3}}{2} + \frac{1}{2}i \approx 0.866025 + 0.5i. Its conjugate is e−iπ/6≈0.866025−0.5ie^{-i\pi/6} \approx 0.866025 - 0.5i.

Try it

Each line prints θ\theta, then cmath.exp(1j * theta), then cos⁡θ+isin⁡θ\cos\theta + i\sin\theta built from math. The two always agree, and the modulus is always 1.

⌘/Ctrl + Enter runs the cell

Polar form

Any complex number other than 0 is a distance from 0 and a direction. Let r=∣z∣r = |z| be the distance and θ\theta the angle from the positive real axis to zz, called its argument. Then zz is rr times the point at angle θ\theta on the unit circle.

Rule: Polar form

z=r eiθ=rcos⁡θ+i rsin⁡θr=a2+b2\begin{gathered} z = r\,e^{i\theta} = r\cos\theta + i\,r\sin\theta \\[4pt] r = \sqrt{a^2 + b^2} \end{gathered}

The real part is a=rcos⁡θa = r\cos\theta and the imaginary part is b=rsin⁡θb = r\sin\theta. The distance rr is never negative.

From polar form to a+bia + bi, use the cosine and sine. For example 2eiπ/3=2(12+32i)=1+3 i≈1+1.732051i2e^{i\pi/3} = 2\left(\frac{1}{2} + \frac{\sqrt{3}}{2}i\right) = 1 + \sqrt{3}\,i \approx 1 + 1.732051i.

From a+bia + bi to polar form, rr is the modulus and θ\theta the angle of the point (a,b)(a, b). For 1+i1 + i, r=2≈1.414214r = \sqrt{2} \approx 1.414214 and θ=π4\theta = \frac{\pi}{4}, which is 45°.

The quadrant matters. −1−i-1 - i also has r=2r = \sqrt{2}, and the same slope ba=1\frac{b}{a} = 1 as 1+i1 + i. But it lies in quadrant III, so θ=−3π4\theta = -\frac{3\pi}{4} (−135°-135°), not π4\frac{\pi}{4}.

Four more cases come up often:

  • Angles are not unique. Adding 2π2\pi gives the same number, so −3π4-\frac{3\pi}{4} and 5π4\frac{5\pi}{4} both describe −1−i-1 - i. Python's cmath.phase picks the angle between −π-\pi and π\pi.
  • Real numbers: a positive one has angle 0, and a negative one has angle π\pi. So −2=2eiπ-2 = 2e^{i\pi}.
  • A negative rr is not polar form. −3eiπ/4-3e^{i\pi/4} points the opposite way, so it is 3ei(π/4+π)=3e5iπ/43e^{i(\pi/4 + \pi)} = 3e^{5i\pi/4}. Python reports its angle as −3π4≈−2.356194-\frac{3\pi}{4} \approx -2.356194.
  • 0 has no angle. Its distance is 0, and every angle gives the same point.

Try it

cmath.polar(z) returns the pair (r,θ)(r, \theta) and cmath.rect(r, theta) goes back. Both use radians.

The loop prints rr and the angle in degrees for 1+i1 + i, −1−i-1 - i and −2-2. Then rect turns 2eiπ/32e^{i\pi/3} into 1+1.732051i1 + 1.732051i.

⌘/Ctrl + Enter runs the cell

Multiplying: a stretch and a turn

In polar form, multiplication needs only the exponent rules of lesson 1.4.1. Write α\alpha and β\beta (the Greek letters alpha and beta) for two angles.

Rule: Multiplying and dividing

r1eiα⋅r2eiβ=r1r2 ei(α+β)r1eiαr2eiβ=r1r2 ei(α−β)\begin{gathered} r_1 e^{i\alpha} \cdot r_2 e^{i\beta} = r_1 r_2\, e^{i(\alpha + \beta)} \\[6pt] \frac{r_1 e^{i\alpha}}{r_2 e^{i\beta}} = \frac{r_1}{r_2}\, e^{i(\alpha - \beta)} \end{gathered}

To multiply, multiply the distances and add the angles. To divide, divide the distances and take the angles away.

So multiplying by eiβe^{i\beta}, at distance 1, turns a point through β\beta without stretching it. Multiplying by a positive real number rr stretches it without turning. Since i=eiπ/2i = e^{i\pi/2}, multiplying by ii is the quarter turn of lesson 1.7.2.

Example 2. Multiply z=1+iz = 1 + i by w=1+3 iw = 1 + \sqrt{3}\,i.

In polar form, zz is 2\sqrt{2} at 45° and ww is 2 at 60°. So zwzw is 22≈2.8284272\sqrt{2} \approx 2.828427 at 105°. Multiplying out instead (lesson 1.7.2) gives the same number:

(1+i)(1+3 i)=1+3 i+i+3 i2=(1−3)+(1+3) i≈−0.732051+2.732051i\begin{aligned} (1 + i)(1 + \sqrt{3}\,i) &= 1 + \sqrt{3}\,i + i + \sqrt{3}\,i^2 \\ &= (1 - \sqrt{3}) + (1 + \sqrt{3})\,i \\ &\approx -0.732051 + 2.732051i \end{aligned}

Multiplying zz by ww stretches it by ∣w∣=2|w| = 2 and turns it by 60°, the angle of ww. The product lands in quadrant II, at 105°.

The conjugate fits the same picture. zˉ=re−iθ\bar{z} = re^{-i\theta} has the opposite angle, so zzˉ=r2e0=r2z\bar{z} = r^2 e^{0} = r^2: the ∣z∣2|z|^2 of lesson 1.7.2. Division works the same way: 6e5iπ/6÷2eiπ/3=3eiπ/2=3i6e^{5i\pi/6} \div 2e^{i\pi/3} = 3e^{i\pi/2} = 3i.

Powers

The power znz^n of z=reiθz = re^{i\theta} multiplies nn copies of zz. Each copy multiplies the distance by rr and adds θ\theta to the angle.

Rule: Powers

(reiθ)n=rn einθ\left(re^{i\theta}\right)^n = r^n\, e^{in\theta}

The distance is raised to the power nn, and the angle is multiplied by nn.

Example 3. Find (1+i)8(1 + i)^8. Each power multiplies the distance by 2\sqrt{2} and adds 45°, so the points spiral outwards.

kk12345678
(1+i)k(1 + i)^k1+i1 + i2i2i−2+2i-2 + 2i−4-4−4−4i-4 - 4i−8i-8i8−8i8 - 8i16
angle45°90°135°180°225°270°315°360°

The power rule gives the last entry at once: (2 eiπ/4)8=(2)8e8iπ/4=16 e2πi=16\left(\sqrt{2}\,e^{i\pi/4}\right)^8 = (\sqrt{2})^8 e^{8i\pi/4} = 16\,e^{2\pi i} = 16.

Try it

The first lines check Example 2: the distance of the product and its angle in degrees.

The loop prints the powers of 1+i1 + i with their distances and angles. Python gives each angle between −180°-180° and 180°, so 225° shows as −135°-135° and 360° as 0°. The -0 in line 6 is 0, as in lesson 1.7.2.

⌘/Ctrl + Enter runs the cell

Module 5.6 builds characteristic functions of random variables from eiθe^{i\theta}, and the Financial Computing with Python course prices options from them by Fourier methods.

Common mistakes

  1. The angle must be in radians. e90ie^{90i} is about −0.448074+0.893997i-0.448074 + 0.893997i, not ii. A quarter turn is eiπ/2e^{i\pi/2}.
  2. ∣eiθ∣=1|e^{i\theta}| = 1, not eθe^{\theta}. An imaginary exponent turns the point; it does not grow it. ∣e3i∣=1|e^{3i}| = 1, while e3≈20.085537e^3 \approx 20.085537.
  3. Check the quadrant. −1−i-1 - i and 1+i1 + i share the slope ba=1\frac{b}{a} = 1, but their angles are −135°-135° and 45°.
  4. Angles add only when you multiply. 11 is at 0° and ii at 90°, but their sum 1+i1 + i is at 45°. Its distance is 2\sqrt{2}, not 2.
  5. The distance rr is never negative. Rewrite −3eiπ/4-3e^{i\pi/4} as 3ei(π/4+π)3e^{i(\pi/4 + \pi)}.
  6. An angle has many names. 3π2\frac{3\pi}{2} and −π2-\frac{\pi}{2} are the same direction; Python reports the one between −π-\pi and π\pi.

Euler's formula and polar form

0 of 12 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11.
  12. 12.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Summary card

  • Euler's formula: eiθ=cos⁡θ+isin⁡θe^{i\theta} = \cos\theta + i\sin\theta, with θ\theta in radians. It is the limit of (1+iθn)n\left(1 + \frac{i\theta}{n}\right)^n, and the point at angle θ\theta on the unit circle.
  • ∣eiθ∣=1|e^{i\theta}| = 1; eiπ/2=ie^{i\pi/2} = i, eiπ=−1e^{i\pi} = -1, e2πi=1e^{2\pi i} = 1; e−iθe^{-i\theta} is the conjugate of eiθe^{i\theta}.
  • Polar form: z=reiθz = re^{i\theta} with r=∣z∣≥0r = |z| \geq 0, a=rcos⁡θa = r\cos\theta, b=rsin⁡θb = r\sin\theta. The quadrant fixes θ\theta; adding 2π2\pi gives the same number.
  • Multiplying multiplies the distances and adds the angles; dividing divides them and subtracts. (reiθ)n=rneinθ\left(re^{i\theta}\right)^n = r^n e^{in\theta}.
  • In Python: cmath.exp(1j * theta), cmath.polar(z), cmath.rect(r, theta), cmath.phase(z).

Free further reading

Optional. This lesson covers what you need; these add more examples and practice. All are free to read.