Understanding exp(x) easily
May 19, 2021$e^x$ is a bit of a strange function. It comes up so often in a wide variety of mathematical contexts, yet its origin is so mysterious. Where does it come from? Why is it so useful? I have enjoyed partially discovering the answer to these question while working through my differential equations course.
The discovery of $e^x$ could begin with the following question, which you could reasonably pose just after learning about derivatives. "Is there any function whose derivative is equal to itself?
And if you had gone about answering that question just after learning about derivatives, you may start your discovery looking for a polynomial whose derivative is itself, because you are probably only taking derivatives of polynomials if you've just learned about it.
So let's consider what kind of polynomial would be its own derivative. A polynomial is in the form of $a + bx + cx^2 + dx^3 + ex^4 \ldots$ To create a polynomial, we just decide what value each of those coefficients takes. So let's do that then.
If that polynomial's derivative is equal to itself, we can just take the derivative of the polynomial and set it equal to the original polynomial.
$a + bx + cx^2 + dx^3 + ex^4 + \ldots = b + 2cx + 3dx^2 + 4ex^3 + \ldots$
And seeing this, a (gnarly) system of equations falls out.
$b = 2c$
$c = 3d$
$d = 4e$
Unfortunately, we are a little stuck. Sure, we know that $b = 2c$, but $c$ is equal to another variable who is equal to another variable who is equal to another variable who is... We aren't any more equipped to solve this problem. What do we do?
One nice property is that $a$ is only related to one other variable ($b$), whereas all other variables are related to the ones before and after it. This makes $a$ a nice variable to tinker with.
If we just arbitrarily set $a$ to something, let's say $a = 1$, what falls out?
$b = 2c,\, \frac{1}{2} = c$
$c = 3d,\, \frac{1}{2 \cdot 3} = d$
$d = 4e,\, \frac{1}{2 \cdot 3 \cdot 4} = e$
And a pattern emerges. Our coefficients go $\frac{1}{1}$, $\frac{1}{2}$, $\frac{1}{2 \cdot 3}$, $\frac{1}{2 \cdot 3 \cdot 4}$. And we can pick out the pattern out from that. Each term is equal to $\frac{1}{n!}$, where $n$ is the index of each fraction. So the first one has $n=1$, the second one has $n=2$ and so on.
Let's plug those coefficients back into our original polynomial. The function that we have discovered/built is: $1 + x + \frac{x^2}{2} + \frac{x^3}{2 \cdot 3} + \frac{x^4}{2 \cdot 3 \cdot 4} + \ldots$
And we arrived at this because we started with a generic polynomial $a + bx + cx^2 + dx^3 + ex^4 + \ldots$ And asked what the coefficients had to be if the function's derivative would be equal to itself. We decided that each coefficient was equal to $\frac{1}{n!}$.
And this makes sense. When you take the derivative of any term, one of the factors in the denominator will cancel the power. So the power of $x$ in each term decreases by one, and you lose the biggest factor from the denominator, so the derivative of each term will become the term to its left.
You take a derivative and $\frac{x^2}{2}$ goes to $x$.
$\frac{x^3}{2 \cdot 3}$ goes to $\frac{x^2}{2}$.
$\frac{x^4}{2 \cdot 3 \cdot 4}$ goes to $\frac{x^3}{2 \cdot 3}$.
And because this polynomial goes on forever, we always have a term that can slide to the left when you take a derivative.
Out of curiousity, let's graph this magic function. What could this possibly look like?
Funnily, this graph actually looks kind of familiar. It looks pretty close to an exponential function. That's just a guess though, let's test a whole bunch of them and see. In fact, why don't you try? Move the slider to test different bases of the exponent (your function is graphed in red)
As you can see, $2.72^x$ just kinda happens to approximate our magic polynomial. This is a somewhat unfortunate coincidence. On one hand, we can more easily compute values of this function that we've created, but it also removes all the context. We've sacrificed clarity for brevity.
We can help give a little context by giving this value, 2.72, a name. Let's call it $e$, because it created our magical $e$xponential function.
So hopefully the dots are more connected now. The number $e$ is actually an approximation of the polynomial we built whose derivative is equal to itself. We care about $e$ because that property is special and useful.
In fact, the guy that asked this question and found this value in the first place actually discovered it because it was needed to solve a problem using that special and useful property.
Whenver you see $e$ pop up, it's frequently in a textbook babbling on about compound interest. And at first I always thought this was just the boring, invented justification to motivate the reader to learn about $e$, but as it happens, the guy that discovered this number was thinking about compound interest, which is what led to his discovery.
The idea behind compound interest is that if you invest \$100, and that investment gains 2% value every year, you get that extra 2% on all of your past earnings, too. So the first month you get \$2, because that's 2% of 100, but the second month you get $2.04, which is 2% of your hundred dollars plus 2% of your \$2 from last month.
So you may reasonably ask, how much money will I make this year? It's not as simple as saying that I gain \$2 per month, because you add that money back into your account, which you earn that 2% on as well. So the rate at which you gain money is dependent on the value in your account. In other words, $f'(x) = 0.02f(x)$. Where $f(x)$ is the amount of money you have after $x$ months.
And in order to figure out how much money you have, we need to find a function whose derivative is equal to itself (times 0.02). Well we just did all of that work, and that function is the long polynomial that happens to be approximated by $e^x$.
But wait, the derivative of $e^x$ is $e^x$, not $0.02e^x$. We wanted a function whose derivative is equal to itself times 0.02. If we exploit some properties of exponents, we know that $e^{0.02x}$ satisfies this, but what does that have to do with our polynomial?
Let's try to invent another polynomial again. This time, we want $f(x) = 0.02f'(x)$. So let's set up the equation again:
$a + bx + cx^2 + dx^3 + ex^4 + \ldots = 0.02(b + 2cx + 3dx^2 + 4ex^3 + \ldots)$
And our system is:
$b = 0.02 \cdot 2c$
$c = 0.02 \cdot 3d$
$d = 0.02 \cdot 4e$
$b = 0.02 \cdot 2c,\, c = \frac{1}{0.02^2 \cdot 2}$
$c = 0.02 \cdot 3d,\, d = \frac{1}{0.02^3 \cdot 2 \cdot 3}$
$d = 0.02 \cdot 4e,\, e = \frac{1}{0.02^4 \cdot 2 \cdot 3 \cdot 4}$
And because the power of the $0.02$ in the denominator is the same as the power of $x$, we can simplify each term to being $\frac{1}{n!} \left(\frac{x}{0.02}\right)^n$
And if we were to graph this function, we would see that it is approximated by $e^{0.02x}$, which is exactly what we want. The polynomial representation lines up with the exponential approximation perfectly.
While we're playing with this polynomial, we have one more knob to turn. We've been setting $a=1$ the whole time. What gives? Well if we set $a$ to any other number, maybe 2, then every coefficient would gain a two, because all coefficients are equal to $a$ divided by something. So we can scale this polynomial by just fixing a value of $a$ to whatever scaling factor we want. This means that for any choice of $a$, the exponential representation of the polynomial is $ a e^x $. The derivative is still itself, but the function gets scaled by some constant.
This property is (kind of) the foundation for differential equations. The whole purpose of that field is to solve functions that are defined by their derivative. Just like earlier, $f'(x) = 0.02f(x)$, because you got 2% of your bank account back each month. There are many other times in physics (temperature, water pressure, newtonian mechanics) where it can be easier to define how a system is changing, instead of knowing the total values of everything.
And the reason that $e^x$ comes up in those situations is because the derivative of $e^x$ is $e^x$. Including an $e^x$ somewhere is the only way you can solve a problem where $f(x)$ should be equal to its derivative in any capacity. (Except for sin and cos, which are also secretly exponentials. This is a story for either another time, or a 3blue1brown video)
And that's a pretty big takeaway from differential equations, that the solutions to differential equations can only be functions that have something to do with $e^x$. That fact comes up pretty readily, you don't need to understand where $e^x$ comes from, but it's always nice to know why that is; you need a function whose derivative is itself, you can invent a polynomial who has that property, and for ease of use you can approximate it by an exponential, which you can name $e^x$