# Assistance with a Vector Calculus Exercise

I am computing $$\nabla \nabla$$ of a function $$\mu_{\gamma}=-\frac{e^{-\gamma}}{4 \pi r}$$, and get the following (since the function only depends on $$r$$).

$$\begin{split} \nabla \mu_{\gamma} &= \frac{\textbf{r}}{|\textbf{r}|} \frac{\text{d}\mu_{\gamma}}{\text{d}|\textbf{r}|}.\\ \\ \nabla (\nabla \mu_{\gamma}) &= \frac{\nabla (\textbf{r})}{|\textbf{r}|}\frac{\partial}{\partial r}\mu_{\gamma} + \hat{r} \nabla \bigg( \frac{\partial}{\partial r} \mu_{\gamma} \bigg)\\ &=\frac{\textbf{r}}{|\textbf{r}|} \frac{\text{d} \mu_{\gamma}}{\text{d} |\textbf{r}|} + \frac{\textbf{r}}{|\textbf{r}|}\frac{\textbf{r}}{|\textbf{r}|} \frac{\partial }{\partial r} \bigg( \frac{\partial}{\partial r} \mu_{\gamma} \bigg) \\ &= \frac{\delta_{ij}}{|\textbf{r}|}\frac{\text{d} \mu_{\gamma}}{\text{d}|\textbf{r}|} + \frac{\textbf{r} \otimes \textbf{r}}{|\textbf{r}|^2} \frac{\text{d}^2 \mu_{\gamma}}{\text{d} |\textbf{r}|^2}. \end{split}$$ However, once I compute the first and second derivatives of the function $$\mu_{\gamma}$$, what I get does not match the result with Mathematica, in the sense that when I subtract the result of my computation from the result which Mathematica gives, the result is not $$0$$. Is there something that I am doing wrong?

Edit: I realised that I had a minus sign in the wrong place and for that reason the derivatives were coming out slightly wrong and the expressions were not matching the Mathematica result.

• Just to clarify notation: you're not asking for the Laplacian in polar coordinates, but the Hessian, correct? – peter a g Jul 18 '19 at 16:32
• @peter a g I'm asking for the result which you would get if you applied the grad operator, then applied the grad operator again, I hope that makes sense. I've put brackets in the right places now to try and clarify this, but it is in polar coordinates as you say where the function only depends on the radial coordinate. – Tom Jul 18 '19 at 23:14
• A suggestion: in polar coordinates the radial basis vector (with the holonomic basis) is already unit length, so you can simplify your notation a lot and the question will be easier to read. – Jackozee Hakkiuz Jul 19 '19 at 18:09
• Also, all of the derivatives should be with respect to $r$ (the radial coordinate), not with respect to $|\mathbb{r}|$ (the length of the radial basis vector, which is the constant $1$). – Jackozee Hakkiuz Jul 19 '19 at 18:15
• Jackozee Hakkiuz That's true, I think what I am essentially asking is, can someone do the computation of grad of the function $e^{-\gamma}/4 \pi$, then grad of the result and what do they get? I have tried it (modulo the notation) and think what I am getting should be right, but it does not seem to answer the result which Mathematica gives. – Tom Jul 20 '19 at 11:35

$$\newcommand{\d}{\operatorname{d}\!}$$ It is important to realise that the gradient is an operator that acts only on scalar functions, and produces a tensor of degree 1. After that, you need to use the covariant derivative. That's probably where you went wrong, since the covariant derivative of the basis is not always zero: that is Christoffel symbols are for. If $$\mu$$ is a scalar function, $$\d{x}^i$$ are the basis 1-forms, and $$\Gamma^{i}{}_{jk}$$ are the Christoffel symbols, the equations $$\nabla \mu = \sum_i\frac{\partial \mu}{\partial x^i}\d x^{i} \tag{1}$$ $$\nabla (\d{x}^{i}) = -\sum_{j,k}\Gamma^{i}{}_{jk}\d{x}^j\otimes\d{x}^{k} \tag{2}$$ are valid in any coordinate system. In the case polar coordinates for the plane, the Christoffel symbols are $$\Gamma^{2}{}_{21}=\Gamma^{2}{}_{12}=\frac{1}{r}$$, $$\Gamma^{1}{}_{22}=-r$$ and every other entry is zero. Hence, for the case that $$\mu$$ depends only on $$r$$, by virtue of the Leibniz rule and equation $$(1)$$, we have $$\nabla\mu = \frac{\partial \mu}{\partial r}\d{r}$$ $$\nabla\nabla\mu = \nabla\left(\frac{\partial \mu}{\partial r}\right)\d{r} + \frac{\partial \mu}{\partial r}\nabla(\d{r})$$ now from $$(2)$$, we have $$\nabla(\d{r}) \equiv \nabla(\d{x}^{1}) = -\sum_{i,j}\Gamma^{1}{}_{ij}\d{x}^i\otimes\d{x}^{j}=-\Gamma^{1}{}_{22}\d{x}^2\otimes\d{x}^2\equiv r\d{\theta}\otimes\d{\theta}$$; hence we get $$\nabla\nabla\mu = \frac{\partial^{2} \mu}{\partial r^{2}}\d{r}\otimes\d{r} + r\frac{\partial \mu}{\partial r}\d{\theta}\otimes\d{\theta}$$ As you see, since the Hessian is a bilinear form, it is an element of the second tensor power of the cotangent space at each point. You could turn the Hessian into a contravariant object using the musical isomorphism $$\sharp$$ provided by the metric: send $$\d{x}^{i}\mapsto g^{ij}v_{j}$$ (where $$v_i$$ are the holonomic basis vectors). In polar coordinates this gives $$\d{r}\equiv\d{x}^{1}\mapsto g^{11}v_{1} \equiv v_{r}$$ and $$\d{\theta}\equiv\d{x}^{2}\mapsto g^{22}v_{2} \equiv \frac{1}{r^{2}}v_{\theta}$$. Hence you get $$(\nabla\nabla\mu)^{\sharp} = \frac{\partial^{2} \mu}{\partial r^{2}}v_{r}\otimes v_{r} + \frac{1}{r^{3}}\frac{\partial \mu}{\partial r}v_{\theta}\otimes v_{\theta}$$

