Sobolev Spaces and Weak Derivatives As you can probably guess, I'm currently studying about differential operators and functional analysis. 
We've studied the following theorem:

A function $f \in L^2 (\Omega) $ lies in $ W^{1,2} ( \Omega) $ if and only if there exists a function $g \in L^2 ( \Omega ) $ such that:
  $$\int_\Omega f \left\{ b_0 (x) \phi(x) - \sum_{i=1}^n \frac{ \partial(b_i (x) \phi(x)}{\partial x_i} \right\} d^n x = \int_\Omega g(x) \phi(x) d^n x $$ for every choice of functions $b_i (x) \in C^\infty (\bar{\Omega} ) $, and $\phi \in C_c^\infty (\Omega ) $ . 

Can someone help me use this theorem in order to prove that the function $f(x)= \frac{x_1}{|x|} $ is in $W^{1,2}( \{ x \in \mathbb{R} ^n : |x| <1 \} ) $? What should be my $g$ and how can I prove it? 
I really need your help ! 
Thanks  !  
 A: I looked this up in the Davies' book that you are reading. The functions $b_i$ are coefficients of a differential operator $D_b$, and $g$ depends on these coefficients (precisely, $g=D_b f$). Anyway, it would be strange to use this property of $W^{1,2}$ functions here. We just want to show that $f(x)=x_1/|x|$ is in $W^{1,2}(\Omega)$ where $\Omega=\{x:|x|<1\}$.
Here is one approach, not necessarily the quickest but instructive. Let $\phi:[0,\infty)\to[0,1]$ be a $C^\infty$ function such that $\phi(t)=0$ when $t\le 1$, $\phi(t)=1$ when $t\ge 2$, and $-2\le \phi'\le 0$ always. Introduce the smooth approximations $f_k=f\psi_k$ where $\phi_k(x)=\phi(k|x|)$, $n=1,2,\dots$. It is clear that $f_k\to f$ in $L^2(\Omega)$. I claim that $(\nabla f_k)$ is Cauchy in $L^2(\Omega)$. Indeed, for $k<m$ we have $\nabla (f(\psi_k-\psi_m))=(\nabla f)(\psi_k-\psi_m)+f\,\nabla (\psi_k-\psi_m)$. The first term is handled using the bound $\nabla f=O(1/|x|)$: 
$$\|(\nabla f)(\psi_k-\psi_m)\|_{L^2}^2\le \int_{1/m<|x|<2/k} |\nabla f|^2\le C\int_{1/m}^{2/k} \frac{1}{r^2}r^{n-1}\,dr\to 0$$
where we do need $n\ge 3$. To deal with the second, notice that $\|\nabla \psi_k\|=Ck^{2-n}$ (by rescaling), and therefore 
$$\|f\,\nabla (\psi_k-\psi_m)\|_{L^2}^2\le C(k^{2-n}+m^{2-n})\to 0$$
where we again needed $n\ge 3$.
In a summary: $(f_k)$ is Cauchy in $W^{1,2}(\Omega)$, hence it converges to a function in $W^{1,2}(\Omega)$. But this function can be nothing but $f$ since $f_k\to f$ in $L^2(\Omega)$.
