Approximating $\int_1^{10}x^x\mathrm dx$ to within 5% relative error
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?
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%.
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.