Prove that $\int_0^\infty\frac1{x^x}\, dx<2$ 
Prove that $$\int_0^\infty\frac1{x^x}\, dx<2.$$
 Note: This inequality is rather tight. The integral approximates to $1.9955$. 

Integration by parts is out of the question. If we let $f(x)=\dfrac1{x^x}$ and $g'(x)=1$ then $f'(x)=-x^{-x}(\ln x + 1)$ by implicit differentiation and $g(x)=x$. The integral $\int f'(x)g(x)\, dx$ looks even harder to evaluate.
Expressing the left-hand side as a Frullani integral $$\int_0^\infty\frac{f(ax)-f(bx)}x\, dx=(f(0)-f(\infty))\ln\frac ba$$ means that $f(ax)-f(bx)=x^{1-x}$. However, I can't seem to find a continuous function $f$ that satisfies the functional equation. Is there such a function?
 (For context, user371838's post below proves sophomore's dream which I also asked about originally.) 
 A: Remarks: Here is an alternative proof.
I used the same bounds for this question
Improper integral inequality including the golden ratio and the Sophomore's dream

We will use the following auxiliary results (Facts 1-2).
Fact 1: $x^{-x} \le \frac{3 - x}{x^2 - x + 2}$ for all $x \in [1, 2]$.
(RHS is the Pade $(1, 2)$ approximation of $x^{-x}$ at $x = 1$.)
Fact 2: $x^{-x} \le a^{-x} \mathrm{e}^{-x + a}$ for all $x, a > 0$.
(Proof: Taking logarithm on both sides, letting $u = \frac{a}{x} > 0$,
it is equivalent to $\ln u \le u - 1$ which is true (easy).)

