To understand the derivative of sin and cos, consider their graphs, and when they are changing positively (increasing), negatively (decreasing) or not at all (no rate of change).
Other Differentiation Rules
Differentiation of sums, and scalar multiples
(f(x)±g(x))′=f′(x)±g′(x)(af(x))′=af′(x)
Differentiation of products
While differentiating sums, and scalar multiples is straightforward, differentiating products is more complex
So both rules produce the same result. While for simple examples the product rule requires more work, as functions get more complex it saves a lot of time.
Differentiating a function of a function - The Chain Rule
One of the most useful rules is differentiating a function that has another function inside it y=f(g(x)). For this we use the chain rule:
y=f(g(x)) > y′(x)=f′(g(x))g′(x)=dgdfdxdg
Example 1: y=(5x2+2)4
We can write this as y=g4, where g=5x2+2. Given this, we have that
dgdy=4g3=4(5x2+2)3 > dxdg=10x
This means that
dxdy=dgdydxdg=4(5x2+2)310x=40x(5x2+2)3
This extends infinitely to nested functions, meaning
dxd(a(b(c))=dbdadxd(b(c))=dbdadcdbdxdc
Differentiating the ratio of two functions - The Quotient Rule
If y(x)=g(x)f(x), then by using the product rule, and setting h(x)=(g(x))−1, we can show that
For any function y=f(x), with a well defined inverse f−1(x) (not to be confused with (f(x))−1)), we have by definition that
x=f−1(f(x))=f−1(y).
This means that we can apply the chain rule
dxd(x)=dxd(f−1(y))=dyd(f−1(y))dxdy
But since dxd(x)=1
dyd(f−1(y))=dxdy1
Example: y=ln(x)
If y=ln(x), this means that f−1(y)=ey=x
By definition (f−1(y))′=ey, as ey doesn't change under differentiation. This means that
dxd(ln(x))=dyd(f−1(y))1=ey1
But since y=ln(x):
dxd(ln(x))=eln(x)1=x1
Example - Differentiating using sympy
In Python, there is a special package for calculating derivatives symbolically, called sympy.
This can quickly and easily calculate derivatives (as well as do all sorts of other analytic calculations).
import sympy as sp
x = sp.symbols('x')# This creates a variable x, which is symbolically represented as the string x.# Calculate the derivative of x^2sp.diff(x**2, x)
2x
sp.diff(sp.cos(x), x)
−sin(x)
f =(x+1)**3* sp.cos(x**2-5)sp.diff(f,x)
−2x(x+1)3sin(x2−5)+3(x+1)2cos(x2−5)
f =(x+1)**3*(x-2)**2*(x**2+4*x +1)**4sp.diff(f, x)
You can look at the documentation for Sympy to see many other possibilities (e.g. we will use Sympy to do symbolic integration later on in this course)
Differentiate these series term by term to verify the standard expressions for dxd(sinx) and dxd(cosx).
Extension problems
Extension problems 1
The focal length of the lens of the eye, f(t), can be controlled so that an object at distance u(t) in front of the eye can be brought to perfect focus on the retina at a constant v=1.8cm behind the lens.
A fly is moving towards the eye at a speed of 0.7ms−1.
Assuming that the optics of the eye lens obeys the thin lens formula
f(t)1=u(t)1+v1,
find the rate of change of focal length required to keep the fly in perfect focus at a distance of 3m.
Note: consider carefully what you are differentiating with respect to, and the physical interpretation of the mathematics.
Extension problems 2
A contaminated lake is treated with a bactericide.
The rate of change of harmful bacteria t days after treatment is given by
dtdN=−1+t22000t
where N(t) is the number of bacteria in 1ml of water.
State with a reason whether the count of bacteria increases or decreases during the period 0≤t≤10.
Find the minimum value of dtdN during this period.
Extension problems 3
Consider a population of lions L(t) and zebra Z(t) interacting over time t.
One type of model for this situation is
dtdZ=aZ−bZLanddtdL=−cL+dZL,
where a, b, c and d are positive constants.
What values of dtdZ and dtdL correspond to stable populations?
How would the statement 'zebra go extinct' be represented mathematically?
For parameters a=0.05, b=0.001, c=0.05, and d=0.00001, find all population pairs (Z,L) that yield stable populations. Is extinction inevitable?