Moreover, people often like to normalize their basis. We have $$|v_{r}|=1$$ and $$|v_\theta|=r$$, so the normal basis will be $$e_r = v_r$$ and $$e_\theta = \frac{1}{r}v_\theta$$. Hence you get

$$(\nabla\nabla\mu)^{\sharp} = \frac{\partial^{2} \mu}{\partial r^{2}}e_{r}\otimes e_{r} + \frac{1}{r}\frac{\partial \mu}{\partial r}e_{\theta}\otimes e_{\theta}$$

• Jackozee Hakkiuz This is a good diff geo answer, but for the problem I am trying to work on, I am essentially trying to do everything in classical vector analysis. – Tom Jul 20 '19 at 17:49
• Basically, I am doing a problem with a supervisor who only knows vector analysis, if I put everything in differential geometry terms and start talking about bilinear forms, he won't know what I am talking about. – Tom Jul 20 '19 at 18:24
• @Tom Ok. But you can't avoid the fact that the Hessian is a bilinear form. If you want to turn it into vector terms it won't be the Hessian anymore. Anyway, just do all the same calculations in the tangent rather than the cotangent space. I have added the procedure to do what I think you want. – Jackozee Hakkiuz Jul 20 '19 at 18:56
• Sorry, but I've never seen the derivative of a vector field in polar coordinates using only classical vector calculus; only in cartesian, and in that case the covariant derivative of the basis vector fields vanishes. I.e., all $\Gamma^{i}{}_{jk}=0$. What exactly do you mean with "classical"?. Even the use of $\otimes$ in your question is not "classical", imo. – Jackozee Hakkiuz Jul 21 '19 at 4:08

First of all, from your interaction with Jackozee, I think you're taking things to be happening in the plane (so 'polar' rather than some higher dimensional 'spherical').

Next, I'm posting this without a sanity check, so I hope I'm not'screwing up' in public... If I have, I'll take it down with the appropriate degree of shame.

I'm not at ease with your notation, but unless I'm misunderstanding your argument, I think you might have simply made an algebra mistake with the product rule:

Write $$\mu = \mu_\gamma$$, $$r$$ for the norm of the vector $${\bf r}$$, and view $$\hat r = e_r$$ and $$e_\theta$$ both as elements or as functions taking value in the plane, as need be, so that the below 'parses.'

Then, shouldn't you have, on the second line: $$\nabla \nabla \mu= \nabla (e_r){ \partial\mu\over \partial r } + e_r \nabla {\partial \mu \over \partial r} ?$$ (Namely, it seems to me your $$\nabla {\bf r} \over {|\bf r |}$$ should have been $$\nabla\left( {\bf r} \over {|\bf r |}\right)$$.)

Take $$\nabla (e_r)$$ to be derivative of the map $${\bf r} \mapsto {{\bf r}\over | {\bf r}|}.$$ Then, in the radial direction, $${\bf r} \mapsto e_r$$ is constant, and the derivative vanishes radially. On the other hand, on a circle [or sphere, in higher dimensions] of radius $$r$$, the function $$e_r$$ coincides with a linear map (from the plane to the plane), which is, of course, to divide by (the fixed) $$r$$: $${\bf x} \mapsto {1\over r} {\bf x} .$$ [I'm using $$\bf x$$ rather $$\bf r$$ to emphasize that the $$r$$ does not depend on $$\bf x$$.] Therefore, the derivative, when restricted to the tangent space (viewed as a subspace of the plane) of the circle, is $$1/r \times \text{Identity}$$. Therefore, as I understand the going notation,
$$\nabla (e_r) = {1\over r}e_\theta\otimes e_\theta.$$

I get the same answer as Jackozee: $$\nabla \nabla \mu = \frac{\partial^{2} \mu}{\partial r^{2}}e_{r}\otimes e_{r} + \frac{1}{r}\frac{\partial \mu}{\partial r}e_{\theta}\otimes e_{\theta}.$$ Hopefully this is what Mathematica gives you - is it?

Alternatively, one can do all this 'by hand': use $${\partial\over \partial x} = \cos \theta {\partial\over \partial r} -{\sin \theta\over r} {\partial\over \partial \theta},$$ and $${\partial\over \partial y} = \sin \theta {\partial\over \partial r} +{\cos \theta\over r} {\partial\over \partial \theta},$$ and directly calculate all of the (double derivative) entries of the $$2\times 2$$ matrix by hand. Doing so gives the same answer - unless I've screwed something up...

• Haha of course. It didn't occur to me to calculate in cartesian coordinates and passing to polar afterwards. Do you mind if I include that calculation in another answer? Just for fun. – Jackozee Hakkiuz Jul 25 '19 at 9:07
• @JackozeeHakkiuz by all means... – peter a g Jul 25 '19 at 11:49