Differentiation 1
YouTube lecture recording from October 2020
The following YouTube video was recorded for the 2020 iteration of the course. The material is still very similar:
Gradients
We often want to know about the rate at which one quantity changes over time. Examples:
The rate of disappearance of substrate with time in an enzyme reaction.
The rate of decay of a radioactive substance (how long will it have activity above a certain level?)
The rate of bacterial cell growth over time.
How quickly an epidemic is growing.
Defining the gradient
The gradient of a curve at a point is the slope of the tangent of the curve at that point.
The tangent is the line that "just touches" (but doesn't cross) the curve.
The gradient is also known as the rate of change or derivative, and the process of finding the gradient is called differentiation.
The gradient of the curve is denoted in a few different ways, the three most common are:
Example,
At the gradient is shallow and sloping up to the right:
At the gradient is steeper, and sloping down to the right:
Example,
For this function, the gradient is always sloping up to the right, but gets shallower as increases:
Algebraic example
If we want to find for :
Try with
We can use Python as a calculator to evaluate these differences:
x_1 = 1.5 x_2 = 2.5 y_1 = x_1**3 + 2 y_2 = x_2**3 + 2 print((y_2-y_1)/(x_2-x_1)) x_1 = 1.9 x_2 = 2.1 y_1 = x_1**3 + 2 y_2 = x_2**3 + 2 print((y_2-y_1)/(x_2-x_1)) x_1 = 1.99 x_2 = 2.01 y_1 = x_1**3 + 2 y_2 = x_2**3 + 2 print((y_2-y_1)/(x_2-x_1))
12.25 12.010000000000003 12.00009999999997
As the difference between and gets smaller, the gradient stabilises. The value it converges to is the gradient at the midway point of and .
Calculating gradients exactly
This is called a finite difference approximation to the gradient. The approximation becomes more accurate the smaller h is.
When using the approximation, we denote the changes as , in the limit as h goes to 0, this becomes .
In this way, is an operator, acting on .
Note, the s cannot be cancelled out, as they aren't variables, they denote an infinitely small change.
Notice how, as the finite difference gets smaller and smaller, the approximation to the gradient (the green line) gets closer and closer to the true gradient (the orange line):
Example
Find the gradient of .
> > > >
Now this is only exactly right when . So letting that happen, we have
Derivative of polynomial functions
Using techniques like the one above (which is called differentiation from first principles), one can generalise the connection between powers of and their derivatives:
If , then its derivative is
Examples to try
Summing and multiplying derivatives
Summing
e.g.
Multiplying (by a scalar)
e.g.
This only works for scalars.
In most circumstances
e.g.
Higher-order derivatives
You can take a derivative of a function multiple times in a row. This is usually denoted either or for second-order derivatives (differentiating twice), and similar for higher orders.
e.g.
> >
Interpreting derivatives
The sign of the first derivative tells us how is growing
Positive gradient: If then is increasing at
Negative gradient: If then is decreasing at
Zero gradient: If then is not changing (flat) at
Extreme values (turning points and points of inflection)
Local maximum: and
Local minimum: and
Inflection:
Example: Find the stationary points of
To do this, we need to know both and .
>
Stationary points occur when
> >
At :
So this point is a maximum.
At
So this point is a mimimum.
Inflection points occur whenever
>
This is an inflection point.
Note: Points of inflection do not require that , only that .
Points of inflection are important in biology as they define conditions where a response (e.g. reaction rate) is most or least sensitive to a change in conditions (e.g. the concentration of a metabolite).
Reminder on curve sketching
Aim to evaluate and identify key values of the function (i.e. turning points, points of inflection)
Look at the limit behaviour as and as approaches any points where the function is undefined (e.g. for ).
Determine the first and second order derivatives to find turning points and points of inflection.
Real life example
The number (in thousands) of bacteria on an agar plate at time (in days) is given by the expression:
Find the time at which the greatest number of bacteria are present on the plate.
Find the number of bacteria on the plate at this time.
Solution
To do this we must find the turning points of the function.
Find the time at which the greatest number of bacteria are present on the plate
To show this is a maximum, we need to check
Therefore, , for . This means that a maximum occurs at days.
Find the number of bacteria on the plate at this time
The greatest number of bacteria on the plate is 24,420.
Real life example 2
The growth rate of a cell colony with cells at time can be represented by the equation
For this example take the constants and as /hr, and /hr. This is called a logistic model.
What is the equilibrium size of the population?
What population size leads to the largest growth rate?
Solution
The equilibrium will occur when the population stops changing, i.e. when . Meaning:
We can disregard the solution, as it represents population extinction. This means that
.
To find the largest growth rate, we want the maximal value of . This means we need to find .
If
Since , we can be sure that this is a maximum.
Introductory problems
Introductory problems 1
Use the formula to calculate the derivatives of the functions below. Check your answers by using the standard rules for differentiation:
(harder)
Introductory problems 2
Find the gradient at the given points of the following curves:
Introductory problems 3
Find the and coordinates of the points on the given curves at which the gradient is zero and find out whether they are maxima, minima or points of inflexion:
Main problems
Main problems 1
One hour after taking of a drug, the body temperature, , in C of a patient is given by: where is the initial body temperature.
Determine the value of that produces the greatest drop in body temperature, and the magnitude of that temperature change.
Sketch as a function of the concentration.
Main problems 2
The formula for the Lennard Jones potential between two non polar atoms is given in terms of the positive constants and and the internuclear distance, , as:
Use this formula to calculate as a function of .
Show that the potential where the gradient is zero is .
Find mathematically whether this point is a maximum, minimum or point of inflexion.
Main problems 3
The number (in thousands) of bacteria on an agar plate at time days is given by the expression:
Draw a graph of the function between and days. Give one reason why this function might be a reasonable model for the number of bacteria on the plate at time . Are there any values of for which this is probably not a good model?
Calculate the time at which the greatest number of bacteria are present on the plate and show that this must be a maximum number.
By finding the roots of the equation for , find the two times at which the value of is zero and say why only one of these times is physically reasonable. Mark and label the maximum point on your graph together with the point at which the number of bacteria is zero.
Find the rates at which the bacteria are growing when and days.
Main problems 4
Being able to change direction rapidly helps fish to avoid predators. We can describe the distance (in cm) travelled by time seconds after a stimulus by where for rainbow trout , , and for green sunfish , .
Compare the distance travelled, and the instantaneous velocity and acceleration for these species at s.
Compare the velocities in fish lengths per second, given that the lengths of trout and sunfish are cm and cm respectively, commenting on your answer.
Main problems 5
A researcher measured the concentration of a protein _in vitro* and obtained the readings below:
time (min) | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|---|
c (mM) | 11.91 | 7.06 | 4.40 | 2.57 | 1.81 | 1.03 | 0.72 |
She surmised that the protein was being degraded according to the reaction scheme
under mass action kinetics.
Use a suitable transformation to draw a straight-line graph of the data, in order to test her hypothesis.
Find the maximum rate of decay and the time at which this occurs.
Find the concentration of protein remaining after 10 minutes.
Extension problems
Extension problems 1
Find the values of for which the following functions have stationary values and using your results, sketch a graph of each function:
Use Python to check your results.
Extension problems 2
The graph shows the rate of CO emissions per year since 1800, with three fitted lines in red.
A climate scientist thinks that a quadratic curve could be a better fit to the data, with the x-axis as years since 1850, and the y-axis as the rate of CO emissions per year. The curve would have the equation
By using the points taken from the best fit lines, evaulate the coefficients , , and in this model.
Find the minima of this quadratic curve. Use this to assess the suitability of the quadratic model as a fit for the data.
Extension problems 3
A protein degrades according to the formula
where is the protein concentration, is the initial concentration, is a constant, and is time.
Find the rate for this reaction and deduce a plausible reaction schema. Hint: you may find it useful to express the derivative in terms of .
Extension problems 4
From first principles (as in the first question on this sheet) prove the formulas for differentiation of sums, differences and scalar multiples.