Euler’s Formula and Taylor Series
When working with complex numbers, a formula that comes up very often is 𝑟 𝑒ᶿⁱ = 𝑟 (cos(𝜃) + sin(𝜃) 𝑖), sometimes seen as 𝑒ᶿⁱ = cos(𝜃) + 𝑖 sin(𝜃), known as Euler’s Formula after Swiss mathematician Leonhard Euler. This formula gives the relationship between the polar (𝑟 𝑒ᶿⁱ) and rectangular (𝑎 + 𝑏 𝑖) forms of complex numbers.
When someone is first introduced to the polar form, a common reaction is to ask “what does it mean to raise a number to a complex power?” We generally think of exponents as denoting repeated multiplication: 6² = 6 × 6, 12⁵ = 12 × 12 × 12 × 12 × 12, and so on. Given 𝑏ⁿ, we multiply together 𝑛 copies of the base 𝑏. However, this definition of exponentiation only works for positive real integer exponents. Extending the definition of exponentiation to zero and negative integers is easy, and though non-integer values are much trickier, a smooth, continuous exponential function 𝑓(𝑥) = 𝑏ˣ is well-defined for positive, real bases and real number values of 𝑥.
This brings us to 𝑒ˣ, the exponential function with base 𝑒: a mathematical constant with a value of approximately 2.718, often known as Euler’s Number or the exponential constant. It is the only base such that the derivative of 𝑏ˣ is, itself, 𝑏ˣ, with a value and slope of 1 at 𝑥 = 0 and a value and slope of 𝑒 at 𝑥 = 1. It was first defined relating to the study of compound interest, as the limit of the expression (1 + 1 / 𝑛)ⁿ as 𝑛 goes to infinity. The function 𝑒ˣ is sometimes called the natural exponential function.
An Introduction to Taylor Series
Any continuous function can be approximated by an infinite sum (a.k.a. series) of terms in the form of an infinite polynomial. This infinite sum is called a Taylor Series, after English mathematician Brook Taylor. Truncating the infinite series after 𝑛 terms gives the 𝑛th Taylor Polynomial. Each finite polynomial is only an approximation, but the approximation becomes more accurate for every additional term that is added.
The Taylor Series of a function 𝑓(𝑥) at the input value 𝑎 is of the form 𝑓(𝑎) + 𝑓′(𝑎) (𝑥 − 𝑎) / 1! + 𝑓″(𝑎) (𝑥 − 𝑎)² / 2! + 𝑓‴(𝑎) (𝑥 − 𝑎)³ / 3! + … + 𝑓⁽ⁿ⁾(𝑎) (𝑥 − 𝑎)ⁿ/ 𝑛!, where:
𝑓⁽ⁿ⁾(𝑎) is the 𝑛th derivative of the function evaluated at 𝑎,
the zeroth derivative of a function is the function itself,
the zeroth power of a term is defined to be 1,
the exclamation mark denotes the factorial operation (multiplying every integer up to the indicated value, e.g. 3! = 1 × 2 × 3 = 6), and
zero factorial is defined to be 1.
Note that a Taylor Series can only be constructed for a function whose value and derivatives are known for the chosen input 𝑎, but — once constructed — can be used to calculate accurate approximations of the output values for other inputs close to 𝑎.
Let’s construct some Taylor Series to see how they work. The derivatives of the sine function sin(𝑥) cycle through four functions {sin(𝑥), cos(𝑥), −sin(𝑥), −cos(𝑥)}, and the values of the derivatives at 𝑥 = 0 cycle through the values {0, 1, 0, −1}. Thus, the Taylor Series for sin(𝑥) at 𝑎 = 0 is 𝑥 − 𝑥³ / 3! + 𝑥⁵ / 5! − 𝑥⁷ / 7! + … + (−1)ⁿ x²ⁿ⁺¹ / (2𝑛 + 1)!.
The derivatives and values of the cosine function cos(𝑥) at 𝑥 = 0 cycle through the same four functions and values as sine, offset by one. Thus, the Taylor Series for cos(𝑥) at 𝑎 = 0 is 1 − 𝑥² / 2! + 𝑥⁴ / 4! − 𝑥⁶ / 6! + … + (−1)ⁿ 𝑥²ⁿ / (2𝑛)!.
Finally, let’s construct the Taylor Series for 𝑒ˣ at 𝑎 = 0. Because the derivative of 𝑒ˣ is 𝑒ˣ, and the value of 𝑒⁰ is 1, the terms of the series simplify nicely, and we get 1 + 𝑥 + 𝑥² / 2! + 𝑥³ / 3! + … + 𝑥ⁿ / 𝑛!.
Notice that the Taylor Series gives a definition of 𝑒ˣ that takes the variable 𝑥 out of the exponent. It is often denoted as exp(𝑥) to emphasize this fact. This provides a way to compute the output of the function 𝑒ˣ for values of 𝑥 that may not make sense as exponents themselves — like complex numbers. The function 𝑒ˣⁱ may not seem intuitive, but the function 1 + 𝑥 𝑖 + (𝑥 𝑖)² / 2! + (𝑥 𝑖)³ / 3! + … + (𝑥 𝑖)ⁿ / 𝑛! is easy to compute.
Because powers of 𝑖 cycle through four values {1, 𝑖, −1, −𝑖}, and because of the exponential identity (𝑏 𝑐)ⁿ = 𝑏ⁿ 𝑐ⁿ, we can expand the terms of the Taylor Series for 𝑒ˣⁱ as 1 + (𝑥 𝑖) / 1! − 𝑥² / 2! − (𝑥³ 𝑖) / 3! + 𝑥⁴ / 4! + (𝑥⁵ 𝑖) / 5! − 𝑥⁶ / 6! − (𝑥⁷ 𝑖) / 7! + … .
We can group the even and odd terms, and factor out the common 𝑖 from all odd terms, to get (1 − 𝑥² / 2! + 𝑥⁴ / 4! − 𝑥⁶ / 6! + …) + 𝑖 (𝑥 / 1! − 𝑥³ / 3! + 𝑥⁵ / 5! − 𝑥⁷ / 7! + …).
This gives us a sum of two separate Taylor Series, one with terms of the form (−1)ⁿ 𝑥²ⁿ / (2𝑛)! and the other with terms of the form (−1)ⁿ x²ⁿ⁺¹ / (2𝑛 + 1)!. The first is the Taylor Series for the function cos(𝑥), and the second is the Taylor Series for sin(𝑥) multiplied by 𝑖 — giving us 𝑒ˣⁱ = cos(𝑥) + 𝑖 sin(𝑥).
Replacing the 𝑥 with 𝜃, conventionally used to represent angles, gives us the standard form of Euler’s Formula. Multiplying both sides by 𝑟 gives the general form that allows the representation of complex numbers of any distance from zero.