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
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.$$