# 15. Approximating differential equations

## 15.1. Motivation and plan

The laws of nature are expressed as differential equations.

This is because in describing nature we discuss how something changes,
either from location to another, or as time goes by. These changes
are expressed as *derivatives* of a function, and the laws of nature
relate those derivativse to other functions.

## 15.2. A review of derivatives

First refer the class to a quick look at the animation of derivatives in the mini courses book, the chapter “pushing toward calculus”.

Then we will simply do a few examples of this calculation. Our purpose is not to do an in-depth review, but just to feel some agility, to remember a few simple formulae, and to show some of the simplest examples to people who have not yet taken a calculus class.

if we remember the Pascal triangle we note that \((x+h)^3 = x^3 + 3x^2 h + 3 x h^2 + h^3\). If we also remember that \(h^2\) and \(h^3\) get small very quickly and disappear in the limit, we get:

and looking at higher order binomial expansions we see that:

People sometimes keep a mnemonic for their math formulae. I tend to think that the n “comes down in front, and gets reduced in the exponent”.

Note that some basic properties hold:

Putting those together we get that:

This last property leads to the jargon that “the derivative is a
*linear operator.*”

Now for some slightly more complex ones:

## 15.3. What is a differential equation?

A differential equation is one where you have functions of your
variable and their derivatives, and you are trying to find the
*function*, not the variable.

For example:

We solve this by *educated guessing:* the derivative of
\(\frac{7}{2} x^2 \;\; \textrm{is} \;\; 7x\), and the derivative
of \(2x\) is 2. This leads us to conclude that:

where C is the famous *arbitrary constant*.

## 15.4. A simple example: exponential growth

An example from ecology: start with two rabbits, and these rabbits have no constraints: they can reproduce, and never run out of food, and there no predators, and lots of other simplifying assumptions. Then the population is governed by this equation:

Let us pick this apart.

- How did you arrive to it?
There are various ways in which scientists have written down equations that govern phenomena. In this case you can reason it through by saying that:

*“The more rabbits you have, the higher the growth rate”*. This is the same as saying that the growth rate \((dP(t)/dt)\) is proportional to how many rabbits you already have \((P(t))\).- Is there some jargon to go with this?
Of course! I usually refer to the differential equation for a function of time (in our case \(P(t)\)) as the injection of a

*dynamic principle*into the system. Other equations might give you information about setting up an initial system, but the differential equation with respect to time introduces*dynamics*into the picture.- What about \(r\)?
\(r\) can be thought of as the

*rate*at which the population grows. A bigger \(r\) makes for a much faster population growth.

OK, so dynamical principle, initial, … Any other jargon? Ah yes:
this was a *first order linear differential equation.*

- First order differential equation
The highest order of the derivative in the equation. In this case we had the first derivative of \(P(t)\) so it was a

*first order*differential equation.- Linear differential equation
The function \(P(t)\) and its derivatives always appeared

*linearly*, i.e. they were all to the first power and multiplied by constants. (Think of the equation of a straight*line*\(y = m x + b\). This is*linear*in \(x\) because \(x\) does not appear to higher powers, and its only operation is to be multiplied by a constant.

Can we solve this equation *analytically*? (And here you pause and
ask the “class what does analytically mean?”)

For this simple example yes, we can solve it analytically: we have
encountered exactly *one* math function whose derivative is
proportional to itself:

and therefore:

So the solution to our equation is:

Here you have an “arbitrary constant”, as they are sometimes called. Note that the original differential equation is such that multiplying by that constant does not change the result, so the constant is a key part of the general solution.

So what is that constant physically?

We can read directly from the equation that a time \(t = 0\) we will have \(e^{r \times 0} = 1\), so the constant is just \(P(0)\).

Using the shorthand \(P_0 = P(0)\), we end up with:

So in this case our “arbitrary constant” was not all that arbitrary:
it represented an *initial condition* of the system (another piece of
jargon in differential equations).

This often happens: a differential equation representing a dynamic
situation will have an *initial condition*, and that initial condition
can be found in those mathematical arbitrary constants. They are
arbitrary to the mathematician, but to the practicing scientist they
reflect the state of a natural system at the starting moment.

And you might have noticed that our *first* order differential
equation for exponential growth had *one* arbitrary constant. Second
order equations will have *two* arbitrary constants, and so forth.

## 15.5. Solving differential equations *numerically:* Euler’s method

At this time we will click here and follow that chapter to learn about solving differential equations numerically.