MAT1001 Differential Calculus: Lecture Notes

\(\newcommand{\footnotename}{footnote}\) \(\def \LWRfootnote {1}\) \(\newcommand {\footnote }[2][\LWRfootnote ]{{}^{\mathrm {#1}}}\) \(\newcommand {\footnotemark }[1][\LWRfootnote ]{{}^{\mathrm {#1}}}\) \(\let \LWRorighspace \hspace \) \(\renewcommand {\hspace }{\ifstar \LWRorighspace \LWRorighspace }\) \(\newcommand {\TextOrMath }[2]{#2}\) \(\newcommand {\mathnormal }[1]{{#1}}\) \(\newcommand \ensuremath [1]{#1}\) \(\newcommand {\LWRframebox }[2][]{\fbox {#2}} \newcommand {\framebox }[1][]{\LWRframebox } \) \(\newcommand {\setlength }[2]{}\) \(\newcommand {\addtolength }[2]{}\) \(\newcommand {\setcounter }[2]{}\) \(\newcommand {\addtocounter }[2]{}\) \(\newcommand {\arabic }[1]{}\) \(\newcommand {\number }[1]{}\) \(\newcommand {\noalign }[1]{\text {#1}\notag \\}\) \(\newcommand {\cline }[1]{}\) \(\newcommand {\directlua }[1]{\text {(directlua)}}\) \(\newcommand {\luatexdirectlua }[1]{\text {(directlua)}}\) \(\newcommand {\protect }{}\) \(\def \LWRabsorbnumber #1 {}\) \(\def \LWRabsorbquotenumber "#1 {}\) \(\newcommand {\LWRabsorboption }[1][]{}\) \(\newcommand {\LWRabsorbtwooptions }[1][]{\LWRabsorboption }\) \(\def \mathchar {\ifnextchar "\LWRabsorbquotenumber \LWRabsorbnumber }\) \(\def \mathcode #1={\mathchar }\) \(\let \delcode \mathcode \) \(\let \delimiter \mathchar \) \(\def \oe {\unicode {x0153}}\) \(\def \OE {\unicode {x0152}}\) \(\def \ae {\unicode {x00E6}}\) \(\def \AE {\unicode {x00C6}}\) \(\def \aa {\unicode {x00E5}}\) \(\def \AA {\unicode {x00C5}}\) \(\def \o {\unicode {x00F8}}\) \(\def \O {\unicode {x00D8}}\) \(\def \l {\unicode {x0142}}\) \(\def \L {\unicode {x0141}}\) \(\def \ss {\unicode {x00DF}}\) \(\def \SS {\unicode {x1E9E}}\) \(\def \dag {\unicode {x2020}}\) \(\def \ddag {\unicode {x2021}}\) \(\def \P {\unicode {x00B6}}\) \(\def \copyright {\unicode {x00A9}}\) \(\def \pounds {\unicode {x00A3}}\) \(\let \LWRref \ref \) \(\renewcommand {\ref }{\ifstar \LWRref \LWRref }\) \( \newcommand {\multicolumn }[3]{#3}\) \(\require {textcomp}\) \(\require {upgreek}\) \(\newcommand {\intertext }[1]{\text {#1}\notag \\}\) \(\let \Hat \hat \) \(\let \Check \check \) \(\let \Tilde \tilde \) \(\let \Acute \acute \) \(\let \Grave \grave \) \(\let \Dot \dot \) \(\let \Ddot \ddot \) \(\let \Breve \breve \) \(\let \Bar \bar \) \(\let \Vec \vec \) \(\require {cancel}\) \(\newcommand {\LWRsubmultirow }[2][]{#2}\) \(\newcommand {\LWRmultirow }[2][]{\LWRsubmultirow }\) \(\newcommand {\multirow }[2][]{\LWRmultirow }\) \(\newcommand {\mrowcell }{}\) \(\newcommand {\mcolrowcell }{}\) \(\newcommand {\STneed }[1]{}\) \(\def \ud {\mathrm {d}}\) \(\def \ui {\mathrm {i}}\) \(\def \uj {\mathrm {j}}\) \(\def \uh {\mathrm {h}}\) \(\newcommand {\R }{\mathbb {R}}\) \(\newcommand {\N }{\mathbb {N}}\) \(\newcommand {\C }{\mathbb {C}}\) \(\newcommand {\Z }{\mathbb {Z}}\) \(\newcommand {\CP }{\mathbb {C}P}\) \(\newcommand {\RP }{\mathbb {R}P}\) \(\def \bk {\vec {k}}\) \(\def \bm {\vec {m}}\) \(\def \bn {\vec {n}}\) \(\def \be {\vec {e}}\) \(\def \bE {\vec {E}}\) \(\def \bx {\vec {x}}\) \(\def \uL {\mathrm {L}}\) \(\def \uU {\mathrm {U}}\) \(\def \uW {\mathrm {W}}\) \(\def \uE {\mathrm {E}}\) \(\def \uT {\mathrm {T}}\) \(\def \uV {\mathrm {V}}\) \(\def \uM {\mathrm {M}}\) \(\def \uH {\mathrm {H}}\) \(\DeclareMathOperator {\sech }{sech}\) \(\DeclareMathOperator {\csch }{csch}\) \(\DeclareMathOperator {\arcsec }{arcsec}\) \(\DeclareMathOperator {\arccot }{arcCot}\) \(\DeclareMathOperator {\arccsc }{arcCsc}\) \(\DeclareMathOperator {\arccosh }{arcCosh}\) \(\DeclareMathOperator {\arcsinh }{arcsinh}\) \(\DeclareMathOperator {\arctanh }{arctanh}\) \(\DeclareMathOperator {\arcsech }{arcsech}\) \(\DeclareMathOperator {\arccsch }{arcCsch}\) \(\DeclareMathOperator {\arccoth }{arcCoth}\) \(\def \re {\textup {Re}}\) \(\def \im {\textup {Im}}\) \(\newcommand {\up }{\uppi }\) \(\newcommand {\ut }{\uptheta }\) \(\newcommand {\uw }{\upomega }\) \(\newcommand {\uph }{\upphi }\) \(\newcommand {\uvph }{\upvarphi }\)

Chapter 8 Advanced Topics

The miracle of the appropriateness of the language of mathematics for the formulation of the laws of physics is a wonderful gift, which we neither understand nor deserve.

Eugene Wigner

This section is non examinable and is included so that you have a feel for how the material in this module can be taken further.

8.1 L’Hôpital’s rule for evaluating limits

We saw in chapter 2 that some limits lead to nonsense expressions. For example, If we were confronted with \(\lim _{x\to 0}\sin (x)/x\), this looks like it will result in \(0/0\) which is does not make sense. Remember that not all limits that look indeterminate really are. For example

\begin{equation*} \lim _{x\to 4}\frac {x^{2}-16}{x-4} \end{equation*}

looks at first glance like it will have the form \(0/0\) since both the numerator and denominator vanish for \(x=4\). However, the numerator can be factored as \(x^{2}-16=(x-4)(x+4)\) so the limit simplifies to

\begin{equation*} \lim _{x\to 4}\frac {x^{2}-16}{x-4}=\lim _{x\to 4}\frac {(x-4)(x+4)}{x-4}=\lim _{x\to 4}(x+4)=8. \end{equation*}

This is why we said that you should try to expand and simplify the function that you are taking the limit of as much as possible.

L’Hôpital1’s rule enable us to make sense of some of those limits which still look indeterminate after they have been simplified. To apply L’Hôpital’s rule, we have to be taking the limit of a ratio of functions \(f(x),g(x)\), where both are differentiable, the derivative of \(g(x)\) does not vanish, and in the limit \(f(x)\) and \(g(x)\) wither both go to zero or both go to infinity. Then we have that

\begin{equation} \lim _{x\to a}\frac {f(x)}{g(x)}=\lim _{x\to a}\frac {f'(x)}{g'(x)}, \label {eq: l'hopital's rule} \end{equation}

so we can replace the ratio of the functions with the ratio of their derivatives. If both of the derivatives still vanish, or diverge, in the limit, then process can be repeated and we end up with more derivatives

\begin{equation*} \lim _{x\to a}\frac {f(x)}{g(x)}=\lim _{x\to a}\frac {f^{(n)}(x)}{g^{(n)}(x)}, \end{equation*}

where the superscript \((n)\) means that we are differentiating the functions \(n\) times.

Note that if the limit does not lead to an indeterminate then L’Hôpital’s rule does not hold!

1 Originally spelt L’Hospital, with a silent s and no circumflex

  • Example 8.1. As a counter example consider the limit

    \begin{equation*} \lim _{x\to 1}\frac {f(x)}{g(x)}=\lim _{x\to 1}\frac {x+1}{2x+1}. \end{equation*}

    Both \(\lim _{x\to 1}f(x)=2\) and \(\lim _{x\to 1}g(x)=3\) are finite and no-zero. Evaluating the limit directly gives

    \begin{equation*} \lim _{x\to 1}\frac {x+1}{2x+1}=\frac {2}{3}. \end{equation*}

    We can also calculate the limit of the ratio of derivatives,

    \begin{equation*} \lim _{x\to 1}\frac {f'(x)}{g'(x)}\lim _{x\to 1}\frac {1}{2}=\frac {1}{2}\neq \frac {2}{3}. \end{equation*}

    So the limit of the ratio does not match the limit of the ratio of derivatives.

As long as our original limit looks like it is indeterminate we can use L’Hôpital’s rule.

  • Example 8.2. The limit of \(\sin (x)/x\) as \(x\to 0\) is evaluated as follows

    \begin{equation*} \lim _{x\to 0}\frac {\sin (x)}{x}=\lim _{x\to 0}\frac {\cos (x)}{1}=1. \end{equation*}

We can also evaluate other limits that may not at first look like a ratio of functions.

  • Example 8.3. Consider the limit \(\lim _{x\to -\infty }xe^{x}\) this looks like it becomes the indeterminate \((-\infty )(0)\). If we recall that \(1/e^{x}=e^{-x}\) then we can rewrite the limit as

    \begin{equation*} \lim _{x\to -\infty }xe^{x}=\lim _{x\to -\infty }\frac {x}{e^{-x}}, \end{equation*}

    which looks like the indeterminate \(-\infty /\infty \). Now we can apply L’Hôpital’s rule to get

    \begin{equation*} \lim _{x\to -\infty }\frac {x}{e^{-x}}=\lim _{x\to -\infty }\frac {1}{-e^{-x}}=0, \end{equation*}

    since \(1/\infty \) is zero.

8.2 Trigonometric Derivatives in Degrees

At various points in this module I have said that you should always work with angles in radians as this makes life easier when differentiating trig functions. Here I want to discuss how to take the derivative if we are measuring the angle in degrees.

First we need some notation, we will use the subscript \(\text {rad}\) when our function has an argument in degrees and \(\text {deg}\) when our function has an argument in degrees. Then we can assume the result that we were given in chapter 3, but rewritten in this new notation, that

\begin{equation*} \frac {\ud }{\ud x}\sin _{\text {rad}}(x)=\cos _{\text {rad}}(x). \end{equation*}

Now recall that if \(x\) is an angle in radians then the corresponding angle, \(\theta \) in degrees is

\begin{equation*} \theta =\frac {180^{\circ }}{\uppi }x, \qquad \text {or } x=\frac {\uppi }{180^{\circ }}\theta . \end{equation*}

Now we can calculate the derivative of \(\sin _{\text {deg}}\) using the chain rule

\begin{align*} \frac {\ud }{\ud \theta }\sin _{\text {deg}}(\theta )&=\frac {\ud }{\ud \theta }\sin _{\text {rad}}\left (\frac {\uppi }{180^{\circ }}\theta \right )\\ &=\frac {\ud x}{\ud \theta }\frac {\ud }{\ud x}\sin _{\text {rad}}(x)\\ &=\frac {\uppi }{180^{\circ }}\cos _{\text {rad}}(x)\\ &=\frac {\uppi }{180^{\circ }}\cos _{\text {rad}}\left (\frac {\uppi }{180^{\circ }}\theta \right )\\ &=\frac {\uppi }{180^{\circ }}\cos _{\text {deg}}\left (\theta \right ). \end{align*}

The derivatives of other trig functions can be calculated in similar ways. This is why we have to be careful to use radians as we do not want to have to keep track of factors of \(\uppi /180^{\circ }\) every time we differentiate.

There is an interesting discussion of this result and how to think about the difference between trig functions that take arguments in radians and degrees here

8.3 Functions of two variables

8.4 Multiple integrals

8.5 Optimisation Problems

In section 3.4 we discussed finding the critical points of a function by studying where the derivative vanishes. The example that I like to have in mind comes from physics. Consider a ball thrown straight up in the air, how do we find the maximum height that the ball reaches? We look at where the velocity vanishes, since as the ball is moving upwards towards it is being decelerated by gravity so the velocity decreases, then when it is going down after reaching its maximum height the velocity is getting larger but pointing in the opposite direction. For this to happen there has to be a point where the velocity is instantaneously zero. This is at the maximum height. Calculus comes into this as the velocity of an object is the derivative of its displacement, so looking for where the velocity vanishes is exactly the same as finding the critical points where the derivative of the displacement vanishes.

We also discussed that critical points correspond to the minima and maxima ( and points of inflection) of a function. This means that if our function describes the area enclosed by a fence, or the time taken to run an algorithm that finding the critical points will tell us the maximum or minimum area that we can enclose, or the fastest and slowest that the algorithm can run. This is what is meant by Optimisation, we are optimising a function by finding the parameter values which make its output the largest or the smallest it can be.

  • Mathematical Diversion 8.1. Note that the function can be constrained, e.g. if it is restricted a particular set of values that is not the full range of the function, then it may not achieve its global maximum or minimum. In that case you have to evaluate the function at the boundary of the region and see if the values it takes are larger or smaller than that taken at any critical points which satisfy the constraint.

    See section 4.8 of [Dawkins, 2025b] for more on constrained optimisation at the level relevant to this module.

In other words, optimisation problems are all about finding the maxima, minima, and points of inflection for functions, and interpreting the physical meaning of these points. A famous historical example is the Dido problem2 which asks you to find the maximum area that can be enclosed by a shape with a given fixed perimeter. The solution to the Dido problem is the circle.

Another similar problem is asking what curve minimises the distance between two points. In flat space we all know the answer is a straight line, but have you ever though about how this changes if the surfaces is curved? It turns out that the solution to the problem changes. This is why aeroplanes fly along sections of a circle, as these give the shortest distance on a globe.

2 named after a queen of Carthage

8.6 Polynomial approximation

In chapter 6 we met Newton’s divided difference method which enabled us to find a polynomial approximation to a function, making use of a table of values with a uniform step size3. The interpolating polynomial is expressed in terms of the data points, step size, and finite differences as

\begin{equation} f(x)=f_{0}+\frac {x-x_{0}}{h}\Delta f_{0}+\frac {(x-x_{0})(x-x_{1})}{2!h^{2}}\Delta ^{2}f_{0}+\dots +\frac {(x-x_{0})(x-x_{1})\cdots (x-x_{n})}{n!h^{n}}\Delta ^{n}f_{0}. \label {eq: divided difference 2} \end{equation}

The number of terms \(n+1\) is determined by the number of data points we start of with as if we only have one point, then we just get \(f_{0}\), two data points gives one first difference \(\Delta f_{0}=f_{1}-f_{0}\), three data points gives one second difference, \(\Delta ^{2}f_{0}=\Delta f_{1}-\Delta f_{0}\). Thus \(n+1\) points gives a series with \(n+1\) terms as shown in eq. (8.2).

The discussion of numerical differentiation in chapter 6 showed us that these finite differences are discrete are discrete versions of the derivative. For example

\begin{equation*} \frac {\ud f}{\ud x}(a)\simeq \frac {f(a+h)-f(a)}{h}=\frac {\Delta f_{a}}{h} \end{equation*}

in the forward difference scheme. It turns out that we can do the same for higher derivatives and see that

\begin{equation*} \frac {\ud ^{2}f}{\ud x^{2}}(a)\simeq \frac {\Delta ^{2}f_{a}}{h^{2}}, \end{equation*}

or in general

\begin{equation*} \frac {\Delta ^{n}f_{a}}{h^{n}}=\frac {\ud ^{n}f}{\ud x^{n}}(a) \end{equation*}

3 We saw that if the step size is not uniform we can still get a similar approximation.