Differentiating sin(x) and cos(x)
In a nutshell
The derivatives of the sine and cosine functions are nicely related, and in fact if you keep differentiating them, they show the same cyclic pattern. Here you'll see how to derive these derivatives from first principles. Once you understand where the derivatives come from, you are free to use the convenient and easy-to-remember results.
Note: The content here assumes everything is in radians. The results of the derivatives will not be true when working in degrees.
Prerequisites
To derive the derivatives of the sine and cosine functions, you will see a reminder on some essential points.
Double angle formulae
The derivation of the derivatives will use the following double angle formulae:
sin(a±b)=cos(a±b)= sin(a)cos(b)±cos(a)sin(b) cos(a)cos(b)∓sin(a)sin(b)
Small angle estimations
For a small angle θ, the following estimations can be taken:
sin(θ)≈cos(θ)≈ 1 1−2θ2
Thus, the following limits can be used:
θ→0limθsin(θ)= 1θ→0limθ1−cos(θ)= 0
Differentiating from first principles
Recall that to differentiate from first principles, you find the gradient of a line segment between a point and another point nearby, that gets shorter and shorter until it is essentially the first point. In other words, to differentiate a function f(x) with respect to x, you use:
f′(x)=h→0limhf(x+h)−f(x)
Differentiating sin(x) with respect to x
Let f(x)=sin(x). Then:
f′(x)=h→0limhsin(x+h)−sin(x)
Using the double angle formula for sin(a+b), you have:
f′(x)=h→0limhsin(x)cos(h)+cos(x)sin(h)−sin(x)=h→0limhsin(x)[cos(h)−1]+cos(x)sin(h)=h→0limhsin(x)[cos(h)−1]+h→0limhcos(x)sin(h)
Since sin(x) and cos(x) are independent of h, they can come out of their limits:
f′(x)=sin(x)h→0limhcos(h)−1+cos(x)h→0limhsin(h)=−sin(x)h→0limh1−cos(h)+cos(x)h→0limhsin(h)
Using the small angle estimates, you have
f′(x)=−sin(x)×0+cos(x)×1=cos(x)
Thus
dxd(sin(x))=cos(x)
Differentiating cos(x) with respect to x
Example 1
Using first principles, find the derivative of cos(x) with respect to x.
You can follow the same process seen above with sin(x). Start by letting f(x)=cos(x). Then by first principles, you have:
f′(x)=h→0limhcos(x+h)−cos(x)
Using the double angle formula for cos(a+b), this becomes:
f′(x)=h→0limhcos(x)cos(h)−sin(x)sin(h)−cos(x)=h→0limhcos(x)[cos(h)−1]−sin(x)sin(h)=h→0limhcos(x)[cos(h)−1]−h→0limhsin(x)sin(h)
Again, the cos(x) and sin(x) are independent of h and can thus be factored out of their limits:
f′(x)=cos(x)h→0limhcos(h)−1−sin(x)h→0limhsin(h)=−cos(x)h→0limh1−cos(h)−sin(x)h→0limhsin(h)
Using the small angle formulae gives:
f′(x)=−cos(x)×0−sin(x)×1=−sin(x)
Hence you have found that:
dxd(cos(x))=−sin(x)
Higher order derivatives
It follows that if you keep differentiating, you obtain the same cyclic pattern from both sin(x) and cos(x). By differentiating repeatedly, you get
...→sin(x)→cos(x)→−sin(x)→−cos(x)→sin(x)→...
Example 2
Differentiate the following function with respect to x:
f(x)=5sin(x)−3cos(x)
Differentiating term by term gives:
f′(x)=5cos(x)−3(−sin(x))=5cos(x)+3sin(x)