I got a serious problem with an exercise I got on my tensor course.
I was given the following scalar field (in 3 dimensional physical space): $$ \phi(x)=\frac{1}{2}a^2(\frac{r^2(x)}{3a^2}-1)$$ $$ r(x) = |x|, |x| > a$$ We are talking about tensor field, so the |x| is actually not a single coordinate, but the length, more like (in cartesian): $|x| = \sqrt{x_1^2 + x_2^2 + x_3^2}$, where the $x_i$ are the coordinates.
I have to calculate, both in cartesian and spherical coordinates, the values of: $F(x)=\nabla^2 \phi(x)$, $rot(\nabla \phi(x))$ and $F(x) \cdot a$, where $a$ is a vector of length a.
I know that in case of tensor derivative theory: $$\nabla\phi = \frac{\delta\phi}{\delta x_1}\overline{e_1} + \frac{\delta\phi}{\delta x_2}\overline{e_2} + \frac{\delta\phi}{\delta x_3}\overline{e_3}$$ And one more time you get (in general form): $$\nabla(\nabla\phi) = \frac{\delta^2\phi}{\delta x_i\delta x_j}\overline{e_i}\otimes\overline{e_j}$$ but I have no idea how can I go forward with this. I tried just pluggin the $r(x)$ value in (then I get $ \phi(x_1, x_2, x_3)=\frac{1}{2}a^2(\frac{x_1^2 + x_2^2 + x_3^2}{3a^2}-1)$). I can easily calculate derivatives on $x_1, x_2, x_3$ from this, but it seems too easy or just too stupid to be correct.
Any help would be heavily appreciated.
EDIT: There are my attempts of solving it "the too easy way" (which is the right way apparently): $$ \phi(x)=\frac{1}{2}a^2(\frac{r^2(x)}{3a^2}-1)=\frac{r^2(x)}{6} - \frac{1}{2}a^2$$ Using that $|x| = \sqrt{x_1^2 + x_2^2 + x_3^2}$: $$\phi(x_1, x_2, x_3) = \frac{x_1^2 + x_2^2 + x_3^2}{6} - \frac{1}{2}a^2$$ (I assume I can omit the absolute value because of the $|x| > a$ condition) Then calculating the first $\nabla$: $$\nabla\phi = [\frac{x_1}{3}, \frac{x_2}{3}, \frac{x_3}{3}]$$ Second one: $$F(x) = \nabla(\nabla\phi) = \begin {bmatrix} \frac{1}{3} & 0 & 0\\ 0 & \frac{1}{3} & 0\\ 0 & 0 & \frac{1}{3} \end{bmatrix} = \frac{1}{3}\begin {bmatrix} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{bmatrix} = \frac{1}{3}I$$ Rotation (or $curl$) indeed equals 0.
In this case the multiplication by vector $\overline{a} = [a_1, a_2, a_3]$: $$F(x) \cdot a = \frac{1}{3}[a_1, a_2, a_3]$$
EDIT2: Continuing with the spherical coordinates. Assuming that: $$\begin{array} xx_1 = rsin(\theta)cos(\varphi)\\ x_2 = rsin(\theta)sin(\varphi)\\ x_3 = rcos(\theta) \end{array}$$ Plugging that in the equation and using pythagorean identity 2 times I get: $$ \phi(r,\theta,\varphi)= \frac{r^2}{6} - \frac{1}{2}a^2$$ Then doing the same things as above for spherical: $$\nabla\phi = [\frac{\delta\phi}{\delta r}, \frac{1}{r} \cdot \frac{\delta\phi}{\delta \theta}, \frac {1}{rsin(\theta)} \cdot \frac{\delta\phi}{\delta\varphi}] = [\frac{r}{3}, 0, 0]$$ EDIT3: Deleted the uncorrect Hessian calculation.
Just like the gradient is not exactly $({\partial\over\partial r}, {\partial\over\partial \theta}, {\partial\over\partial \varphi})$ in spherical coordinates because of the Jacobian that gets into the change of variables, the Hessian is not computed via simple derivations either.
The top-left entry of the Hessian in spherical coordinates is $\frac{1}{r^2}{\partial\over\partial r}(r^2{\partial\phi\over\partial r})$, which does give you the $1$ that you expect.