While reading my textbook, I found the following:
$$ \vec{L}^2=-\hbar^2r^2(\hat{r}\times\vec{\nabla})\cdot(\hat{r}\times\vec{\nabla})=-\hbar^2r^2\left[\nabla^2-\frac{1}{r^2}\frac{\partial}{\partial r}\left(r^2\frac{\partial}{\partial r}\right)\right]$$
I tried to prove the above equation by doing the following.
Knowing that : $$(\vec{A}\times\vec{B}).(\vec{C}\times\vec{D})=(\vec{A}.\vec{C})(\vec{B}.\vec{D})-(\vec{A}.\vec{D})(\vec{B}.\vec{C})$$ And making the paropiate substitutions I'm left with this: $$\nabla^2-(\hat{r}.\vec{\nabla})(\vec{\nabla}.\hat{r})$$ I am working in spherical coordinates so we have: $$\hat{r}.\vec{\nabla}=\frac{\partial}{\partial r}$$ $$\vec{\nabla}.\hat{r}=?$$ where in place of the question mark I found $\frac{2}{r}$ but I know it must be wrong. I used the following partial derivatives of unit vector properties in spherical coordiantes:
\begin{aligned} \frac{\partial \hat{r}}{\partial r}&=0, & \frac{\partial\hat{\theta}}{\partial r}&=0, & \frac{\partial\hat{\varphi}}{\partial r}&=0,\\[6pt] \frac{\partial\hat{r}}{\partial\theta}&=\hat{\theta}, & \frac{\partial\hat{\theta}}{\partial\theta}&=-\hat{r}, & \frac{\partial\hat{\varphi}}{\partial\theta}&=0,\\[6pt] \frac{\partial\hat{r}}{\partial\varphi}&=\hat{\varphi}\sin\theta, & \frac{\partial\hat{\theta}}{\partial\varphi}&=\hat{\varphi}\cos\theta, & \frac{\partial\hat{\varphi}}{\partial\varphi}&=-\hat{r}\sin\theta-\hat{\theta}\cos\theta, \end{aligned}
Also Knowing the gradient for spherical coordinates: $$\vec{\nabla} = \hat{x}\frac{\partial}{\partial x}+\hat{y}\frac{\partial}{\partial y}+\hat{z}\frac{\partial}{\partial z}=\hat{r}\frac{\partial}{\partial r}+\hat{\theta}\frac{1}{r}\frac{\partial}{\partial \theta}+\hat{\varphi}\frac{1}{r\sin\theta}\frac{\partial}{\partial \varphi}, $$
I know I must be wrong because the quatruple product stands for vectors, but it might not be the case for operators. I tried taking in consideration the order of the products, as a last resource i tried to take into account the commutator of the unit vector and the gradient but failed to find an expression because i'm still green in this area. I would greatly apreciate if someone could clear my doubts, I also know I could've taken the cross products directly but is there a way of doing this by taking this path? It's always enlightning to be able to do computations in different ways.