show that $|x|^{-(n-2)}$ is harmonic function let $f:\mathbb{R}^n \to \mathbb{R}$, and $f: \mathbf{x} \mapsto \Vert\mathbf{x}\Vert^{-(n-2)}$
show that $f$ is harmonic.
I tried to take derivative by $x_1$ twice, and I got this result:
$1/4 (-1 + 4 n^2) (x + x_{2...n})^{(-3/2 - n)}$ this of course doesn't sum up to zero.
where am I wrong?
thanks
 A: One trick here is to note that $f$ is invariant under rotations, so we might get some mileage out of using polar coordinates. In polar coordinates, $$f(r,\theta_1,\ldots,\theta_{n-1}) = r^{2-n}$$
and the Laplacian has the expression
$$\Delta = \frac{1}{r^{n-1}}\frac{\partial}{\partial r}\bigg(r^{n-1}\frac{\partial}{\partial r}\bigg) + r^{-2}\bigg(\mbox{angular derivatives}\bigg)$$
As $f$ depends only on $r$, the angular derivatives vanish, so
$$\begin{align*}
\Delta f &= \frac{1}{r^{n-1}}\frac{\partial}{\partial r}\bigg( r^{n-1} \frac{\partial}{\partial r} r^{2-n}\bigg) \\
&= \frac{1}{r^{n-1}}\frac{\partial}{\partial r}\bigg(r^{n-1}(-n+2)r^{1-n}\bigg) \\
&= \frac{2-n}{r^{n-1}}\frac{\partial}{\partial r}(1)\\
&= 0
\end{align*}$$
A: Given $f(\mathbf{x})=\Vert\mathbf{x}\Vert^{-(n-2)}$ we need to show that
$$\nabla^2 f =\sum ^{n}_{i=1}\frac{\partial^2 f}{\partial x_{i}^{2}} =0$$
Let's work out the first derivative:
$$\frac{\partial }{\partial x_{i}} \| \mathbf{x} \| ^{-n+2} =( 2-n) \| \mathbf{x} \| ^{-n+1}\frac{\partial \| \mathbf{x} \| }{\partial x_{i}}$$
Recalling that $\| \mathbf{x} \| =\sqrt{\sum\nolimits ^{n}_{i=1} x_{i}^{2}}$, we can see that
$$\frac{\partial }{\partial x_{i}} \| \mathbf{x} \| ^{-n+2}=( 2-n) \| \mathbf{x} \| ^{-n} x_{i}$$
Now,
$$\frac{\partial^2 f}{\partial x_{i}^{2}}=\frac{\partial}{\partial x_i}\left( ( 2-n) \| \mathbf{x} \| ^{-n} x_{i}\right)$$
Using the product rule,
$$\frac{\partial}{\partial x_i}\left( ( 2-n) \| \mathbf{x} \| ^{-n} x_{i}\right)=( 2-n)\left( -n\| \mathbf{x} \| ^{-n-2} x_{i}^{2} +\| \mathbf{x} \| ^{-n}\right)$$
$$=( 2-n) \| \mathbf{x} \| ^{-n-2}\left( -nx_{i}^{2} +\| \mathbf{x} \| ^{2}\right)$$
Thus
$$\nabla^2 f = ( 2-n) \| \mathbf{x} \| ^{-n-2}\sum ^{n}_{i=1}\left( -nx_{i}^{2} +\| \mathbf{x} \| ^{2}\right)$$
$$=( 2-n) \| \mathbf{x} \| ^{-n-2}(-n\Vert\mathbf{x}\Vert^2+n\Vert\mathbf{x}\Vert^2)=0.$$
