# Exponential Integral

• June 2nd 2011, 05:08 AM
qformat
I was hoping to post in here another problem I solved to show what I've learned, but the test data I plug into my solution gives me unexpected results. I looked over it a dozen times.

This is supposed to evaluate the area under a curve between two points when the curve equation's variable is in the exponent. For example:

$y = a^x$

Such as in the formula for continuously compounded interest:

$A = Pe^{rt}$

where, P is the starting principal,
e is Euler's Number,
r is the annual interest rate (e.g. 0.1 is 10%),
and A is the balance after t years

So to find the area, I take what I presume is called the integral of its differential:

$\int_{p}^{q}(Pe^{rt})dx$

$\int_{p}^{q}\frac{Pe^{rt + 1}}{rt+1}$

$\left[\frac{Pe^{rq + 1}}{rq+1}\right] - \left[\frac{Pe^{rp + 1}}{rp+1}\right]$

Substitute simple data to check (P=1, r=0.0, p=0, q=2):

$\left[\frac{1e^{0 \cdot 2 + 1}}{0 \cdot 2+1}\right] - \left[\frac{1e^{0 \cdot 0 + 1}}{0 \cdot 0+1}\right]$

$\left[\frac{e^{1}}{1}\right] - \left[\frac{e^{1}}{1}\right]$

$Area = 0$

That's not right. Well, you see what I've learned. What am I doing wrong?
• June 2nd 2011, 05:18 AM
Ackbeet
I presume you actually mean

$\int_{p}^{q}Pe^{rt}\,dt.$

The antiderivative for the exponential function (as opposed to the polynomial function in your other thread) is completely different. Basically, every function has a different antiderivative. In this case, you get the following:

$\int_{p}^{q}Pe^{rt}\,dt=P\int_{p}^{q}e^{rt}\,dt=P \left[ \frac{e^{rt}}{r} \right]_{p}^{q}=P\,\frac{e^{rq}-e^{rp}}{r}.$
• June 2nd 2011, 06:41 AM
qformat
Quote:

Originally Posted by Ackbeet
I presume you actually mean

$\int_{p}^{q}Pe^{rt}\,dt.$

Uh..hehe, that makes sense.

It looks like it works! I spent a day on this, and Ackbar needs barely open one eye. I hope I don't bore this wonderful man (too much).

If you wanted to know, I'm using this to compute the total number of instructions the world could execute between two arbitrary years (based on the world's combined IPS (instructions per second) and growth rate in 2007).

Thanks
• June 2nd 2011, 06:45 AM
Ackbeet
Quote:

Originally Posted by qformat
Uh..hehe, that makes sense.

It looks like it works! I spent a day on this, and Ackbar

Ack! Not another user who intentionally mis-spells my username! I've already got topsquawk on my case.

Quote:

needs barely open one eye. I hope I don't bore this wonderful man (too much).

If you wanted to know, I'm using this to compute the total number of instructions the world could execute between two arbitrary years (based on the world's combined IPS (instructions per second) and growth rate in 2007).

Thanks
Interesting application. What's your final result, out of curiosity?
• June 2nd 2011, 06:53 AM
qformat
Ahah, sorry!

Quote:

Originally Posted by ackbeet
Interesting application. What's your final result, out of curiosity?

Alright, I'll post it in an hour or so after I rewrite my worksheet, plug in the data, update the script, and check the results.
• June 2nd 2011, 06:55 AM
Ackbeet
Quote:

Originally Posted by qformat
Ahah, sorry!

No need to apologize. The staff here at MHF go in for this sort of ribbing.

Quote:

Alright, I'll post it in an hour or so after I rewrite my worksheet, plug in the data, update the script, and check the results.
I'll stay tuned.
• June 2nd 2011, 06:57 AM
Ackbeet
Incidentally, WolframAlpha can compute lots of integrals, especially the more elementary ones. If you're just in need of some basic integrals, you might check that out.
• June 2nd 2011, 07:06 AM
qformat
Oh thanks, bookmarked. I'm rewriting my worksheet now, do you have a program to use this Latex syntax at home?
• June 2nd 2011, 07:14 AM
Ackbeet
Quote:

Originally Posted by qformat
Oh thanks, bookmarked. I'm rewriting my worksheet now, do you have a program to use this Latex syntax at home?

Yes, as do most mathematicians. I have GhostScript, GhostView, MiKTeX, and TextPad, installed in that order, on my machine. Other people I know, like CaptainBlack, use LyX. I don't know what other software you'd need in order to use LyX, but LyX seems like a good option as well. Generally, you need several ingredients for writing in LaTeX: the LaTeX distribution proper, a dvi viewer, and a text editor, preferably with syntax highlighting. Then you're good to go.
• June 2nd 2011, 10:29 AM
qformat
Wow. I'll have to install one. I've tried to do Calculus in Notepad++ on more than one occasion.

I finished! The formula I used was:

$TotalInstructions = aP\,\frac{e^{r(y_2 - Y)}-e^{r(y_1 - Y)}}{r}$

where $y_1$ is the starting year, $y2$ is the ending year, $P$ is the number is IPS (instructions per second) in year $Y$, $r$ is the continuously-compounded rate of IPS growth, $a$ is the number of seconds in a year (used to convert P to same unit as the other variables) (i.e. 86400 * 365.25 = 31557600).

Or, rather, since I'm including more than one type of hardware:

$TotalInstructions = aP_1\,\frac{e^{r_1(y_2 - Y)}-e^{r_1(y_1 - Y)}}{r_1}\,+\,aP_2\,\frac{e^{r_2(y_2 - Y)}-e^{r_2(y_1 - Y)}}{r_2}$

The data I'm using is:

$P_1$ = 2.06E17 (general-purpose hardware)
$P_2$ = 6.2E18 (application-specific hardware)
$r_2$ = 0.4574 (45.74% continuously-compounded growth rate; derived from 58% compound annual rate)
$r_2$ = 0.6206 (62.06% continuously-compounded growth rate; derived from 86% compound annual rate)
$Y$ = 2007 (the year the study was done)

I sourced my data from the following sites. Unfortunately, a quick search didn't turn up the original study:
World's total CPU power: one human brain
The Technological Brain Grows | Mother Jones

NOTE: IPS is not a determinant way to measure performance, as the amount of work a single instruction can do varies from architecture to architecture.

NOTE: The growth rates I used were the growth rates reported over the test period. More accurate growth rates may be able to be derived by combining test results from earlier studies.

Here is my:
Worksheet
C# Source Code (can be run directly with CS-Script, or compiled in Visual Studio or C# Express)