$f(\textbf{x}) = {a\over{|\textbf{x}|^{n-2}}} + b,\text{ }\textbf{x} \neq 0$ 
  
*
  
*If $f(\textbf{x}) = g(r)$, $r = |\textbf{x}|$, and $n \ge 3$, show that$$\nabla^2 f = {{\partial^2 f}\over{\partial x_1^2}} + \dots + {{\partial^2f}\over{\partial x_n^2}} = {{n-1}\over{r}}g'(r) + g''(r)$$for $\textbf{x} \neq 0$.
  
*Deduce from the previous part that, if $\nabla^2 f = 0$, then$$f(\textbf{x}) = {a\over{|\textbf{x}|^{n-2}}} + b,\text{ }\textbf{x} \neq 0,$$where $a$ and $b$ are constants.
  

I am stuck on this problem. Can anyone give me a hint?
 A: 
If $f(\textbf{x}) = g(r)$, $r = |\textbf{x}|$, and $n \ge 3$, show that$$\nabla^2 f = {{\partial^2 f}\over{\partial x_1^2}} + \dots + {{\partial^2f}\over{\partial x_n^2}} = {{n-1}\over{r}}g'(r) + g''(r)$$for $\textbf{x} \neq 0$.

$\nabla^2$ is a rotationally invariant differential operator, i.e. for any orthonormal coordinate systems, $(x_1, \dots, x_n)$ and $(y_1, \dots, y_n)$, we have$$\sum_{i=1}^n {{\partial^2 f}\over{\partial x_i^2}} = \sum_{i=1}^n {{\partial^2 f}\over{\partial y_i^2}},$$because the quadratic form on $\mathbb{R}^n$ given by the matrix$$Q = \begin{pmatrix} 
1 & \phantom{0} & \ldots & \phantom{0} \\
\phantom{0} & 1 & \ldots & \phantom{0} \\
\vdots & \vdots & \ddots & \vdots \\
\phantom{0} & \phantom{0} & \ldots & 1 \end{pmatrix}$$has $P^\text{T}QP$ for all orthogonal matrices $P$. So we may assume$$x = (r, 0, 0, 0, \dots, 0).$$Then$${{\partial^2 f}\over{\partial x_1^2}} = g''(r),$$and for $m > 1$,$${{\partial^2f}\over{\partial x_m^2}} = h''(0),$$where$$h(t) = g\left(\sqrt{r^2 + t^2}\right)$$$$\implies h'(t) = {t\over{\sqrt{r^2 + t^2}}} g'\left( \sqrt{r^2 + t^2}\right)$$$$\implies h''(t) = {{t^2}\over{r^2 + t^2}}g''\left( \sqrt{r^2 + t^2}\right) + g'\left(\sqrt{r^2 + t^2}\right){{\sqrt{r^2 + t^2} - t{d\over{dt}}\left(\sqrt{r^2 + t^2}\right)}\over{r^2 + t^2}}.$$For $t = 0$, $r \neq 0$, this reduces to $g'(r)/r$. Thus,$$\sum_{m=2}^n {{\partial^2 f}\over{\partial x_m}} = {{n-1}\over{r}} \cdot g'(r),$$and the result follows. True for $n \ge 1$, $r \ge 0$.

Deduce from the previous part that, if $\nabla^2 f = 0$, then$$f(\textbf{x}) = {a\over{|\textbf{x}|^{n-2}}} + b,\text{ }\textbf{x} \neq 0,$$where $a$ and $b$ are constants.

We have that$$g''(r) + {{n-1}\over{r}}g'(r) = 0$$is an ODE with $C^2$-coefficients, so by Picard iteration, in a neighborhood of $r_0 > 0$, there exists a unique solution for each set of initial conditions $g(r_0)$, $g'(r_0)$. Since $a/r^{n-2} + b$ gives all possible initial conditions and solves the ODE, we are done for $n \ge 3$. For $n = 2$, we have solutions $a\log(r) + b$, so$$f(x) = a\log(|x|) + b.$$
