# Trigonometry/Power Series for e to the x

## Compound interestEdit

What function satisfies

$\displaystyle f(x)=f'(x)$ ?

That is, for what function is the rate of growth equal to the current value?

This kind of relationship where the rate of growth is proportional to the current value is the relationship underlying compound interest. If you're receiving compound interest on a sum of money and reinvest the income, the amount you get in a fixed time is proportional to the amount of money that you have at the start of that time. If you start with 2 units it goes to 4, then 8 then 16 then 32 and so on. So is

$\displaystyle f(x) = 2^x$

a good candidate for a function that satisfies the differential equation? If we approximately evaluate the slope at $\displaystyle x=0$ we get about 0.69. Some expression like $\displaystyle 2^x$ looks promising, but 2 is too small a constant.

$\displaystyle f(x) = 3^x$

We find the slope at zero is about 1.09. 3 is too large a constant, but not by much. If this is going to work for some number $\displaystyle k$ so that $\displaystyle f(x)=k^x$ we will want that number to be between 2 and 3. We're not saying that it is possible, just that it looks a promising avenue to explore. It will turn out that there is a number that works.

## Power SeriesEdit

We can try a completely different approach, as if we didn't know that raising some number to the power of $\displaystyle x$ is a good thing to try.

Suppose that $\displaystyle f(x)$ could be expressed as a power series, in terms of $\displaystyle x,x^2,x^3...$ that is that:

$\displaystyle f(x) = a_0 + a_1x + a_2x^2 + a_3x^3 + a_4x^4 + \cdots$

Then differentiating term by term, assuming that this all makes sense, we'd have:

$\displaystyle f'(x) = a_1 + 2a_2x + 3a_3x^2 + 4a_4x^3 +5a_5x^4 + \cdots$

For the differential relation to hold, equating corresponding coefficients term by term we'd need:

$\displaystyle a_1=a_0, a_2=\frac{a_1}{2}, a_3=\frac{a_2}{3}, a_4=\frac{a_3}{4}, a_5=\frac{a_4}{5}$

And this will be so if we put :

$\displaystyle a_0=1, a_1=1, a_2=\frac{1}{2!}, a_3=\frac{1}{3!}, a_4=\frac{1}{4!}, a_5=\frac{1}{5!}$

Where $\displaystyle 4!$ is the factorial function and means $\displaystyle 1\times 2\times 3\times 4$ and similarly for other values.

In other words:

$\displaystyle f(x) = 1 + {x \over 1!} + {x^{2} \over 2!} + {x^{3} \over 3!} + \cdots$

We now have to check that this formula makes some kind of sense.

## ConvergenceEdit

The main problem is that we have an infinite sum. A sum like 1 + 3 + 9 + 27 + 81 +... is unbounded. Even a sum like 1+1+1+1+1+... would be a problem for us. On the other hand, some sums are OK. If we look at

$\displaystyle 1 + \frac{1}{2} + \frac{1}{4} + \frac{1}{8} + \frac{1}{16} + \frac{1}{32} +\cdots$

We can see this is well behaved, and if we go far enough it gets as close to 2 as we like.

Let us put $\displaystyle x=10$ in

$\displaystyle f(x) = 1 + {x \over 1!} + {x^{2} \over 2!} + {x^{3} \over 3!} + \cdots$

At first this does not look very promising.

$\displaystyle f(10) = 1 + {10 \over 1!} + {100 \over 2!} + {1000 \over 3!} + \cdots$
$\displaystyle f(10) = 1 + 10 + 50 + 166.666 + \cdots$

The terms are getting bigger, and we appear to be in a worse situation than 1+1+1+1+1+...

However, we are being too hasty. Whilst in each term the numerator is $\displaystyle x^n$ the denominator is $\displaystyle n!$. The amount the numerator is multiplied by as we move right one term is x, which is 10 in our case. The amount by which the denominator is being multiplied as we move right one term is however increasing. By the time we get to the twenty first term we have $\displaystyle 10^{20}$ divided by $\displaystyle 20!$. The numerator of the next term is 10 times bigger and the denominator is 21 times bigger. So from the 22nd term onwards each term is less than half the size of the term before it!

With $\displaystyle x=10$, the sum of all the terms from the 22nd term onwards is not going to go off to infinity. In fact that sum must be less than twice the twenty second term. If we add in the first twenty one terms too, we are still not going to go off to infinity.

We have just shown that if we plug the value $\displaystyle x=10$ into the equation we get a finite sum, and the sum makes sense. It might be some work to calculate it, but we can get as close as we like by going far enough along the sum. That wouldn't be so if the sum went off to infinity. Almost exactly the same argument works for $\displaystyle x=100$ or any other positive value we choose, though for larger values we have to go further before the terms start halving or better.

Negative values of x also work, but introduce a very slight technical complication. One way to handle it is to rely on the alternating sum:

$\displaystyle 1 - \frac{1}{2} + \frac{1}{4} - \frac{1}{8} + \frac{1}{16} - \frac{1}{32} +\cdots$

being well behaved. It sums to $\displaystyle\frac{2}{3}$, or in other words we can get as close as we like to the value $\displaystyle\frac{2}{3}$ by going far enough.

What we have just seen is that the formula:

$\displaystyle f(x) = 1 + {x \over 1!} + {x^{2} \over 2!} + {x^{3} \over 3!} + \cdots$

Makes sense for all values of x, whether positive or negative. It also makes sense for x=0 when it evaluates to 1.

## Does Differentiation Term by Term Make Sense?Edit

If

$\displaystyle f(x) = 1 + {x \over 1!} + {x^{2} \over 2!} + {x^{3} \over 3!} + \cdots$

Does it make sense to differentiate it term by term and write:

$\displaystyle f'(x) = 0 + 1 + {x \over 1!} + {x^{2} \over 2!} + \cdots$

Notice that what we have done here is, for example, differentiate $\displaystyle x^3$ to $\displaystyle 3x^2$ and then cancel the 3 with a 3 in the '3!' to make it '2!'.

Certainly if we take the first 1000 terms of $\displaystyle f(x)$, then we just have a polynomial, and differentiating the polynomial term by term is fine. We'll then have the first 999 terms of what we claim is $\displaystyle f'(x)$. Unfortunately we have to be a little careful. Just because our error in approximating f(x) is small it does not immediately follow that our error in estimating f'(x) is small too.

 Small function with big derivative Consider the function $\displaystyle g(x)=\frac{\sin(\frac{1}{x})}{10,000}$ Because $\displaystyle 1 \le \sin x \le 1$ the function is small, but close to x=0 its derivative gets very big. Use the chain rule to differentiate g(x) and calculate its derivative for x is one millionth. Can g'(x) be more than a million times bigger than g(x) for this function?

## Exponential functionEdit

missing proper intro

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