Proving that a certain function is in $W^{1,n}(B(0,1))$ Fix $0<\alpha<1-\frac{1}{n}$ and let $f\colon\mathbb{R}^n \rightarrow \mathbb{R}$ be the function $f(x)=(\log(\frac{1}{|x|}))^{\alpha}$.

How can I prove that $f\in W^{1,n}(B(0,1))$? 

 A: First $f = (-\ln|x|)^{\alpha}$, hence
$$
\nabla f = -\alpha (-\ln|x|)^{\alpha - 1} \frac{x}{|x|^2}
$$
and
$$
|\nabla f | = \alpha (-\ln|x|)^{\alpha - 1} \frac{1}{|x|}
$$
Let $r = |x|$, then $0<r<1$, change the integral over spheres: 
$$
\int_{B(0,1)} |f|^n \,dx = \int^1_0 \left(\int_{\partial B(0,r)} |f|^n dS\right)\,dr ,
$$
where $|f| = |\ln r|^{\alpha}$ is a constant on the surface of the $n$-sphere $\partial B(0,r)$, and we can pull it out from the surface integral:
$$
\int_{B(0,1)} |f|^n \,dx =  \int^1_0 \left(\int_{\partial B(0,r)} 1 dS\right)|\ln r|^{\alpha n} \,dr =  c(n)\int^1_0 |\ln r|^{\alpha n} r^{n-1} dr ,
$$
where $\int_{\partial B(0,r)} 1 dS = c(n)r^{n-1}$ is the surface area of the $n$-sphere.
This integral might behave singular when $r\to 0$. For $\alpha n< n-1$, and 
$$
r^{n-1}<|\ln r|^{\alpha n} r^{n-1} < |\ln r|^{n-1} r^{n-1}
$$
when $0<r<1$. Now since
$$
\int  |\ln r|^{n-1} r^{n-1} \,dr\sim O(r^n |\ln r|^{n-1}), \quad \text{ and }\int  r^{n-1} \,dr\sim O(r^n)
$$
and
$$
\lim_{r\to 0} r^n |\ln r|^{n-1} = 0
$$
we have 
$$
\int_{B(0,1)} |f|^n \,dx <\infty. \tag{1}
$$
For 
$$
\begin{aligned}
&\int_{B(0,1)} |\nabla f|^n \,dx = \int_{B(0,1)} \alpha (-\ln|x|)^{n\alpha - n} \frac{1}{|x|^n} \, dx  \sim c(n) \int^1_0 \alpha |\ln r|^{n\alpha - n} \frac{1}{r^n}  r^{n-1} \,dr
\\
&= \int^1_0 \alpha |\ln r|^{n\alpha - n} \frac{1}{r}\,dr = \int^1_0 \alpha |\ln r|^{n\alpha - n}\,d(\ln r) \sim O(|\ln r|^{n\alpha - n + 1})
\end{aligned}
$$
For $-n +1 <n\alpha - n + 1 < 0$, for $n\geq 2$ here (otherwise $\alpha$ will not exist), we have 
$$
\int_{B(0,1)} |\nabla f|^n \,dx \sim O(|\ln r|^{-\epsilon})
$$
for some $\epsilon >0$, hence
$$
\int_{B(0,1)} |\nabla f|^n \,dx < \infty.\tag{2}
$$
The claim follows from (1) and (2).
My argument is kinda rough for I used big-O notation to represent quantity in the same order ignoring the constant, I suggest you carry out the calculation more explicitly if this is a homework.
