\documentclass{amsart}[11pt]
\usepackage{graphicx}

\addtolength{\textwidth}{1.4in}                          
\oddsidemargin=0in                          
\evensidemargin=0in       

\newtheorem{example}{Example} 
\newtheorem{question}[example]{Question}
\newtheorem{definition}[example]{Definition}
\newtheorem{theorem}[example]{Theorem}
\newtheorem{notation}[example]{Notation}
\newtheorem{fact}[example]{Fact}

\begin{document}

\title{Math 241, Lecture 5}
\maketitle


\section{ Compound interest and the exponential base $e$}  

Let's review how compounding interest works in different settings. 
\begin{itemize}
\item When making a loan to a good friend, you charge no interest.  
(If you loan $P$, you get back $P$).  
\item A personal loan between strangers often has a one-time interest charge.  
If $P$ dollars is loaned, $P + rP$ dollars is paid back, where $r$ is the interest
rate.     For example, $\$100$ loaned with a one-time $7\%$ rate is repaid
as $100 + 0.07 \times 100 = 107$ dollars.    It will be helpful to rewrite
$P + rP$ as $P(1+r)$.  
\item Some loans/investments accrue interest yearly.    In these cases, one
is paying/earning interest on top of interest.    For example, after two years
of $7\%$ interest, $\$100$ becomes $[100\times (1.07)] \times (1.07) = 114.49$ dollars.  
(in this case, the $49$ cents is the interest on top of interest).  
In general, if for a principal of $P$, the value after $n$ years will be
$P(1+r)^n$.    Note that interest on top of interest becomes much more significant
as $n$ gets larger.
\item In order to be more sensitive to when transactions are made, it makes sense
to compound interest more frequently.     To compound things monthly,
we would charge an interest of $\frac{r}{12}$ each month, resulting in a total return 
of $P(1+\frac{r}{12})^{n}$, where $n$ is the number of months.    Note that 
the total for $n= 12$, which is a year, will be greater than if an interest 
of $r$ percent is changed once.  
To compound interest every day would result in a total of $P(1 + \frac{r}{365})^n$,
after $n$ days, for $P(1+\frac{r}{365})^{365}$ after a year.  
\item We could even compoud every hour, every minute, etc.  The general formula
is that after a year one has $P(1 + \frac{r}{N})^N$, if one compounds $N$ times.   
For a fraction $q$ of a year (such as $\frac{1}{2}$ for six monts), the formula
is $P(1 + \frac{r}{N})^{qN}$.    For example, if one compounds $5\%$ yearly interest every
day, then after $6$ months $\$100$ becomes $100(1 + \frac{0.05}{365})^{182} = \$102.53$  
\item Theoretically, we can compound {\em continuously} by taking the limit as $N$ goes to $\infty$
in the formula above.    For example, suppose we invest $\$1$ with yearly interest
of $100\%$, so that $r = 1$.  
%If the interest is not compounded, at the end of a year there would be $\$1$.  
How much would there be if the interest is compounded continuously?  
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|}     \hline
$N$ &  1 & 2 &10 &100 & 1000 & 100000 \\ \hline
$(1 + \frac{1}{N})^N$ & 2 & 2.25 & 2.594 & 2.705 & 2.71815 & 2.71827\\
\hline
\end{tabular}
\end{center} 
%  The first entry is what there would be if there were no compounding of interest, namely $\$2$. 
   In the limit, the answer to this question is the magic number $e$, whose value is approximately
$2.71828$.  
\end{itemize}

\begin{theorem}
In general, if $P$ dollars are invested at an annual rate of $r \times 100$ percent, then
the balance $B(t)$ after $t$ years is $P e^{r t}$ dollars.  
\end{theorem}

The number $e$ is called the natural base for exponentiation, since it occurs raised to a
power in problems from almost every quantitative subject.  

\begin{example}
What are you paying out to the credit card company if you have a $\$1000$ balance 
at a $19\%$ APR compounded continuously, which you finally pay after two years?
\end{example}

\begin{example}
Find the value of $\$ 325,000$ after $1$ year with $7\%$  interest compounded yearly, monthly,
daily and continuously.   (Ans: 347750; 348494.28;  348562.82; 348565.16)  
\end{example}

\begin{example}
What would you need to deposit in the bank at a 3\% interest rate in order to have 
\$40K in the bank ten years from now?   (This kind of calculation is called a 
{\em present value} calculation).  
\end{example}


\section{ Logarithmic functions}  

Many common functions arise through ``undoing'' basic functions  
(more formally, we say they are inverses of basic functions).  
For example, subtraction was invented as the inverse of addition,  
division as the inverse of multiplication,   and the square root
as the inverse of the squaring function.  

\begin{definition}
The inverse of the exponential function $a^x$ is called the
logarithm function (with a base of $a$) denoted $\log_a(x)$.    
By this definition, $\log_a a^x = x$ and $a^{\log_a x} = x$.  
The logarithm with a base of $e$ is called the natural log function
and is denoted $\ln(x)$.  
\end{definition}

\begin{example}
\begin{itemize}
\item $\log_{10} 10000 = 6$ because $10^6 = 100000$.  
\item $\log_{2} \frac{1}{8} = -3$ because $2^{-3} = \frac{1}{8}$.  
\item $\ln \sqrt{e} = \frac{1}{2}$ because $e^{\frac{1}{2}} = \sqrt{e}$.  
\end{itemize}
\end{example}

The properties of the logarithm function follow from those of the exponential
function.  

\begin{itemize}
\item $\log_a(xy) = \log_a x + \log_a y$   follows from $a^{x+y} = a^x a^y$.  
\item $\log_a x^y = y \log_a x$   follows from $(a^x)^y = a^{xy}$.  
\item $\log_b x = \log_b a \cdot \log_a x$    follows from the previous property.
\end{itemize}

In other words, logarithms turn multiplication to addition and turn exponentiation
to multiplication.    Also note that the last property says that logarithms with
different bases are related by multiplication by a constant.  

Logarithms are handy in problems involving exponentials.  

\begin{example}
A radioactive material decays at a rate of $0.5\%$ per year.  
How long would it take for half of the material to decay?  
\end{example}

Because of these properties,  logarithms played an important role in nerd
history -   before calculators, nerds always carried slide rules because  
slide rules calculate logarithms,
which may be used to do long calculations by hand.   


\begin{example}
Use logarithms to calculate: 
$365 \times 843$   %      $\log_{10} 365 = 2.5623$   $\log_{10} 843 = 2.9258$  
%Their sum is $5.4881$.    $10^{5.4881} = 3076801.52$.    The real answer is $307695$.  
% \item $12^7$     % $\log_{10} 12 = 1.07918$.    Multiply by $7$ to get $7.55426$.  Raising $10$
%to this power gives  $35831088$.     The real answer is $35831808$.  
\end{example}


\end{document}
 