11.12. Homework 12 - Numerical Proof of Euler’s Formula¶
Note
The foundation of this assignment comes from math concepts that are very important to engineering. Some students may have previously been exposed to the math of this assignment. Probably some students have not worked with Euler’s formula before. This assignment demonstrates a numerical proof of Euler’s formula, which is a formula that can seem strange at first. It is hoped that having established a proof of the correctness of the formula using numerical methods will help students to understand this important formula.
11.12.1. Complex Numbers¶
A complex number contains both a real part and an imaginary part. The imaginary part is said to be a multiplied by the imaginary number, .
Mathematicians usually use the variable as the imaginary number. Engineers, however, prefer to use the variable .
One example of when we encounter complex numbers is when we solve for an unknown value to satisfy an equation. For example, the quadratic formula can be used to find values of that satisfy . The two values of are given by:
When , then is a pair of complex conjugate numbers.
For this assignment, we will define a data structure to hold the real and imaginary parts of a complex number.
11.12.2. The Number ¶
See also
The number is a very peculiar and important irrational number. It is defined using a limit.
and
Here are the limits of some exponentials that we already know about.
The function has two very important properties that make an important number. First of all, is the only function for which the derivative of the function is a scalar multiple of itself.
This is why is such a common part of the solutions to differential equations. Problems of growth and decay have solutions containing the number .
Note
Do you see why the derivative of is a scalar multiple of itself? If we don’t use the known derivative of , we can either take the derivative of its Maclaurin (Taylor) series, or use it numeric definition in terms of a limit. I will use the later.
You need to use the chain rule to take the derivative. If , then . We see the desired equality then in the limit.
The second important property of is defined by Euler’s formula.
11.12.3. Euler’s Formula¶
Euler’s formula brings together complex numbers, the number , and the trigonometry functions and into one equation.
Consider a point, , on the complex plane. Following Euler’s formula,
It can be shown, with the help of trigonometry identities, that powers of follow the form expected from raising an exponential expression to a power.
The needed trigonometry identities are:
But it remains to shown that the number is the base of the exponential.
Some MacLaurin series can show the validity of Euler’s formula.
Now replace in the equations for with . Remember that .
The validity of Euler’s formula can also be show with a derivative and an integral.
Define as:
Now represent as .
Raise both sides to an exponent of .
Letting resolves the constant to 1. Therefore,
11.12.4. Numerical Proof Program¶
Write a C program that demonstrates the correctness of Euler’s formula for several values. Use the definition of using a limit. A value of , is sufficient for our purposes. Show numerically that when in the range , the value of closely matches Euler’s formula.
The main code that you need to write is a function to compute exponential powers of a complex number. If one is already convinced of the correctness of Euler’s formula, then one can simplify complex exponentials by changing a complex number to polar coordinates and simply multiplying the angle. Since this program is intended to prove Euler’s formula, we should not take this short cut.
To make your program faster, use the recursive algorithm from Homework 8 - A Recursive Function to compute the exponential power.