When Can I Use That Rule?

Calculus Level 2

$\begin{array} {l c l r } \displaystyle \lim_{x\to0} \dfrac{\sin x}{1-\cos x} &= &\displaystyle \lim_{x\to0} \dfrac{\frac d{dx}(\sin x)}{\frac d{dx} (1-\cos x)} & \quad (1) \\ \displaystyle &= &\displaystyle \lim_{x\to0} \dfrac{\cos x}{\sin x} & \quad (2) \\ \displaystyle &= &\displaystyle \lim_{x\to0} \dfrac{\frac d{dx}(\cos x)}{\frac d{dx}(\sin x)} & \quad (3) \\ \displaystyle &= &\displaystyle \lim_{x\to0} \dfrac{-\sin x}{\cos x} & \quad (4) \\ \displaystyle &= & -\dfrac{\sin0}{\cos 0} = 0 & \quad (5) \end{array}$

The above is my attempt at proving that $\displaystyle \lim_{x\to0} \dfrac{\sin x}{1-\cos x} = 0$. In which step did I first commit a flaw in my logic?

×