If $f(x,y) = g(r)$, where $r=(x^2+y^2)^{1/2}$, prove $\frac{\partial^2f}{\partial x^2} + \frac{\partial^2f}{\partial y^2} = \frac 1r g'(r)+ g''(r).$ Consider a scalar field defined in $\mathbb{R}^2$ such that $f(x,y)$ depends only on the distance $r$ of $(x,y)$ from the origin, say $f(x,y) = g(r)$, where $r=(x^2+y^2)^{1/2}$. 
a) Prove that for $(x,y) \ne (0,0)$, we have $$\frac{\partial^2f}{\partial x^2} + \frac{\partial^2f}{\partial y^2} = \frac 1r g'(r)+ g''(r).$$
b) Now assume further that $f$ satisfies Laplace's Equation, $$\frac{\partial^2f}{\partial x^2} + \frac{\partial^2f}{\partial y^2} = 0. $$ Use part (a) to show that $f(x,y) = a \log(x^2+y^2) +b$ for $(x,y) \ne (0,0),$ where $a$ and $b$ are constants. 
What I've tried:
I think we can express $g'(r)$ as $$\frac{d}{dr}g(r) = \frac{\partial g}{\partial x} \frac{\partial x}{\partial r} + \frac{\partial g}{\partial y} \frac{\partial y}{\partial r},$$ but I'm confused as to how to determine $\frac{\partial x}{\partial r}$ and $\frac{\partial y}{\partial r}$ since $r$ is in terms of both $x$ and $y$. 
 A: You're going the wrong way. First
\begin{align} 
\frac{\partial f}{\partial x} &= \frac{dg}{dr} \frac{\partial r}{\partial x} = \frac{x}{r} g'(r) \\
\frac{\partial f}{\partial y} &= \frac{dg}{dr}\frac{\partial r}{\partial y} = \frac{y}{r} g'(r) 
\end{align}
Then
\begin{align} 
\frac{\partial^2 f}{\partial x^2} &= \frac{d}{dr}\left(\frac{x}{r}g'(r)\right) \frac{\partial r}{\partial x} = \frac{x^2}{r}\left( \frac{g''(r)}{r} - \frac{g'(r)}{r^2}\right) \\
\frac{\partial^2 f}{\partial y^2} &= \frac{d}{dr}\left(\frac{y}{r}g'(r)\right)\frac{\partial r}{\partial y} = \frac{y^2}{r}\left( \frac{g''(r)}{r} - \frac{g'(r)}{r^2}\right) \\
\end{align}
Add the 2 equations and you have your result.
A: There is a fairly nice way to look at this computation in higher dimensional spaces.  For any function $f: \mathbb R^n\rightarrow \mathbb R$, let the Laplacian $\ \Delta f(x_1, x_2, \ldots, x_n) := \sum_{i=1}^n \frac{\partial^2f}{\partial x_i^2}.$
For any twice differentiable functions $g:\mathbb R \rightarrow \mathbb R$, $r:\mathbb R^n\rightarrow \mathbb R$, and $h=g\circ r$, 
$$
\Delta h(x) = g''(r(x))\; ||\nabla r||_2^2 + g'(r(x)) \Delta r(x). 
$$
where $x\in \mathrm R^n$, 
$$\nabla r= \left(\frac{\partial r}{\partial x_1},\frac{\partial r}{\partial x_2}, \ldots, \frac{\partial r}{\partial x_n}\right)$$
and $||v||_2^2 = \sum_{i=1}^n v_i^2$.  (It would be nice if someone found a reference for this formula that is better than my memory.)
If $r(x) = r(x_1, x_2,\ldots, x_n) = \sqrt{\sum_{i=1}^n x_i^2}$, then $||\nabla r||=1$ and $\Delta r = (n-1)/r$, so 
$$
\Delta h(x) = \Delta ( (g\circ r)(x)) = g''(r(x)) + \frac{n-1}{r(x)} g'(r(x)).
$$
