Background
When working out the Laplacian in spherical coordinate system, either via chain rule or differentiating the basis vectors, one arrives at the following:
$\nabla^2 = \frac{\partial^2}{\partial r^2} + \frac{2}{r}\frac{\partial}{\partial r} + \frac{1}{r^2}\frac{\partial^2}{\partial \theta^2} + \frac{1}{r^2}\frac{\cos \theta}{\sin\theta}\frac{\partial}{\partial \theta} + \frac{1}{r^2\sin^2\theta}\frac{\partial^2}{\partial \phi^2} $
which is further simplified to the following:
$\nabla^2 = \frac{1}{r^2}\frac{\partial}{\partial r}(r^2\frac{\partial}{\partial r}) + \frac{1}{r^2\sin\theta}\frac{\partial}{\partial \theta}(\sin\theta\frac{\partial}{\partial \theta}) + \frac{1}{r^2\sin^2\theta}\frac{\partial^2}{\partial \phi^2}$
Question
I'm curious as to how one finds out the following simplification could be done:
$ \frac{\partial^2}{\partial r^2} + \frac{2}{r}\frac{\partial}{\partial r} = \frac{1}{r^2}\frac{\partial}{\partial r}(r^2\frac{\partial}{\partial r}) $
and
$ \frac{1}{r^2}\frac{\partial^2}{\partial \theta^2} + \frac{1}{r^2}\frac{\cos \theta}{\sin\theta}\frac{\partial}{\partial \theta} = \frac{1}{r^2\sin\theta}\frac{\partial}{\partial \theta}(\sin\theta\frac{\partial}{\partial \theta}) $
Is there some technique or guideline to determine whether it is possible or not? I could easily prove it if I already know the final form, but if I have none, what can I use as a hint?