How to find $\int \ln^nx\space dx$ How does one evaluate a function in the form of
$$\int \ln^nx\space dx$$
My trusty friend Wolfram Alpha is blabbering about $\Gamma$ functions and I am having trouble following. Is there a method for indefinitely integrating such and expression? Or if there isn't a method how would you tackle the problem?
 A: Let 
$$F_n=\int \log^n(x) dx$$
so by integration by parts (we derivate $\log^n(x)$) we have
$$F_n=x\log^n(x)-n\int\log^{n-1}(x)dx=x\log^n(x)-nF_{n-1}$$
so we find $F_n$ by induction by the relation:
$$\left\{\begin{array}\\
F_0=x+C\\
F_{n}=x\log^n(x)-nF_{n-1},\quad n\geq 1
\end{array}\right.$$
Added$\ $ We can write a simple procedure with Maple which gives the expression of $F_n$ for every $n$ as follow:



We can prove by induction that
$$F_n=x\log^n(x)+\sum_{k=1}^{n-1}(-1)^{n-k}\frac{n!}{k!} x\log^k(x)+(-1)^nx+C$$
A: If $\ln^nx$ denotes $\log(x)^n$, then my hint is to try the simple substitution $e^y = x$, giving
$$\int\log(x)^ndx = \int y^ne^ydy$$
A: Write $x=e^y$, and $\text{d}x=e^y\text{d}y$, and integrate by parts a few times $$\int \ln^n(x)\text{d}x\text=\int y^{n}e^{y}\text{d}y=y^ne^y-n\int y^{n-1}e^y\text{d}y.$$ 
A: I notice these answers do not also explain why Wolfram Alpha gives results involving the gamma function. I'll provide that here.
The reason is that Wolfram Alpha interprets $n$ as an arbitrary real or complex number, not just a nonnegative integer. In that case, there is no elementary solution and we have to use the gamma function.
This works as follows: Start
$$\int \ln(x)^n dx,\ n \in \mathbb{C}$$
and use the substitution $u = \ln(x)$, $du = \frac{1}{x} dx$ to get
$$\int \ln(x)^n dx = \int \ln(x)^n \frac{x}{x} dx = \int x \ln(x)^n \frac{1}{x} dx = \int e^u u^n du$$.
Now the last integral is essentially that for the gamma function. In particular, using the "lower incomplete gamma function"
$$\gamma(s, x) = \int_{0}^{x} e^{-t} t^{s-1} dt$$
we have the last integral (with one more change of variable $u \rightarrow -v$) as
$$\begin{align}\int e^u u^n du &= -\int e^{-v} (-v)^n dv = -(-1)^n \int e^{-v} v^n dv \\ &= -(-1)^n \gamma(n+1, v) + C \\ &= -(-1)^n \gamma(n+1, -u) + C\end{align}$$
And thus the final integral is
$$\int \ln(x)^n dx = (-1)^{n+1} \gamma(n+1, -\ln(x)) + C$$.
There is then a recurrence formula
$$\gamma(s, x) = (s - 1)\gamma(s - 1, x) - e^{-x} x^{s-1}$$
for the incomplete gamma, which can be used to get Sami Ben Romdhane's solution for $n$ natural. But this formula is obtained by integration by parts on the incomplete gamma, so it would be simpler to just apply that directly to the original integral, as he did, unless you do need the answer for a non-integer $n$ in terms of standard, though not elementary, functions.
