I am working on Evans' PDE textbook problems, but I am stuck with the following problem about modification of the proof of the mean-value formula for harmonic functions. I cannot really see how to derive the second term of RHS of the formula below. I would appreciate it if someone could help me derive this formula.
Modify the proof of the mean-value formulas to show for $n\ge 3$ that $$ u(0)=\frac{1}{V(\partial B(0,r))}\int_{\partial B(0,r)}g \, dS +\frac{1}{n(n-2)\alpha(n)}\int_{B(0,r)}\left[\frac{1}{|x|^{n-2}}-\frac{1}{r^{n-2}}\right]f \,dx, $$ provided $$ \begin{cases}-\Delta u=f & \text{in } B^0(0,r) \\ \quad \, \, \, u=g & \text{on } \partial B(0,r).\end{cases} $$