The differential equation I will use as an example comes about in the following way:
We have a small hot body in large cooler environment. The small hot body loses heat to the environment and so drops in temperature. The environment is large enough that the small amount of heat gained from the small hot body does not significantly raise the temperature of the environment. However, as time progresses the environment is warming as result of the impact of the rising sun.
To get a mathematical form for a differential equation we need to know something about the rate of change of the small hot body. We get this information from Newton’s law of cooling, which states that the rate of change of temperature of a hot body with respect to time is proportional to the difference between the temperature of the body and the temperature of the environment. If the temperature of the environment were constant we could write Newton’s law of cooling as:
where is the temperature of the hot body at time
,
is the constant temperature of the environment, and
is a positive constant.
However, we are assuming that the environment is warming up as time progresses, so let’s assume this warming is progressing at a constant rate, at least for a reasonable time period. In other words, we’re assuming that is changing as a linear function of
.
So now our differential equation for the temperature of the hot body, as a function of time, is
…………………………(*)
The problem is this: given the differential equation (*), how does the temperature of the hot body change with time?
As it stands we cannot answer this question by giving a specific numerical function because we do not know the initial temperature of the hot body, or the constants
. The problem of determining the behavior of the temperature of the hot body from the differential equation has, therefore, 4 free parameters. Let’s narrow this down to a problem with only 1 free parameter – the initial temperature of the hot body, by specifying the other parameters.
Let’s suppose that at time (which could be any clock time – e.g. 6 a.m.) the temperature of the environment is
and that the temperature rises steadily so that 360 minutes (= 6 hours) later the temperature of the environment is
. The rate of change of temperature (measured in degrees per minute) is
so in the differential equation (*),
.
We do not know the value for k, and can only reasonably obtain this from experiment. however, a reaonably typical value for a hot body such as a hot cup of coffee is which gives
.
With these parameter values the differential equation (*) becomes;
…………………………(**)
At first glance it looks like there are no free parameters in (**), but there is one, lying hidden. It is the initial temperature of the hot body. The differential equation (**) can – and should – be thought of as a prescription for movement in a dynamical system – the transfer of heat from the hot body to the environment. As such, (**) is a prescription for how the heat flow goes with time: in particular, how the temperature changes with time. What (**) does not tell us is what the temperature of the hot body was at time
. Without that knowledge we can only know the way in which the temperature changes -which is what (**) tells us – but not the actual value of the temperature at any given time.
So we know have a differential equation (**) with one free parameter – the value . This differential equation is a first-order equation because it involves only the first derivative of the variable
.
The basic problem of differential equations, illustrated by the differential equation (**), is: how do we get some understanding of the behavior of the solutions of the differential equation from the differential equation itself? To put it more picturesquely, if less precisely: the differential equation is a local prescription for change. It tells us how the dependent variable changes at a particular value of the independent variable. What we seek is a global, overall, idea of the behavior of the solution curves.
We now turn to some very simple techniques for obtaining that global picture of the solution curves to (**).
Direction fields
(Also known as slope fields)
Tenenbaum & Pollard pp. 38-41.
Hunt, Lipsman, Osborn & Rosenberg pp. 65-71
At any given time, t, the differential equation tells us how the temperature is undergoing a change at that time. The differential equation tells us how the dynamics of heat exchange is changing, and points us from the current temperature to temperatures at close future times. You all know by now that in physics, mathematics and engineering we indicate pointing by vectors. The idea of a direction field is to place, at each time t, a small vector indicating the magnitude and direction in the change of temperature, as governed by the differential equation. The great beauty of a direction field is that if we draw the direction vectors sufficiently well then we can literally see how a solution curve behaves with time. We get an overall picture of the solution of a differential equation. This is what we mean by a global solution. The differential equation tells us how things change at any given time. The direction field, drawn well, gives us a picture of the overall change over a range of time. This is a process of integration, and it is your eye that does the integration.
If we assume the hot body starts off at a higher temperature than the environment at time then (**) tells us that the rate of change of the temperature of the hot body is negative.
The direction field above was constructed using MatLab. You can use MatLab on the computers in the Mathematics Department Computer Lab, room 218, Liberal arts Building. For working at home, if you don’t have MatLab you can use the open-source software Octave, which is designed to be similar to MatLab (and, being open source software it is freely available).
Euler’s method
Euler’s method consists in taking an approximation to the derivative, with small steps in the independent variable. In the example for this block the independent variable is time, t. So we take a small time step and we approximate the derivative
at time t by
. This means
so that
.
We know the form of from the differential equation (**) so we use the above approximation to estimate
from knowledge of
. To start this process we need an initial value for
.
This simple approximation to a numerical solution to the differential equation (**) can be easily implemented in a spreadsheet, and the updating feature of a spreadsheet can easily allow us to see the effect of changing the initial condition :
However, spreadsheets do not have good numerical accuracy, so we will use MatLab instead. This also gives you practice getting used to the MatLab environment.
Euler’s method in MatLab is described on pp. 91-95 of Hunt, Lipsman, Osborn & Rosenberg.
The basic problem with Euler’s method is that it has low accuracy over extended time periods. Basically we need to take very small to get good accuracy, but that gives us a trade-off in the overall time for which we get a numerical approximation to the solution.
Analytical techniques
(1) Substitution
We define a new function by
and try to choose the constant
so that
– the reason being that this would give us a simpler differential equation for
than we had previously for
.
With the substitution we have
so if we choose
then we have
.
The differential equation of is simpler than that for
, and involves only one parameter,
.
You might recall that so you might suspect that
or perhaps,
allowing for the fact that we have another parameter to account for: the temperature
of the hot body at time 0. This guess is, in fact, correct, and we will see why by using separation of variables and integration.
Substitution is dealt with in Tennenbaum & Pollard pp. 101-103.
(2) Separation of variables
Here’s the intuitive idea:
it is very tempting to write the differential equation as
, whatever that might mean
Following the formalism where it leads has a long and venerable history in mathematics: that is, for example, how complex numbers were discovered. However, blind formalism, where we accept formal manipulation as correct no matter what, can lead to absurd thinking. Here’s an example: let’s just imagine we can blindly make sense of the infinite sum in which each term in the sum is twice the one before. Let’s call this sum
so
. Now let’s formally suppose we can multiply all the terms in
by 2:
. Now operate formally and subtract
to get
, which is obviously not true!
So blind formal manipulation is not always a good idea. But inspired formal manipulation, as we have done with the differential equation, might be productive.
Her’s a little more formal manipulation of the differential equation that is very suggestive:
.
Thinking of an integral as an anti-derivative (why not?) this seems to give us where
is constant, so
as we had previously guessed.
This technique is called separation of variables because we manipulate the differential equation into a form where all the occurrences of the variable are on one side of the equation, and all the occurrences of the variable
are on the other side of the equation.
Separation of variables is described in Tenebaum & Pollard pp. 47-55.
Computer-aided solutions
Almost any technique you know of, or anyone knows of, is encoded in standard computer packages that allow exact solutions of differential equations. such packages include Maple, Mathematica, and MatLab, as well as their open source equivalents.
Here’s how we go about finding solutions to the differential equation (**) using MatLab:
(Hunt, Lipsman, Osborn & Rosenberg pp. 65-71)
>> dsolve(‘DT=-0.05*(T-(t/12+45))’,'t’)
The result is:
ans =130/3+1/12*t+exp(-1/20*t)*C1
The – unknown – constant comes about because we did not yet specify
. Once we do that we get a solution with no free parameters:
>> dsolve(‘DT=-0.05*(T-(t/12+45))’, ‘T(0)=200′, ‘t’)
ans =
130/3+1/12*t+470/3*exp(-1/20*t)
So the computer does the hard work of finding an exact anyltic solution for us, when there is such an anlytic solution.
Of course, what we weould like ot know is how the oslution behaves as time increases. One way to do this is to look at a graph of versus
.
In MatLab we can do this by naming the solution:
>> SOL = dsolve(‘DT=-0.05*(T-(t/12+45))’, ‘T(0)=200′, ‘t’)
and then plotting it:
>> ezplot(SOL,[0,360])
Temperature T versus time t, Finally: does this make sense? Should the temperature-time curve dip like this then rise? Does this solution make sense in terms of the model we had?

