\chapter{The Exponential}

This module deals with a very important function: the exponential. The first question one might ask is: what is the exponential function $e^{\text {? }}$. We know certain values of the function such as $e^0=1$, but what about an irrational input such as $e^\pi$, or an imaginary input $e^{i}$  ? Is it possible to make sense of these values?


The following definition answers these questions.

\begin{minipage}[t]{\textwidth}
	\vspace{2mm}
\noindent\begin{tcolorbox}[colback=blue!25!white,colframe=blue!75!black]
The Exponential $e^x$
\begin{tcolorbox}[colback=blue!5!white,colframe=blue!75!black]
$$
\begin{aligned}
	& e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\cdots \\
	& =\sum_{k=0}^{\infty} \frac{x^k}{k!} \text {, } \\
\end{aligned}
$$
where $k!=k(k-1)(k-2) \cdots 3 \cdot 2 \cdot 1$, and $0!=1$.

\end{tcolorbox}
\end{tcolorbox}
\vspace{2mm}
\end{minipage}

One can now plug values for $x$ into the above sum to compute $e^x$. When $x=0$, for instance, one finds that $e^0=1$, (since all the terms with $x$ disappear) as expected. By plugging in $x=1$, the true value of $e$ is found to be $e=1+1+\frac{1}{2!}+\frac{1}{3!}+\cdots$.

\section{A long polynomial}
There are technical concerns when trying to add up an infinite number of things. These issues will be dealt with later in the modules on series. For now, treat the infinite sum above as a long polynomial (the actual term is the Taylor series about $x=0$, which will be more formally dealt with in the \textcolor{red}{next module}). Polynomials are nice because they are easy to integrate and differentiate. Recall the power rule for differentiating and integrating a monomial $x^k$, where $k$ is a constant:
$$
\begin{aligned}
	\frac{d}{d x} x^k & =k x^{k-1} \\
	\int x^k d x & =\frac{1}{k+1} x^{k+1}+C \quad(k \neq-1)
\end{aligned}
$$

\section{Properties of $e^x$}
Recall the following properties of the exponential function:

\begin{enumerate}
\item $e^{x+y}=e^x e^y$
\item $e^{x \cdot y}=\left(e^x\right)^y=\left(e^y\right)^x$
\item $\frac{d}{d x} e^x=e^x$
\item $\int e^x d x=e^x+C$.
\end{enumerate}

Consider the last two properties in terms of the long polynomial.Taking the derivative of the long polynomial for $e^x$ gives

$$
\begin{aligned}
	\frac{d}{d x}\left(1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\cdots\right) & =0+1+\frac{2 x}{2!}+\frac{3 x^2}{3!}+\frac{4 x^3}{4!}+\cdots \\
	& =1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots
\end{aligned}
$$
which is the original long polynomial. Integrating also gives (up to the constant of integration) the original long polynomial. This agrees with facts about the derivative and integral of $e^x$. Thus, the long polynomial for $e^x$ captures two of the key features of $e^x$; namely, $e^x$ is its own derivative and its own integral.

\section{Euler's formula}
Recall that the imaginary number $i$ is defined by $i=\sqrt{-1}$. So $i^2=-1, i^3=-i, i^4=1$, and this continues cyclically (for a review of complex/imaginary numbers, see wikipedia). Assume the following fact, known as Euler's formula, mentioned in the last module.


\begin{minipage}[t]{\textwidth}
	\vspace{2mm}
\noindent\begin{tcolorbox}[colback=blue!25!white,colframe=blue!75!black]
	Euler's Formula
	\begin{tcolorbox}[colback=blue!5!white,colframe=blue!75!black]
		$$
		e^{i x}=\cos x+i \sin x
		$$
	\end{tcolorbox}
\end{tcolorbox}
\vspace{2mm}
\end{minipage}

Consider what happens when $i x$ is plugged into the long polynomial for $e^x$. By simplifying the powers of $i$, and grouping the result into its real and imaginary parts, one finds
$$
\begin{aligned}
	e^{i x} & =1+i x+\frac{(i x)^2}{2!}+\frac{(i x)^3}{3!}+\cdots \\
	& =1+i x+\frac{i^2 x^2}{2!}+\frac{i^3 x^3}{3!}+\cdots \\
	& =1+i x-\frac{x^2}{2!}-i \frac{x^3}{3!}+\frac{x^4}{4!}+i \frac{x^5}{5!}+\cdots \\
	& =\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}-\cdots\right)+i\left(x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots\right) .
