15

I am working on a few problems from Arnold's trivium because I hate myself.

My first and only idea is to try and approximate this by Riemann sums, but this is of course disgusting. For overestimate (right Riemann sum of increasing function) of $3$ points we have $$ \sum_{n=1}^3 f(1+3n)\frac{1}{3}=\frac{1}{3}(4^4+7^7+10^{10})\approx 10^{9} $$ Which I had to use a calculator to figure out (sorta defeating the point of the exercise, I guess) has relative error of 8%.

Is there a more clever and less painful way to do this than bashing out crummy Riemann or trapezoidal approximations or something of the sort?

operatorerror
  • 29,103
  • This is a really fascinating question. I tried integrating by parts to $x^x|_1^{10}-\int_1^{10}x^x\log x\ dx$ and seeing if I could approximate $\log x$ well enough to be able to craft simple linear equations over intervals for the value as a fraction of $x^x$, but unfortunately since $\log(10)\approx 3$ and the intervals you're crafting are of 'size' $.05$ or smaller, this still requires $\approx 60$ pieces, at which point you might as well just integrate straight-up... – Steven Stadnicki May 19 '17 at 03:14
  • Does the series found here help? https://math.stackexchange.com/questions/141347/finding-int-xxdx – Isaac Browne May 19 '17 at 03:21
  • @StevenStadnicki it's driving me nuts. The lore is also that he had 100 of these he expected his phd students to solve in an hour in order to be able to work with him, which is outrageous. Many of them are not much better than this. I like the idea of integrating by parts, I hadn't thought of it – operatorerror May 19 '17 at 03:35
  • 3
    $x^x$ grows so quickly that the vast majority of the integral is going to be in the last unit. Just estimating it as $\int_9^{10} x^x$ gets you in the ballpark, or just something like $9.6^{9.6}$ is pretty close. Of course, rigorously justifying this is harder... – Jair Taylor May 19 '17 at 04:12
  • I can give you 100 digits with tanh-sinh quadrature using ~30 evaluations of $x^x$. But since you said you hate yourself, I'm guessing you don't like this method. . . – user14717 May 19 '17 at 04:14
  • @user14717 oh cool, I had no idea this sort of quadrature existed. I was hoping for something doable (at least mostly) by hand – operatorerror May 19 '17 at 04:17
  • @qbert : It's doable by hand. One knows that $\ln(10)\simeq 2.3$ Then $\quad\frac{10^{10}}{1+\ln(10)}\simeq \frac{10^{10}}{3.3}\simeq 3.\times 10^9\quad\to\quad$ Relative error lower than 2%. – JJacquelin May 19 '17 at 10:44

3 Answers3

11

The answer can be found in the paper : https://fr.scribd.com/doc/34977341/Sophomore-s-Dream-Function

An asymptotic expansion of the so called Sophomores Dream function $$\text{Sphd}(\alpha;x)=\int_0^{x}t^{\alpha t} dt$$ is given in section 6 , pp.6-7.

To reach the specified accuracy, it is not necessary to use many terms of the series. Only the first term is sufficient. In fact, this is the equivalent for large $x$ given page 9, Eq.(9:2) : $$\text{Sphd}(\alpha;x)\sim \frac{x^{\alpha x}}{\alpha(1+\ln(x))}$$

In the present case, with $\alpha=1$ : $$\int_1^{10}x^x dx=\text{Sphd}(1;10)-\text{Sphd}(1;1)\simeq \frac{10^{10}}{1+\ln(10)}\simeq 3.027931\times 10^9$$

From Eq.(8:1)$\quad \text{Sphd}(1;1)\simeq 0.783430\quad$ is negligible.

One can compare to the result of numerical calculus : $\quad \int_1^{10}x^x dx\simeq 3.057489\times 10^9\quad$ The above approximate leads to a relative error lower than 1%.

operatorerror
  • 29,103
JJacquelin
  • 66,221
  • 3
  • 37
  • 87
3

Consider $$\int{x^xdx} = \int{e^{x\log (x)}dx} = \int{\sum_{k=0}^{\infty}\frac{x^k\log^k (x)}{k!}}\,dx=\sum_{k=0}^{\infty}\frac 1{k!}\int {x^k\log^k (x)}\,dx$$Now $$\int {x^k\log^k (x)}\,dx=-\log ^{k+1}(x) (-(k+1) \log (x))^{-k-1}\,\Gamma (k+1,-(k+1) \log (x))$$ where appears the incomplete gamma function.

Using the bounds, the table below reproduces the results summing from $k=0$ to $k=n$ $$\left( \begin{array}{cc} n &\sum_{k=1}^{n} \\ 10 & 1.34986\times 10^7 \\ 15 & 2.49883\times 10^8 \\ 20 & 1.186883\times 10^9 \\ 25 & 2.35791\times 10^9 \\ 30 & 2.92299\times 10^9 \\ 35 & 3.04399\times 10^9 \\ 40 & 3.05675\times 10^9 \\ 45 & 3.05747\times 10^9 \\ 50 & 3.05749\times 10^9 \end{array} \right)$$ which is the solution for six significant figures.

1

Call the integral $I$, $$I=\int_1^{10}x^x\ dx=\int_1^{10}e^{x\log x}\ dx=\int_1^{10}\frac{(1+\log x)e^{x\log x}}{1+\log x}\ dx$$ integrate by parts, $$f'=(1+\log x)e^{x\log x},\quad f=e^{x\log x}\\g=\frac{1}{1+\log x},\quad g'=-\frac{1}{x(1+\log x)^2}$$ we find $$I=\left(\frac{10^{10}}{1+\log 10}-1\right)+\int_1^{10}\frac{e^{x\log x}}{x(1+\log x)^2}\ dx\approx\left(\frac{10^{10}}{1+\log 10}-1\right)\approx\frac{10^{10}}{3.3}$$ where we made the very rough approximation: $\log 10=\log 2+\log 5\approx0.7+1.6=2.3$. The relative error is about $0.889\%$. Note that by applying integration by parts on the second integral using the same $f$ as above, $$\int_1^{10}\frac{e^{x\log x}}{x(1+\log x)^2}\ dx=\left(\frac{10^{10}}{10(1+\log 10)^3}-1\right)+R_i\approx\frac{10^{9}}{3.3^3}$$ where $R_i$ is the new (negligible) remaining integral. Using this now gives, $$I\approx\frac{10^{10}}{3.3}+\frac{10^{9}}{3.3^3}$$ a relative error of about $0.0209\%$. I believe repeated integration by parts can be applied on the remaining integral $R_i$ using the same $f$ every time to increase accuracy, but at some point, we should use a better $\log$ approximation.

bob
  • 2,167