- #1
- 2,570
- 2
I'm trying to approximate an integral of the form:
[tex]\int_0^{r_0} r^4 e^{-r/a} dr [/tex]
where r0<<a. I figured I could write out the first few terms of the expansion of the exponential and integrate that, since the extra terms would quickly become negligible:
[tex] \int_0^{r_0} r^4 (1-\frac{r}{a}) dr [/tex]
However, when I calculate this answer and compare it to the exact answer from mathematica, the error gets bigger the smaller r0/a gets. I can't figure out why. Specifically, with a few extra terms with the same form, but different powers of r, and r0/a of the order 10^-5, my approximated integral comes out to be about 10^-10 while the exact value is about 0.02. Could this be numerical error? I told it to algebraically come up with the ratio of the approximation and the exact integral, and there were 1/r^5 and 1/r^6 terms, but I can't figure out where they're coming from. Even as I add more terms to the taylor approximation, the answer barely changes.
[tex]\int_0^{r_0} r^4 e^{-r/a} dr [/tex]
where r0<<a. I figured I could write out the first few terms of the expansion of the exponential and integrate that, since the extra terms would quickly become negligible:
[tex] \int_0^{r_0} r^4 (1-\frac{r}{a}) dr [/tex]
However, when I calculate this answer and compare it to the exact answer from mathematica, the error gets bigger the smaller r0/a gets. I can't figure out why. Specifically, with a few extra terms with the same form, but different powers of r, and r0/a of the order 10^-5, my approximated integral comes out to be about 10^-10 while the exact value is about 0.02. Could this be numerical error? I told it to algebraically come up with the ratio of the approximation and the exact integral, and there were 1/r^5 and 1/r^6 terms, but I can't figure out where they're coming from. Even as I add more terms to the taylor approximation, the answer barely changes.