Question about derivative of $\cos(x)$. The question is how to show the derivative of $\cos x$ is $-\sin x$ using the definition of the derivative.
I do this proof in the normal way by using the sum of $\cos (x+h)$ using the trig identity, and then factoring out the $\cos x$ and using two special squeeze theorems.  I get the correct answer of $-\sin x$.
Here is how he does it and it seems illegal:
$$\lim_{h \mapsto 0 } \frac{(\cos x)(\cos h)-(\sin x)(\sin h)  -\cos x}h   $$
then he says in the NUMERATOR, letting $ h=0$ makes the numerator become:
$\cos x (1)-\sin x\sin h-\cos x$ Notice that he just selectively let the $\cos h$ term have $h$ go to zero but NOT the $\sin h$ term!!!
The two $\cos x $ terms cancel out leaving 
$\lim_{h \mapsto 0 }-\sin x\sin h/h$
and he uses the squeeze theorm to get $-\sin x (1)$
But I don't see how it is legal to let $h=0$ for some terms in the numerator without considering the denominator.  He DOES get the right answer, but it seems illegal to me.  Thoughts?
 A: \begin{align}
& \lim_{h\to0}\frac{(\cos x)(\cos h)-(\sin x)(\sin h)  -\cos x}h \\[12pt]
= {} & (\cos x)\,\, \underbrace{\lim_{h\to0} \left( \frac{(\cos h) -1} h \right)}_\text{first limit} - (\sin x)\,\, \underbrace{\lim_{h\to0} \left( \frac{\sin h} h \right)}_\text{second limit}
\end{align}
The first limit is $0$ and the second is $1$.
That's the way to do this. He shouldn't be letting $h=0$ in the numerator while leaving $h$ in the denominator. The fact that the first limit is $0$ cannot be shown merely by showing that the limit of the numerator is $0.$ If that were valid, the the same argument argument would show that the second limit is $0,$ and that is wrong.
A: Maybe your teacher isn't phrasing it carefully or well enough. What we do is write the limit as
$$ \lim_{h \to 0} \frac{(\cos x)(\cos h) - (\sin x)(\sin h) - \cos x}{h} = \lim_{h \to 0} \left[ \cos x \left( \frac{\cos h - 1}{h} \right) - \sin x \left( \frac{\sin h}{h} \right) \right] $$
and we use our limit rules:
$$ \lim_{h \to 0} \left[ f(h) - g(h) \right] = \left[ \lim_{h \to 0} f(h) \right] - \left[ \lim_{h \to 0} g(h) \right] $$
provided the limits exist.
Thus
$$
\hspace{-2cm} \lim_{h \to 0} \left[ \cos x \left( \frac{\cos h - 1}{h} \right) - \sin x \left( \frac{\sin h}{h} \right) \right] \\ \qquad=  \left[ \lim_{h \to 0} \cos x \left( \frac{\cos h - 1}{h} \right) \right] - \left[ \lim_{h \to 0} \sin x \left( \frac{\sin h}{h} \right) \right] \\
\qquad = \left[ \cos x \lim_{h \to 0} \left( \frac{\cos h - 1}{h} \right) \right]-\left[ \sin x \lim_{h \to 0} \left( \frac{\sin h}{h} \right) \right] $$
And now we use the limits
$$  \lim_{h \to 0} \left( \frac{\cos h - 1}{h} \right) = 0 \text{ and } \lim_{h \to 0} \left( \frac{\sin h}{h} \right) = 1 $$
to get
$$ \lim_{h \to 0} \left[ \cos x \left( \frac{\cos h - 1}{h} \right) - \sin x \left( \frac{\sin h}{h} \right) \right] = - \sin x. $$
A: I respect to other solutions but I prefer this
$$\lim_{h\to0}\dfrac{\cos(x+h)-\cos(x)}{h}=\lim_{h\to0}\dfrac{-2\sin(x+\frac{h}{2})\sin(\frac{h}{2})}{h}=-\sin(x)$$
