TITLE: How to find $\int x^{1/x}\mathrm dx$
QUESTION [22 upvotes]: EDIT: The full answer has been posted by myself. Feel free to check the logic within.

How does one indefinitely integrate a function in the form of $$f(x)=x^{1/x}$$
Looking at all the things that I know there is nothing about exponents with variables.
So how does one find:
$$\int x^{1/x}\;\mathrm dx?$$
I am more interested in the technique for doing so rather than the solution as it is of no real significance but merely a curiosity.

REPLY [12 votes]: Okay after some work it's finished I hope it is correct:
$$\begin{align}\int x^{1/x}dx&=\int \exp\left(\frac{\log x}x\right)dx=\int\sum_{n=0}^\infty\frac{\left(\log x/x\right)^n}{n!}dx=\sum_{n=0}^\infty\int\frac{\left(\log x/x\right)^n}{n!}dx\\
&=\sum_{n=0}^\infty\int\frac{\left(\log x/x\right)^n}{n!}dx = \sum_{n=0}^\infty\int x^{-n}n!^{-1}\log^nx\space dx=\sum_{n=0}^\infty n!^{-1}\int x^{-n}\log^nx\space dx\end{align}$$
Let $u=\log x$ then $du=\frac1xdx\implies x\;du=dx$ $$\int x^{-n}\log^nx\;dx=\int x^{-n+1}u^n\;du=\int e^{-u(n-1)}u^n\;du$$
Let $w=u(n-1)$ then $dw=(n-1)\;du\implies \frac{1}{n-1}dw=du$
$$\int e^{-u(n-1)}u^n\;du=\frac{1}{(n-1)^{n+1}}\int e^{-w}w^ndw$$
$$\int w^ne^{-w}dw=-\sum^n_{k=0}\frac{n!\;w^{n-k}}{e^w(n-k)!}=-\sum^n_{k=0}\frac{n!\;\log^{n-k}x\;(n-1)^{n-k}}{x^{n-1}(n-k)!}$$
$$\implies\int x^{-n}\log^nx\;dx=-\frac{1}{(n-1)^{n+1}}\sum^n_{k=0}\frac{n!\;\log^{n-k}x\;(n-1)^{n-k}}{x^{n-1}(n-k)!}$$
$$=-\sum^n_{k=0}\frac{n!\;\log^{n-k}x\;(n-1)^{n-k}}{x^{n-1}(n-k)!(n-1)^{n+1}}=-\sum^n_{k=0}\frac{n!\;\log^{n-k}x\;}{x^{n-1}(n-k)!(n-1)^{k+1}}$$
$$=-\frac{n!}{x^{n-1}}\sum^n_{k=0}\frac{\log^{n-k}x\;}{(n-k)!(n-1)^{k+1}}$$
$$\implies \int x^{1/x}dx=-\sum^\infty_{n=0}\sum^n_{k=0}\frac{\log^{n-k}x\;}{x^{n-1}(n-k)!(n-1)^{k+1}}+C$$