A squared quantum operator is the same as using the same operator twice? So can't we find $L^2$ operator by using the $\mathbf L$ operator twice? I understand that we can use the ladder formula and dervie the $L^2$ operator but is it wrong to use the L operator formula directly and apply it twice to observe the $L^2$ instead?
\begin{align}
L^2 & = -\hbar^2 \left[ \frac{1}{\sin\theta}\frac{\partial}{\partial \theta} \left({\sin\theta}\frac{\partial}{\partial \theta}\right) + \frac1{\sin^2\theta}\frac{\partial^2}{\partial \phi^2}\right]
\\
\mathbf L & = -i\hbar \left(\hat\phi \frac{\partial}{\partial \theta} - \hat\theta\frac{1}{\sin\theta}\frac{\partial}{\partial \phi}\right)
\end{align}
I couldn't understand from where the $\sin\theta$ term is coming in the $\partial/\partial \theta$ part.
 A: The squared operator $L^2$ is taken from a dot product:
\begin{align}
L^2 & = \mathbf L \cdot \mathbf L
 = L_x^2 + L_y^2 + L_z^2 
.
\end{align}
Within that dot product, each product of operators (i.e. $L_x^2 = L_xL_x$, etc.) is formed by acting with the same operator twice.
So, for example, to get $L_x^2$, you first transform the vector operator into cartesian components, which can be shown to be
$$
L_x = i\hbar \left( \sin(\phi)\frac{\partial}{\partial \theta} + \cot(\theta)\cos(\phi)\frac{\partial}{\partial \phi} \right),
$$
and then you calculate the square of the operator by making it act twice. When doing this, you will get terms like
$$
\cos(\phi)\frac{\partial}{\partial \phi} \cdot \cos(\phi)\frac{\partial}{\partial \phi},
$$
where it is important to understand what's happening: you are taking subsequent products and derivatives, so the effect of this operator on a function $f(\phi)$ is the combined derivative
\begin{align}
\cos(\phi)\frac{\partial}{\partial \phi} \left(\cos(\phi)\frac{\partial}{\partial \phi} f(\phi)\right)
& =
\cos(\phi)\frac{\partial}{\partial \phi} \bigg(\cos(\phi) f'(\phi)\bigg)
\\ & =
\cos(\phi)\bigg(\cos(\phi) f''(\phi) - \sin(\phi) f'(\phi)\bigg)
\\ & =
\cos(\phi)\bigg(\cos(\phi) \frac{\partial^2}{\partial \phi^2} - \sin(\phi) \frac{\partial}{\partial \phi}\bigg)f(\phi)
.
\end{align}
To finalize, you can then "factor out" the $f(\phi)$ to get
$$
\cos(\phi)\frac{\partial}{\partial \phi} \cdot \cos(\phi)\frac{\partial}{\partial \phi}
=
\cos^2(\phi) \frac{\partial^2}{\partial \phi^2} - \sin(\phi)\cos(\phi) \frac{\partial}{\partial \phi}
$$
(where basically you're saying that the two operators are equal, since their action on all functions is the same).
From those ingredients, it's just a matter of doing all the calculations and then putting it all together.

Now, it's a good question whether it is possible to do the calculation directly on the spherical polar coordinate expression for $\mathbf L$ that you quote. The problem there is that the unit vectors are themselves functions of position, namely
\begin{align}
\hat\theta & =  \cos(\theta)\cos(\phi)\hat{x} + \cos(\theta)\sin(\phi)\hat{y} - \sin(\theta)\hat{z}
\\
\hat\phi & = -\sin(\phi) \hat{x} + \cos(\phi)\hat{y}
,
\end{align}
and this needs to be taken into account. The implication there is that when you're taking the combined product, you're really doing something like
\begin{align}
L^2 & = \mathbf L \cdot \mathbf L
\\ & =
-\hbar^2
\left((\hat\phi\cdot) \frac{\partial}{\partial \theta} - (\hat\theta\cdot)\frac{1}{\sin(\theta)}\frac{\partial}{\partial \phi}\right)
\left(\hat\phi \frac{\partial}{\partial \theta} - \hat\theta\frac{1}{\sin(\theta)}\frac{\partial}{\partial \phi}\right)
,
\end{align}
where $(\hat\phi\cdot)$ and $(\hat\theta\cdot)$ are operators that take vectors and return their dot products with $\hat\phi$ and $\hat\theta$, and where the partial derivatives on the factor on the left act on (i) the derivatives on the right as well as (ii) on the scalar factors, but also, importantly, (iii) on the unit vectors themselves.
By all means give that a go if you want to. But if your result disagrees with the cartesian calculation, it's the latter that's right. If you do that work and you have further questions, then it would be appropriate to post your workings and ask for specific guidance.
A: Yes, of course. Consider $\hat r \cdot \mathbf L  =0\require{cancel} $.
Just do the operator dot product.

Recall
$$
\partial_\phi  ~\hat \phi= -\cos\theta ~\hat\theta -\sin\theta ~\hat r, ~~~~  \partial_\phi  ~\hat     \theta= \cos    \theta ~\hat \phi   ,\\
\partial_ \theta   ~\hat  \phi=0, ~~~~ \partial_ \theta   ~  \hat   \theta =-\hat r,
$$
whence
$$\mathbf L \cdot \mathbf L   = -\hbar^2 \left(\hat\phi \frac{\partial}{\partial \theta} - \hat\theta\frac{1}{\sin\theta}\frac{\partial}{\partial \phi}\right)  \cdot \left(\hat\phi \frac{\partial}{\partial \theta} - \hat\theta\frac{1}{\sin\theta}\frac{\partial}{\partial \phi}\right) \\
= -\hbar^2 \left( \partial_\theta ^2 + {1\over \sin^2\theta}  \partial_\phi ^2  -\xcancel{\hat \phi \cdot \partial_\theta \hat \theta }{1\over\sin\theta} \partial_\phi
-\hat\theta\cdot  \partial_\phi\hat\phi {1\over\sin\theta}\partial_\theta +\xcancel{\hat\theta\cdot  \partial_\phi \hat \theta } {1\over\sin^2\theta}  \partial_\phi  \right ) \\  =
 -\hbar^2 \left( \partial_\theta ^2 + {1\over \sin^2\theta}  \partial_\phi ^2   + \frac{ \cos\theta}{\sin\theta}\partial_\theta \right )  \\ 
 = -\hbar^2 \left  ( \frac{1}{\sin\theta} {\partial_\theta} \left({\sin\theta}~ {\partial_ \theta}\right) + \frac1{\sin^2\theta} \partial_ \phi^2\right ).
 $$
Do you see how most dot products involving gradients of direction unit vectors like $\xcancel{these}$ collapse? Do you see why?
