Convergence of $\int_0^1 (\log \frac 1 x)^n dx$ As far as I can tell, the only issue is at $x = 0$ (since the function goes to infinity). However, if I take a function $x^{-p}, 0<p<1$, then $f(x)/g(x) \rightarrow 0$ as $x \rightarrow 0$.
Therefore, by ratio test, the integral should converge for all $n$ (since $g(x)$ is convergent).
However, the answer says that the integral is convergent only for $0 > n > -1$. Any hints would be very appreciated.
 A: The correct answer should be that the integral only diverges for $n\le-1$, and converges elsewhere. In fact, for any $n>-1$, the integral is not only convergent but also has a name - the Gamma function.
We will discuss each case:
1). For $n\le-1$, the integrand is bounded (tends to $0$ actually) near $x=0$. Near $x=1$, we have
$$-\log x = (1-x)+o(x-1)$$
and therefore $(-\log x)^n\sim (1-x)^n$, clearly unintegrable for $n\le-1$.
2). For $n\in(-1,0)$, the integrand is bounded (tends to $0$ actually) near $x=0$. Near $x=1$, we have
$$-\log x = (1-x)+o(x-1)$$
and therefore $(-\log x)^n\sim (1-x)^n$, clearly integrable for $n\in(-1,0)$.
3). For $n > 0$, the integrand is bounded (tends to $0$ actually) near $x=1$. And near $x=0$, we have
$$-\log x = \log\left(\frac1x\right)< \left(\frac1x\right)^\alpha,\forall \alpha >0$$
Take, for example, $\alpha$ to be $1/(2n)$. Since $x^{-\frac12}$ is integrable near $0$, so must be $(-\log x)^n$.
4). The case $n=0$ is trivial.

Evaluating the integral
Let
$$I_n(a,b):=\int_a^b(-\log x)^n dx,\quad n>-1,\,\, 0<a\le b < 1$$
Note
$$\frac{d}{dx}(x(-\log x)^n)=(-\log x)^n - n (-\log x)^{n-1}$$
whence
$$I_n(a,b)-nI_{n-1}(a,b) = b(-\log b)^n - a(-\log a)^n$$
Define
$$I_n(0,1):=\lim_{\epsilon\to 0+}I_n(\epsilon,1-\epsilon)=\int_0^1(-\log x)^n dx$$. Then
$$I_n(0,1)-nI_{n-1}(0,1)=0.$$
And
$$I_n(0,1)=\left(\prod_{k\in A}k\right)I_\gamma(0,1)$$
where
$$A:=\{k\in n+\Bbb Z\mid 0<k\le n\},\quad \gamma = \min\{k\in n+\Bbb Z\mid k>-1\}$$
When $n\in\Bbb Z_{\ge 0}$, we obtain the fammiliar result
$$I_n(0,1)=n!$$
