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:

$\displaystyle y = a^x$

Such as in the formula for continuously compounded interest:

$\displaystyle 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:

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

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

$\displaystyle \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):

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

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

$\displaystyle Area = 0$

That's not right. Well, you see what I've learned. What am I doing wrong?