# How do you find the derivative of y=cos(x) from first principle?

Aug 22, 2014

Using the definition of a derivative:

$\frac{\mathrm{dy}}{\mathrm{dx}} = {\lim}_{h \to 0} \frac{f \left(x + h\right) - f \left(x\right)}{h}$, where $h = \delta x$

We substitute in our function to get:

${\lim}_{h \to 0} \frac{\cos \left(x + h\right) - \cos \left(x\right)}{h}$

Using the Trig identity:

$\cos \left(a + b\right) = \cos a \cos b - \sin a \sin b$,

we get:

${\lim}_{h \to 0} \frac{\left(\cos x \cos h - \sin x \sin h\right) - \cos x}{h}$

Factoring out the $\cos x$ term, we get:

${\lim}_{h \to 0} \frac{\cos x \left(\cos h - 1\right) - \sin x \sin h}{h}$

This can be split into 2 fractions:

${\lim}_{h \to 0} \frac{\cos x \left(\cos h - 1\right)}{h} - \frac{\sin x \sin h}{h}$

Now comes the more difficult part: recognizing known formulas.

The 2 which will be useful here are:

${\lim}_{x \to 0} \sin \frac{x}{x} = 1$, and ${\lim}_{x \to 0} \frac{\cos x - 1}{x} = 0$

Since those identities rely on the variable inside the functions being the same as the one used in the $\lim$ portion, we can only use these identities on terms using $h$, since that's what our $\lim$ uses. To work these into our equation, we first need to split our function up a bit more:

${\lim}_{h \to 0} \frac{\cos x \left(\cos h - 1\right)}{h} - \frac{\sin x \sin h}{h}$

becomes:

${\lim}_{h \to 0} \cos x \left(\frac{\cos h - 1}{h}\right) - \sin x \left(\frac{\sin h}{h}\right)$

Using the previously recognized formulas, we now have:

${\lim}_{h \to 0} \cos x \left(0\right) - \sin x \left(1\right)$

which equals:

${\lim}_{h \to 0} \left(- \sin x\right)$

Since there are no more $h$ variables, we can just drop the ${\lim}_{h \to 0}$, giving us a final answer of: $- \sin x$.