We have (Sophomore's dream)
$$I_1 := \int_0^1 x^{-x} \mathrm{d} x
= \sum_{n = 0}^\infty \frac{1}{(n + 1)^{n + 1}}
\le 1 + \frac{1}{2^2} + \frac{1}{3^3} + \sum_{n=3}^\infty \frac{1}{4^{n + 1}} = \frac{2233}{1728}.$$
Using Fact 1, we have
$$I_2 := \int_1^2 x^{-x}\mathrm{d} x
\le \int_1^2 \frac{3 - x}{x^2 - x + 2}\mathrm{d} x = \frac{5}{\sqrt 7}\arctan \frac{\sqrt 7}{5} - \frac12\ln 2.$$
Using Fact 2, we have
$$I_3 := \int_2^{5/2} x^{-x}\,\mathrm{d} x
\le \int_2^{5/2} 2^{-x}\mathrm{e}^{-x + 2}\,\mathrm{d} x = \frac{2 - \sqrt{2\mathrm{e}^{-1}}}{8 + 8\ln 2},$$
and
$$I_4 :=
 \int_{5/2}^3 x^{-x}\,\mathrm{d} x
\le \int_{5/2}^3 (5/2)^{-x}\mathrm{e}^{-x + 5/2}\,\mathrm{d} x = \frac{4\sqrt{10} - 8\sqrt{\mathrm{e}^{-1}}}{125\ln \frac{5}{2} + 125}, $$
and
$$I_5 := 
\int_3^\infty x^{-x}\, \mathrm{d} x
\le \int_3^\infty 3^{-x} \mathrm{e}^{-x + 3}\, \mathrm{d} x = \frac{1}{27\ln 3 + 27}.$$
Thus, we have
\begin{align*}
 &\int_0^\infty x^{-x} \mathrm{d} x\\
 =\, & I_1 + I_2 + I_3 + I_4 + I_5\\
 \le\,& \frac{2233}{1728} 
 + \frac{5}{\sqrt 7}\arctan \frac{\sqrt 7}{5} - \frac12\ln 2
 + \frac{2 - \sqrt{2\mathrm{e}^{-1}}}{8 + 8\ln 2} + \frac{4\sqrt{10} - 8\sqrt{\mathrm{e}^{-1}}}{125\ln \frac{5}{2} + 125}
 + \frac{1}{27\ln 3 + 27}\\
 <\,& 2.
\end{align*}
We are done.
A: 
This is a well-known result but it is hard to Google it if you do not know what it is called. This, and a similar identity are known as the sophomore's dream and the proof is given here.


Important Note: This Proof is also present in Nahin’s Inside Interesting Integrals. However, this is how we learnt it in class as well.

We start with the identity $$x^{cx^a} = e^{cx^a\ln x} \tag 1$$ where $a$ and $c$ are constants. Using the power series expansion of the exponential $$e^y =  1 + y + \frac{y^2}{2!} + … $$ with $y = cx^a \ln x$ gives us: $$x^{cx^a} = 1+ cx^a\ln x + \frac{1}{2!}c^2x^{2a}\ln^2 x + \ldots $$ and so: $$\int_{0}^{1} x^{cx^a} \, dx = \int_{0}^{1}\, dx + c\int_{0}^1{} x^a \ln x\, dx + \frac{c^2}{2!} \int_{0}^{1} x^{2a}\ln^2 x\, dx + \ldots \tag 2$$
Now, to solve integrals of the form: $$I(m,n) = \int_{0}^{1} x^m\ln^n x \, dx $$ we simply make the substitution $u=-\ln x$, followed by another substitution $\chi = (m+1)u$ giving us: $$I(m,n) = \frac{(-1)^nn!}{(m+1)^{n+1}}$$
Hence, $(2)$ becomes $$\int_{0}^{1} x^{cx^a}\, dx = 1- \frac{c}{(a+1)^2} + \frac{c^2}{(2a+1)^3} - \frac{c}{(3a+1)^4}+\ldots$$
Now, if $c=-1$ and if $a=1$, it gives us: $$\int_{0}^{1} x^{-x}\, dx = 1 + \frac{1}{2^2}+\frac{1}{3^3}+\frac{1}{4^4}+\ldots$$

See also here.
A: This comment is not the proof, just wanted to share a quick idea. Lots of assumptions, because no proofs are provided.
Assume we know that $a(x)=\int_0^\infty\frac1{x^x}\, dx = a< \infty$. Then $a(x)/a$ is the valid probability density of some random variable, say $B$. Due to the Markov inequality we have
$$
P(B>1)={1 \over a} \int_1^\infty\frac{1}{x^x}dx < {1 \over a} \int_0^\infty\frac{x}{x^x}dx,
$$
wherefrom we get
$$
\int_1^\infty\frac{1}{x^x}dx < \int_0^\infty\frac{1}{x^{x-1}}dx.
$$
Assume the integral $\int_0^\infty\frac{1}{x^{x-1}}dx=
\int_0^\infty a_1(x) dx=a_1<\infty$. Then $a_1(x)/a_1$
is the valid probability density of some random variable, say $B_1$. Again due to the Markov inequality we have
$$
P(B_1>1)={1 \over a_1} \int_1^\infty\frac{1}{x^{x-1}}dx < {1 \over a_1} \int_0^\infty\frac{1}{x^{x-2}}dx.
$$
Proceeding in the same way we get
$$
\int_0^\infty\frac{1}{x^x}dx <  \int_0^1\frac{1}{x^{x}}dx +  \int_0^1\frac{1}{x^{x-1}}dx
+
\int_0^1\frac{1}{x^{x-2}}dx
+ \int_0^1\frac{1}{x^{x-3}}dx
+\dots
=
\sum_{n=0}^\infty
\int_0^1 {x^{n-x}}dx
$$
Since Markov bound is very crude, not sure if this converges.
A: $$\int_{0}^{+\infty}e^{-x\log x}\,dx = \underbrace{\int_{0}^{1}e^{-x\log x}\,dx}_{I_1}+\underbrace{\int_{1}^{+\infty}e^{-x\log x}\,dx}_{I_2} $$
$$ I_1=\sum_{n\geq 0}\frac{(-1)^n}{n!}\int_{0}^{1}x^n\left(\log x\right)^n\,dx = \sum_{n\geq 0}\frac{1}{(n+1)^{n+1}}=\sum_{n\geq 1}\frac{1}{n^n}\tag{A}$$
$$ I_2 = \int_{0}^{+\infty}e^{-(x+1)\log(x+1)}\,dx=\int_{0}^{+\infty}\frac{e^{-x}}{W(x)+1}\,dx\tag{B} $$
where $(A)$ gives $I_1\leq 1.292$ and high-order Padé approximants give  $I_2\leq 0.705$.
It is a very tight inequality: I wonder if it can be proved in a more elementary way, maybe by writing the whole integral as $\int_{1}^{+\infty}e^{-x}g(W(x))\,dx$.
A: I don't have a solution, but somehow interesting observation:
$$\int_0^\infty x^{-x}dx=\int_0^1 x^{-x}dx+\int_1^2 x^{-x}dx+\int_2^3 x^{-x}dx+\dots=$$
$$\int_0^1 x^{-x}dx+\sum_{n=1}^\infty\int_0^1(x+n)^{-(x+n)}dx.$$
The second term $\int_0^1\sum_{n=1}^\infty(x+n)^{-(x+n)}dx$ looks like "double sophomore dream"; in $n$ as summation ($\sum_{n=1}^\infty n^{-n}$) and in $x$ as integral ($\int_0^1 x^{-x}dx$). But I don't know what to do with this next.
It would be nice to be able to find a tight bound, e.g., in terms of "sophomore dream" value. Note that $\left(\int_0^1x^{-x}dx\right)^{\int_0^1x^{-x}dx}=1.29128599^{-1.29128599}\approx 0.71885$.
