13.5. All About the Number e

This section is devoted to topics related to the irrational number e \approx 2.718281828459046, which is also called the Euler number. We know from Systems of Linear ODEs that the special number e is important to solutions to ordinary differential equations (ODEs). When e is raised to a complex number the equation represents oscillations, which factor into both control system stability analysis and the conversion of time and spatial domain data into the frequency domain. The number e also factors into the calculation of compound interest rates for savings and loans.

13.5.1. Definition and Derivative

The importance of the number e to ODEs stems from the derivative of exponential equations of e. If a function is defined as the following, where a is a real constant and x is a real variable,

y(x) = e^{a\,x},

then

\frac{dy(x)}{dx} = a\,e^{a\,x} = a\,y(x).

The derivative of e^{a\,t}

To find the derivative of e^{a\,t} we can either take the derivative of its Maclaurin [1] series, or use its numeric definition in terms of a limit. The later is used here.

e^{a\,t} = \lim_{N\to\infty} \left(1 + \frac{a\,t}{N}\right)^N

The chain rule is used to find the derivative. If f(t) = \left(1 + \frac{a\,t}{N}\right)^N, then f'(t) = a\,\left(1 + \frac{a\,t}{N}\right)^{N - 1}. We see the desired equality then in the limit.

\begin{array}{rl} e^{a\,t} &= \lim_{N\to\infty} f(t) \\
    \hfill \\
    \frac{d\,}{dt}\left(e^{a\,t}\right)
        &= \lim_{N\to\infty} f'(t) =  a\,\lim_{N\to\infty} f(t)
            = a\,e^{a\,t}
    \end{array}

Let us now regard exponential equations of e as special cases of a more general class of exponential equations. In doing so, we will see some interesting properties of e and also get a start toward finding a definition of the value of e. In the following equation, k is any positive, real number.

y(x) = k^{a\,x}

A strategy for finding the derivative of y(x) is to first take the natural logarithm of y(x) (base e logarithm, denoted as \ln y). Although we have not yet found the value of e, we know that it is a number and can abstractly use it as the base for a logarithm.

\ln{y(x)} = a\,x\,\ln{k}

\frac{d\,[\ln{y(x)}]}{dx} = \frac{d\,[a\,x\,\ln{k}]}{dx}

The left side of the above equation is the more difficult to find. Implicit differentiation and the chain rule shows that

\frac{d\,[\ln{y}]}{dx}  = \frac{1}{y}\, \frac{dy}{dx}.

\frac{1}{y}\, \frac{dy}{dx} = a\,(\ln{k})

Thus after multiplying by y we have,

(13.3)\frac{dy}{dx} = a\,(\ln{k})\,y = a\,(\ln{k})\,k^{a\,x}

If k = 2, \frac{dy}{dx} = a\,(0.693147)\,2^{a\,x}.

If k = e, \frac{dy}{dx} = a\,e^{a\,x}.

If k = 3, \frac{dy}{dx} = a\,(1.0986)\,3^{a\,x}.

Equation (13.3) is useful, but it assumes that the value of e is already known. We need to use the definition of a derivative to find an equation for the value of e,

\frac{dy}{dx} = \lim_{h \to 0} \frac{y(x + h) - y(x)}{h}.

We will let a = 1 in the remaining equations.

\begin{aligned}
\frac{dy}{dx} &= \lim_{h \to 0} \frac{k^{(x + h)} - k^x}{h} \\ \hfill
&= \lim_{h \to 0} \frac{k^x\,k^h - k^x}{h} \\ \hfill
&= \lim_{h \to 0} k^x \frac{(k^h - 1)}{h} \\\end{aligned}

Relating the last equation to equation (13.3), we find a limit equation for \ln{k}.

\boxed{\ln{(k)} = \lim_{h \to 0} \frac{k^h - 1}{h}}

Let us test this with the natural log of 2 and 3. We need a very small value for h to get a reasonably accurate result.

>> h = 0.00000001;
>> ln2 = (2^h - 1)/h
ln2 =
    0.693147184094300
>> log(2)
ans =
    0.693147180559945
>> ln3 = (3^h - 1)/h
ln3 =
    1.098612290029166
>> log(3)
ans =
    1.098612288668110

When k = e, then \ln{(k = e)} = 1, which we can use to find an equation with relation to the value of e.

\ln{(e)} = 1 = \lim_{h \to 0} \frac{e^h - 1}{h}

To solve for e, we need to make a change to the limit.

\lim_{h \to 0} h \mapsto
\lim_{N \to \infty} \frac{1}{N}

1 = \lim_{N \to \infty} N \left( e^{1/N} - 1 \right)

\lim_{N \to \infty} \left[ \left( e^{1/N} - 1 \right) =
\frac{1}{N} \right]

\lim_{N \to \infty}
\left[ e^{1/N} = \left( 1 + \frac{1}{N} \right) \right]

Raise both sides to the N power.

\boxed{e = \lim_{N \to \infty}
\left( 1 + \frac{1}{N} \right)^N}
    :label: eq-edefine

Let us test it with MATLAB. Here, the limited digital resolution of the computer can limit the accuracy if N is too large.

>> N = 1E10;
>> (1 + 1/N)^N
ans =
    2.718282053234788
>> exp(1)
ans =
    2.718281828459046

The limit can also be used to find powers of e.

(13.4)\boxed{e^x = \lim_{N \to \infty}
    \left( 1 + \frac{x}{N} \right)^N}

>> (1 + 3/N)^N
ans =
    20.085541899804120
