<s>[INST] Series Expansion Of An Integral. I want to find the first 6 terms for the series expansion of this integral:
$$\int x^x~dx$$
My idea was to let: $$x^x=e^{x\ln x}$$
From that we have: $$\int e^{x\ln x}~dx$$
The series expansion of $e^x$ is: $$\sum\limits_{n=0}^\infty\frac{x^n}{n!}$$
Then we have:
$$\int e^{x\ln x}~dx=\int\sum\limits_{n=0}^\infty\frac{(x\ln x)^n}{n!}dx$$
I integrated the first 3 terms (since it was the easiest the work with):
$$x+\frac{1}{4}x^2(2\ln x-1)+\frac{1}{54}x^3(9(\ln x)^2-6\ln x+2)+\cdots$$
Is there any other efficient way of getting the first 6 terms of the series expansion of the integral?
 [/INST] http://en.wikipedia.org/wiki/Exponential_formula
\begin{align}
f(x) & = a_1 x + \frac{a_2}{2} x^2 + \frac{a_3}{6} x^3 + \frac{a_4}{24} x^4 + \frac{a_5}{120} x^5 + \frac{a_6}{720} x^6 + \cdots \\[10pt]
e^{f(x)} & = 1 + a_1 x + \frac{a_2+a_1^2}{2} x^2 + \frac{a_3+3a_2a_1+ a_1^3}{6} x^3 + \frac{a_4 + 4a_3 a_1+ 3a_2^2 + 6a_2a_1^2 + a_1^4}{24} x^4 \\[8pt]
& \phantom{{}={}} + \frac{a_5 + 5a_4 a_1 + 10a_3 a_2 + 10a_3 a_1^2 + 15 a_2^2 a_1 + 10 a_2 a_1^3 + a_1^5}{120} x^5 \\[8pt]
& \phantom{{}={}} + \frac{a_6 + 6a_5 a_1 + 15 a_4 a_2 + 15 a_4 a_1^2 + 10a_3^2 + 60 a_3 a_2 a_1 + 20 a_3 a_1^3 + 15 a_2^3 + 45 a_2 a_1^4+ a_1^6}{720} x^6 \\[8pt]
& \phantom{{}={}} + \cdots\cdots
\end{align}
The patterns in the indices correspond to integer partitions and the coefficients count set partitions.  For example, here is how we get the coefficient of $x^6$:
$$
\begin{array}{l|c}
\text{integer partition} & \text{number of set partitions} \\
\hline
6 & 1 \\
5+1 & 6 \\
4+2 & 15 \\
4+1+1 & 15 \\
3+3 & 10 \\
3+2+1 & 60 \\
3+1+1+1 & 20 \\
2+2+2 & 15 \\
2+2+1+1 & 45 \\
2+1+1+1+1 & 15 \\
1+1+1+1+1+1 & 1
\end{array}
$$
</s>