I found this development for the calculation of angular momentum L^2 operator in spherical coordinates. The image attached shows the latest step of this. I cannot figure out the algebra between these 2 latest steps. The term grayed out vanishes, but I can't see how the the first three ones become the final resultant expression.

Any help? Thanks!

![enter image description here][1]


  [1]: https://i.sstatic.net/m7biY.jpg