\end{aligned}
$$

If this is supposed to equal $\cos x+i \sin x$, then the real part must be $\cos x$, and the imaginary part must be $\sin x$. It follows that
$$
\begin{aligned}
	& \cos x=1-\frac{x^2}{2!}+\frac{x^4}{4!}-\frac{x^6}{6!}+\cdots=\sum_{k=0}^{\infty}(-1)^k \frac{x^{2 k}}{(2 k)!} \\
	& \sin x=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\cdots=\sum_{k=0}^{\infty}(-1)^k \frac{x^{2 k+1}}{(2 k+1)!} .
\end{aligned}
$$

These formulas should be memorized, both in their long polynomial form and their more concise summation notation form.

\subsection*{Example}
Use Euler's formula to show that $e^{i \pi}=-1$. \hyperref[ExponentialsAnswer1]{Answer}
\subsection*{Example}
Compute $1-\frac{\pi^2}{2!}+\frac{\pi^4}{4!}-\cdots$.  \hyperref[ExponentialsAnswer2]{Answer}
\subsection*{Example}
Check that taking the derivative of the long polynomial for $\sin x$ gives the long polynomial for $\cos x$ (hence, verify that $\frac{d}{d x} \sin x=\cos x$ ).  \hyperref[ExponentialsAnswer3]{Answer}

\subsection*{Example}
Show that the long polynomial for $e^x$ satisfies the first property above, namely $e^{x+y}=e^x e^y$. Hint: start with the long polynomials for $e^x$ and $e^y$ and multiply these together, and carefully collect like terms to show it equals the long polynomial for $e^{x+y}$.  \hyperref[ExponentialsAnswer4]{Answer}


\section{More on the long polynomial}
The idea of a long polynomial is reasonable, because it actually comes from taking a sequence of polynomials with higher and higher degree:
$$
\begin{aligned}
	& f_0(x)=1 \\
	& f_1(x)=1+x \\
	& f_2(x)=1+x+\frac{x^2}{2} \\
	& f_3(x)=1+x+\frac{x^2}{2}+\frac{x^3}{6} \\
	& \vdots
\end{aligned}
$$

Each polynomial in the sequence is, in a sense, the best approximation possible of that degree. Put another way, taking the first several terms of the long polynomial gives a good polynomial approximation of the function. The more terms included, the better the approximation. This is how calculators compute the exponential function (without having to add up infinitely many things).	

\begin{figure}[h]
	\centering
	\includegraphics[width=0.7\linewidth]{ExponentialApproximants}
%	\caption{}
	\label{fig:exponentialapproximants}
\end{figure}

\section{EXERCISES}
\begin{itemize}
	
	\item[\textcolor{red}{\tikzcircle{3pt}}] So, how good of an approximation is a polynomial truncation of $e^{\text {? }}$. Use a calculator to compare how close $e$ is to the linear, quadratic, cubic, quartic, and quintic approximations. How many digits of accuracy do you seem to be gaining with each additional term in the series?
\end{itemize}
%- 
%- Now, do the same thing with $1 / e$ by plugging in $x=-1$ into the series. Do you have the same results? Are you surprised?
%- Calculate the following sum using what you know:
%$$
%\sum_{n=0}^{\infty}(-1)^n \frac{(\ln 3)^n}{n!}
%$$
%- Write out the first four terms of the following series
%$$
%\sum_{n=0}^{\infty}(-1)^n \frac{\pi^{2 n}}{2^n n!}
%$$