Solution (source code)

= Solution

Write $c=\cos\phi$ and $s=\sin\phi$. The needed coefficient <derivatives> are $c_x=s^2/r$, $s_x=-sc/r$, $c_y=-sc/r$ and $s_y=c^2/r$. Apply the <product rule> to both terms of $f_x=cg_r-(s/r)g_\phi$ and use the <chain rule> for the <derivatives> of $g$. Collecting terms gives
$$
\boxed{f_{xx}=c^2g_{rr}-\frac{2sc}{r}g_{r\phi}+\frac{2sc}{r^2}g_\phi
+\frac{s^2}{r}g_r+\frac{s^2}{r^2}g_{\phi\phi}.}
$$
Similarly, differentiating $f_y=sg_r+(c/r)g_\phi$ gives
$$
\boxed{f_{yy}=s^2g_{rr}+\frac{2sc}{r}g_{r\phi}-\frac{2sc}{r^2}g_\phi
+\frac{c^2}{r}g_r+\frac{c^2}{r^2}g_{\phi\phi}.}
$$
On addition, both the mixed <partial derivative> terms and the first angular <derivative> terms cancel. Using $s^2+c^2=1$, the <Laplacian> in <polar coordinates> is
$$
\boxed{\nabla^2f=g_{rr}+\frac1r g_r+\frac1{r^2}g_{\phi\phi},\qquad r>0.}
$$