>> exp(3)
ans =
    20.085536923187668

13.5.2. Euler’s Complex Exponential Equation

When the exponent of the number e is a complex number, we see the presence of oscillation. This result is especially important to control system analysis and signal processing (i.e., Fourier transform).

Here, we follow the engineering practice of using the variable j for the imaginary number \sqrt{-1} rather than the math practice of using i.

We can see how e^{j\,x} relates to the \sin(x) and \cos(x) functions by looking at the Maclaurin series for these functions.

The needed Maclaurin series are:

\sin x = \sum_{n=0}^{\infty} \frac{(-1)^n\,x^{2n+1}}{(2n + 1)!}
       = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots

\cos x = \sum_{n=0}^{\infty} \frac{(-1)^n\,x^{2n}}{(2n)!}
       = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots

e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!}
       = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots

Now replace x in the equations for e^x with jx. Remember that j^2 = -1.

\begin{aligned}
e^{jx} &= 1 + jx + \frac{(jx)^2}{2!} + \frac{(jx)^3}{3!}
   + \frac{(jx)^4}{4!} + \frac{(jx)^5}{5!} + \frac{(jx)^6}{6!}
   + \frac{(jx)^7}{7!} + \cdots \\ \hfill
      &= 1 + jx - \frac{x^2}{2!} - \frac{jx^3}{3!}
   + \frac{x^4}{4!} + \frac{jx^5}{5!} - \frac{x^6}{6!}
   - \frac{jx^7}{7!} + \cdots \\ \hfill
      &= \left( 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!}
       + \ldots \right) + j \left(
       x - \frac{x^3}{3!} + \frac{x^5}{5!}
       - \frac{x^7}{7!} + \cdots \right) \\ \hfill
      &= \cos x + j \sin x\end{aligned}

This relationship between complex exponentials of e to the cosine and sine functions in the complex plane (\mathbb{C}^2), is often called Euler’s formula.

The validity of Euler’s formula can also be show with a derivative and an integral.

Define z as:

z = \cos x + j \sin x

\frac{dz}{dx} = - \sin x + j \cos x

Now represent -1 as j^2.

\frac{dz}{dx} = j \cos x + j^2 \sin x = j\, (\cos x + j \sin x)

\frac{dz}{dx} = j\,z

\int \frac{1}{z}\, dz = \int j\, dx

\ln z = j\,x + C

Raise both sides to an exponent of e.

z = e^{j\,x} C

Letting x = 0 resolves the constant C to 1. Therefore,

z = e^{j\,x} = \cos x + j \sin x.

13.5.3. Numerical Verification of Euler’s Formula

If the derivation of Euler’s formula from the Maclaurin series didn’t convince you, we can try some numerical analysis to show that complex exponentials actually produce complex, sinusoidal functions.

We will use the definition of e^x from equation (13.4). We expect to see a circle in \mathbb{C}^2, just as we would by plotting \cos \theta + j\,\sin
\theta,\: 0 \leq \theta \leq 2\,\pi. The plot is shown in figure Fig. 13.4. In the following MATLAB script we just assign N to be a fairly large number. Since the definition uses a limit as N goes to infinity, the results become more accurate when a larger value for N is used.

% File: cmplxEuler.m
% let n = some big number
N = 100000;
z = linspace(0,2*pi); % test 100 numbers between 0 and 2*pi

% Now show that e^jz = cos(z) + j*sin(z)
% Begin with definition of value of e^z.
%    e^z = lim(N = infinity) (1 + z/N)^N
eulerValues = complex(1, z/N).^N;

% This should plot a unit circle, just like
% figure, plot( cos(z), sin(z));
figure, plot(real(eulerValues), imag(eulerValues));
axis equal tight
../_images/euler_circle.png

Fig. 13.4 Points along a complex unit circle—numerical verification of Euler’s formula.

13.5.4. Compound Interest

Another application of the number e relates to one way to calculate interest on loans or saving accounts.

Loans normally use simple interest to track the current principle. The interest paid at each payment is the product of the previous principle, the daily interest rate, and the number of days between payments. The interest is taken out of the payment and the remainder of the payment is applied to the principle.

\text{Simple interest} = P \times I \times N

Saving accounts normally use compound interest where the interest is calculated on the principal amount and also on the accumulated interest of previous periods, and can thus be regarded as “interest on interest.”

If you invest P dollars without continued contribution, then the balance of your savings after each compound (t) is described by

\text{Balance} = P\,\left(1 + \frac{I\,t}{N}\right)^N,

where I is the annual interest rate and N is the number of times that interest is compounded each year. If interest were compounded continuously, then we have

\text{Balance} = P\,e^{I\,t}.

If a loan uses compound interest, then the principle can grow multiple times between each payment depending on how often it is compounded. This results in the borrower paying much more over the life of the loan. Fortunately, automobile loans and home mortgages use simple interest. However, credit card debt and student loans are more likely to use compound interest.

The difference between simple and compound interest made for a humorous exchange between George Washington, first president of the United States, and his step son. Washington’s wife, Martha, was previously a widow to a wealthy man. One of Martha’s sons, John Parke Custis, was not very knowledgeable of business matters when he borrowed money at compound interest to purchase a plantation. When Washington learned of the terms of the loan, he wrote the following to his step son, “No Virginia estate (except a few under the best management) can stand simple interest. How then can they bear compound Interest?” [NtlArchive].

[1]The Maclaurin series for function f is the Taylor series for function f(a) about the point (a = 0).