I was looking at this PDF (http://www.ifi.unicamp.br/~maplima/fi001/2012/aula20b.pdf) showing the derivation of the squared-angular momentum operator. Everything seems okay although I am just slightly lost in how exactly B.31 was derived. Isn't B.31 equal to the dot product of B.24 with itself? Where exactly does the sin in the numerator and denominator in B.31 come from when the theta component of B.24 is simply the partial derivative with respect to theta with no other terms? Shouldn't the theta components dotted with each simply yield the second order partial derivative with respect to theta when considering only this component?