5

On the MIT $2021$ Integration Bee Qualifying Exam, it asked to approximate $$ \int_{0}^{\pi}{\rm e}^{{\rm e}^{x}}\,{\rm d}x $$ I got $\displaystyle{\rm e} + {\rm e}^{\rm e} + {\rm e}^{{\rm e}^{2}} + {\rm e}^{{\rm e}^{3}}$, which is about $4\ \%$ off the exact answer. How do I make a better approximation ( given the fact that you have graphing paper and no calculators allowed ) $?$.

Felix Marin
  • 89,464
Kamal Saleh
  • 6,497
  • 5
    How did you find the formula $(e^e+e^{e^2}+2e^{e^3})/2$? – NN2 Nov 16 '22 at 22:47
  • Given that $e^{e^x}$ seems fast-changing, I wonder if it would be useful to rewrite it in terms of the integral of the inverse function, i.e. $\pi e^{e^\pi} - \int_e^{e^{e^\pi}} \log(\log y),dy$, and then approximate that where the integrand is very slowly varying - though over a large interval, which is why I'm not sure if that approach will be useful. – Daniel Schepler Nov 16 '22 at 22:47
  • @NN2 Oops need to change that. – Kamal Saleh Nov 16 '22 at 22:57
  • @DanielSchepler good idea! If you make this an answer I will accept it. – Kamal Saleh Nov 16 '22 at 23:41
  • FWIW, the numerical answer (to the nearest IEEE double) is 507773581.59012914. – Dan Nov 18 '22 at 21:33

3 Answers3

13

Performing the change of variables $t=\mathrm{e}^x$, using the fact that the exponential integral grows exponentially, and using the first two terms of its asymptotic expansion, $$ \int_{1}^{{\rm e}^\pi } {\frac{{{\rm e}^t }}{t}{\rm d}t} = {\mathop{\rm Ei}\nolimits} ({\rm e}^\pi ) - {\mathop{\rm Ei}\nolimits} (1) \approx {\mathop{\rm Ei}\nolimits} ({\rm e}^\pi ) \approx {\rm e}^{{\rm e}^\pi - \pi } + {\rm e}^{{\rm e}^\pi - 2\pi } \approx 5.056757609 \cdot 10^8 . $$ The relative error is about $0.415\%$. Adding one more term ($+2{\rm e}^{{\rm e}^\pi - 3\pi }$) would reduce the relative error to about $0.0566\%$. (Note that ${\mathop{\rm Ei}\nolimits} (1) \approx 1.895$ is indeed negligible.)

Gary
  • 31,845
8

The substitution $$t = \exp \exp x, \qquad dt = \exp (x + \exp x) \,dx ,$$ gives $$\int_0^\pi \exp \exp x \,dx = \int_e^{\exp\exp\pi} \frac{dt}{\log t} ,$$ and then applying integration by parts yields $$\int_e^{\exp\exp\pi} \frac{dt}{\log t} = \left.\frac{t}{\log t}\right\vert_e^{\exp\exp \pi} + \int_e^{\exp\exp \pi} \frac{dt}{\log^2 t} = \frac{\exp \exp \pi}{\exp \pi} - e + \int_e^{\exp\exp \pi} \frac{dt}{\log^2 t}.$$ The integrand of this latter integral decays much more rapidly than the integrand of the original integral in $t$, so we expect that $\int_e^{\exp\exp \pi} \frac{dt}{\log^2 t} \ll \int_e^{\exp\exp\pi} \frac{dt}{\log t}$ and hence that the original integral has value $$\int_0^\pi \exp \exp x \,dx \approx \frac{\exp \exp \pi}{\exp \pi} .$$ This approximation turns out to have value $\approx 4.84729 \cdot 10^8$, whereas the original integral has value $\approx 5.07774 \cdot 10^8$, a relative error of $\approx -4.5\%$.

For a better approximation, we can apply integration by parts again to give $$\int_e^{\exp\exp \pi} \frac{dt}{\log^2 t} = \frac{\exp \exp \pi}{\exp 2 \pi} - e+ 2 \int_e^{\exp\exp \pi} \frac{dt}{\log^3 t}$$ and hence the first approximation, $$\int_0^\pi \exp \exp x \,dx \approx \frac{\exp \exp \pi}{\exp \pi} + \frac{\exp \exp \pi}{\exp 2 \pi} = \frac{\exp \exp \pi}{\exp \pi}\left(1 + \frac{1}{\exp \pi}\right) \approx 5.05676 \cdot 10^8,$$ from Gary's good answer, which again has relative error $\approx -0.41\%$. In fact, continuing to apply integration by parts yields the asymptotic expansion of the exponential integral, $\operatorname{Ei}(x)$, whose truncation was used in that answer.

The original question from the bee, by the way, asks you to report your estimate in scientific notation. Since you don't have a calculator available, here's a quick way to do so by hand using the first approximation above: Using the well-known and surprisingly good approximation $\exp \pi \approx 20 + \pi$ (relative error $\approx 0.0039\%$), we get $$\int_0^\pi \exp \exp x \,dx \approx \frac{\exp\exp\pi}{\exp \pi} \approx \frac{\exp(20 + \pi)}{\exp \pi} = \exp 20 .$$ Now using the well-known approximations $\log 10 \approx 2.3$ (relative error $\approx -0.11\%$), equivalently $\log (10^{10}) \approx 23$, and $e^3 \approx 20$ (relative error $\approx -0.42\%$) thus gives $$\int_0^\pi \exp \exp x \,dx \approx \exp 20 = \frac{\exp 23}{\exp 3} \approx \frac{10^{10}}{20} = 5 \cdot 10^8,$$ which turns out to have a relative error of $\approx -1.5\%$.

Travis Willse
  • 99,363
1

I am not sure if the answer supposed to be this, but:

$$ \int_0^\pi e^{e^x} dx = \int_0^\pi \sum_{k \ge 0} \dfrac{e^{kx}}{k!} dx = \sum_{k \ge 1} \dfrac{e^{k\pi} - 1}{k \cdot k!} = S_1 - S_2 $$

For $S_1$ and $S_2$ you can approximate it with exponential integral.

openspace
  • 6,470
  • 2
    This very slowly converges, it takes a lot of terms to get a good approximation. In the competition you have no calculator. – Kamal Saleh Nov 16 '22 at 21:35
  • @KamalSaleh How well do you need to approximate it? How do you know your own answer id $4$% off without calculator? – Gary Nov 16 '22 at 22:51
  • 2
    @Gary First I pretended to be a student then a pretended to be the person testing the approximation. – Kamal Saleh Nov 16 '22 at 22:56