Engineering Part 1A 2007-08, Paper 4, Mathematical Methods, Fast Course,
M.P.Juniper / A.L.Travis
DIFFERENTIAL EQUATIONS
Differential Equations .................................................................................................2
1 Types of differential equation ..............................................................................2
1.1 A linear differential equation has no products of y¸dy/dx, d2y/dx2… .........2
1.2 Real life differential equations are often linear with constant coefficients
................................................................................................................................3
1.3 Notation...........................................................................................................3
2 The solution of differential equations .................................................................3
2.1 Solve linear differential equations using the CF+PI method.....................4
2.2 For linear differential equations & constant coefficients, y=ex solves the
CF ..........................................................................................................................6
2.3 If the CF is complex, replace it with a linear sum of sin and cos...............7
2.5 Use the maths data book to find a Particular Integral ...............................9
2.6 If the Right-Hand Side is the same as the CF, try RHS x.....................10
2.7 Example ........................................................................................................11
3 Partial differential equations .............................................................................12
3.1 Calculate a partial derivative by fixing all but one variable....................12
3.2 Example ........................................................................................................13
3.3 Example ........................................................................................................13
3.4 Sum partial derivatives to get the change in height to any point ............14
4 Difference equations ...........................................................................................16
4.1 Solve a linear difference equation by trying y n = n .................................16
4.2 Example ........................................................................................................18
Differential Equations
One of the reasons that the inception of calculus was important is that so many laws
of nature relate one parameter to the differential of another, for example
F = m(d2x/dt2). The equations which codify such laws are called “differential
equations”. A wide variety of differential equations are conceivable, but those found
in real life fortunately fall into a category which is surprisingly easy to solve. I will
explain how to identify this category, then how to solve the equations.
1 Types of differential equation
We arrange differential equations in order of complexity as follows:
A first - order differential equation for a function yx is any equation
involving
x, y,
dy
dx
but no higher derivatives.
A second - order differential equation for a function yx is any equation
involving
x, y ,
dy d 2 y
,
dx dx 2
but no higher derivatives, etc.
There is an important general theorem which says that an nth-order differential
equation has a general solution which involves n
arbitrary constants. It follows that
to define a particular solution by fixing values of these constants, we need n boundary
conditions , for example values of y,
dy
at particular values such as x 0 or x a .
dx
[If the problem has time as the variable and a function yt , then values y0 ,
dy
0 etc. are called initial conditions.]
dt
1.1 A linear differential equation has no products of y¸dy/dx, d2y/dx2…
The differential equations describing most systems in the real world are linear:
A first-order differential equation is linear if it can be written in the form
dy
px y q x
dx
A second-order differential equation is linear if it can be written in the form
dy
d2y
2 p1 x dx p2 x y q x
dx
and similarly for third order, fourth order and so on. Notice that it is only products of
y and its derivatives which are absent in a linear differential equation: functions and
higher powers of x can be present.
if qx 0 .
These equations are said to be
The most important property of any linear, homogeneous equation is that
homogeneous
solutions obey the principle of superposition: if y1 x and y2 x are two
y1 y2
solutions of a particular equation, then
is also a solution
for any constants and .
1.2 Real life differential equations are often linear with constant coefficients
Many, if not most, differential equations describing systems in the real world are not
only linear but have constant coefficients, e.g.
a2
d2y
dy
a1
a0 y q x
2
dx
dx
We can almost always solve an equation of this form, but first a bit of notation.
1.3 Notation
(i)
dy
d2y
We often write y' x for
, y"x for
etc.
dx
dx 2
(ii)
If the variable is time, then we write y (t ) =
(iii)
Sometimes we use the operator D to mean "
so
dy
, D2y means
for y(x) Dy means
dx
dy
for y(t) Dy means
, D2y means
dt
dy
, y(t )
dt
=
d2y
dt 2
d
"
d whatever
d2y
dx 2
d2y
dt 2
How are these various classes of differential equation solved?
2 The solution of differential equations
With one exception, non-linear differential equations can be solved only if you are
lucky and find the right trick. The exception is the kind of first order differential
equation which can be written in the form:
f y
dy
g x
dx
which we solve by multiplying both sides by dx so that we can write:
f ydy gx dx a constant.
2.1 Solve linear differential equations using the CF+PI method
If the differential equation is linear, then it will be amenable to the CF + PI method,
However if it is both linear and of first order, then one can also use the integrating
factor and this is more likely to produce a solution if the coefficients are functions of x.
We will consider the integrating factor method first, then the more general CF + PI
method.
2.1a For a first order linear differential equation, use the integrating factor
There is a standard trick to attack a linear first-order differential equation. Write it
dy
px y q x
dx
then multiply through by the "integrating factor": f x e
p x dx
.
The equation will become:
d
f x y f x qx
dx
so that it can be integrated directly.
Example
Solve
dy 3
y x2
dx x
First we find the integrating factor for 3/x which is:
3
e
x dx
(note that we do not need a
3
= e3lnx = e ln x = x3
constant of integration here).
Then we multiply both sides of our differential equation by this integrating factor:
By inspection:
x3
dy
3x 2 y
dx
= x5
x3
dy
3x 2 y
dx
=
d 3
x y
dx
x3y =
x6
A
6
y =
x6 A
6 x3
where
A
is
arbitrary constant
an
2.1b For any other linear differential equation, use the CF+PI method
For a differential equation of any order, we can try the method of finding a particular
integral and a complementary function. By way of example, consider the secondorder equation
y" p1x y' p2 x y qx
We solve this in two stages
(a)
The “particular integral” (PI).
Using tips in the data book, we can usually find one particular solution G(x) to a
linear differential equation. But there will be many other possible solutions because,
as was noted at the beginning of section 4.1, a general solution of an n’th order
differential equation will involve n arbitrary constants. How do we find all the
possible solutions?
(b)
The “complementary function” (CF).
We also solve:
g " p1 x g ' p 2 x g = 0
because the replacement of q(x) by 0 produces an equation (called a homogeneous
equation ) for which we usually can find a general solution g(x) which involves two
arbitrary constants.
(c)
Now consider
y g x G x .
Putting this into our second order equation we get:
y" p1y' p2 y g" p1g' p2 g G" p1G' p2 G 0 q q
So this yx is the solution we seek: it contains the required number of arbitrary
constants [within g(x)] and it satisfies the full equation.
This argument does not rely on any property except linearity: it works for differential
equations of any order and does not require p1 and p2 to be constant. Nevertheless,
solutions are much easier to find if p 1 and p 2 are indeed constant.
2.2 For linear differential equations & constant coefficients, y=ex solves the CF
The CF+PI method is especially simple for the important case when we have constant
coefficients in place of the functions p1x , p2 x (but not qx ). We illustrate by an
example:
y" 3y' 2 y x 2
(a)
(1)
The Complementary Function
g "3g '2 g = 0
We wish to solve first
(2)
x
We know that a first-order differential equation g' g 0 has a solution g e .
Try a similar form here: try g = ex. When we put this into (2) we get:
(2 + 3 + 2)ex = 0
2 or
So there are two possible solutions, y =
e-2x and y =
1 .
e-x . Furthermore, since the
differential equation is linear, any linear combination g = Ae-2x + Be-x
of these
two basic solutions will also be a solution. Since this expression has two arbitrary
constants it is the required general solution.
(b)
The Particular Integral
Now we need to find some function which satisfies (1). Proceed by “inspired
guesswork”: for this particular problem we might first guess y = x2
for some
value of . Put this into (1) and we get:
y"3y' 2y 2 6 x 2 x 2 .
2
We could match the x term by choosing
1
, but we would be left with unwanted
2
terms 3x 1. To cure this, we need to include more terms in our guess: try
y x 2 x
Then
y"3 y '2 y 2 3 2x 2 x 2 x
2 1
So we need
6 + 2 = 0
2 3 2 0
x 2 terms
x terms
constant terms
Thus
So our PI is y
1
19 7
3
,
, 1 .
2
2
22 4
x 2 3x 7
2
2 4
So finally, the general solution of y" 3y' 2 y x 2 is the solution of the
complementary function plus the particular integral:
i.e.
yx Ae
2x
Be
x
x 2 3x 7
2
2 4
2.3 If the CF is complex, replace it with a linear sum of sin and cos
In the example given above, both solutions g = ex to equation (2) had real values of .
If the values of are complex, with 1 = a + ib and 2 = a – ib, then the general
solution of equation (2) will be:
y = Ce(a+ib)x + De(a-ib)x
= eax {(C + D)cosbx + i(C – D)sinbx}
C and D are arbitrary so in principle there is no reason why they should not be
complex. But there is a good reason why we might want y to be real, otherwise our
solution may have no useful physical interpretation, so we usually confine ourselves
to real solutions of y by replacing (C + D) and i(C – D) by the real constants A and B
such that:
y = eax {Acosbx + Bsinbx}
Example
The height, y, of a mobile is such that y 4 y 0 . Find y as a function of t.
Let us see if y = et is a solution..
If y = et is a solution then
y 4 y = 2et + 4et
which equals zero if
= 2i or -2i
So two possible solutions are
y = e2it and y = e-2it
These are independent (i.e. one is not a linear multiple of the other), and a second
order differential equation has only two independent solutions, so there are no others.
The general solution is a linear sum of the independent solutions, so is
y = Ae2it + Be-2it
It makes no sense for y to be complex, and (e2it+e-2it)/2=cost, while (e2it–e-2it)/2i=sint
so A and B must be such that y can be written as:
y = Ccos2t + Dsin2t
Where C and D are both real, with values which depend on when and at what height
you start.
2.4 If ex gives only one value of , try also xex
A problem arises if putting ex into our homogeneous equation delivers the same
value of twice. For example solve:
y’’ – 6y’ + 9y = 0
Try y = ex as usual:
hence
2 - 6 + 9 = 0
( - 3)2 = 0
So y = e3x is a solution but the general solution of a second order differential equation
must comprise two independent solutions and we have only found one. When this
happens, try y =
xex which will yield a second, independent solution.
How did I know to try y = xex ? By putting into the equation
y = u(x)e3x
and finding out what u(x) must be for y(x) to be a solution.
y’ = u’e3x + 3ue3x
y’’ = u’’e3x + 6u’e3x + 9ue3x
so
y’’ – 6y’ + 9y = {u’’ + 6u’ + 9u – 6u’ – 18u + 9u}e3x
= u’’e3x
So our equation boils down to u’’ = 0. The general solution of this, of course, is
u = A + Bx
y = (A + Bx)e3x
so
We now have the required two arbitrary constants: as well as the old solution Ae3x we
have a second one, Bxe3x. This method is called the “variation of parameters”.
2.5 Use the maths data book to find a Particular Integral
Look in the maths data book page 6 for functions which have a good chance of giving
a Particular Integral to your differential equation e.g.
if the right-hand side function is:
x’’
th
or an n order polynomial
try:
axn + bxn-1 +…..+ c
i.e. an nth order polynomial
ekx
aekx
xekx
(ax + b)ekx
sinpx
cospx
sinhpx
coshpx
asinpx + bcospx
asinhpx + bcoshpx
2.6 If the Right-Hand Side is the same as the CF, try RHS x
A problem arises if the right-hand side of our differential equation is of the same form
as the complementary function. For example, the complementary function for:
d 2 y dy
12 y e 3 x
2
dx
dx
is y = Ae-4x + Be3x. What should we try for the particular integral? There is clearly no
point in trying y = e3x because we already know that putting it into the left hand side
of our differential equation gives zero.
try a solution proportional to the right-hand side of your differential equation
multiplied by x
This means that I should try y = Cxe3x. How did I get this rule? By putting into the
left-hand side of the differential equation:
y = u(x)e3x
and finding out what u(x) must be for y(x) to be a PI.
First find y’
then y’’
so
which becomes
y’ = u’e3x + 3ue3x
y’’ = u’’e3x + 6u’e3x + 9ue3x
[u’’ + 6u’ + 9u + u’ + 3u - 12u]e3x = e3x
u’’ + 7u’ = 1
We don’t need a general solution for this – any one will do – so try:
u = Ax
which gives
so
0 + 7A = 1
y = 1 xe 3 x
7
is a PI
This is the “variation of parameters” approach again, which is what you should resort
to if you do not get a PI when you try letting y equal the right-hand side multiplied by
x.
2.7 Example
A speaker has mass and stiffness such that y 4 y V . If y(0) = 0, y (0) = 0 and
V = sin2t, will it oscillate more than 2 units?
If y = et then 2 + 4 = 0
CF:
so = 2i
y = Ae2it + Be-2it
so the CF is:
But y has to be real, so we know that Ae2it + Be-2it must sum to give:
y = Ccos2t + Dsin2t
PI:
y = cos2t + sin2t
so try
y = tcos2t + tsin2t
Then
y
= cos2t - 2tsin2t + sin2t + 2tcos2t
y
= -( + 2t)2sin2t + 2cos2t + ( - 2t)2cos2t-2sin2t
so we
want:
-4sin2t + 4cos2t = sin2t
Hence = 0 and = -1/4.
GS:
So the general solution is
y = Ccos2t + Dsin2t – (t/4)cos2t
Boundary conditions:
y 0 0 so
C = 0
y 0 0 so
2D = 1/4
so
y = (1/8)sin2t – (1/4)tcos2t
does not work
3 Partial differential equations
Put up a marquee and its height, h, is a function not only of distance, x, from one tentpole to the other, but also of distance at right-angles, y, towards the tent pegs. This is a
function of two variables and its slope will be determined by its derivative, but the
slope parallel to the x-axis will differ from that parallel to the y-axis. How do we
calculate either?
h(x,y)
D
P
B
y
C
A
x
3.1 Calculate a partial derivative by fixing all but one variable
Think first of a chain suspended between two poles: the slope of the chain is given by
the derivative of h(x) with respect to distance x from one pole to the other:
h(x)
dh
dx
lim
x 0
h( x x) h( x)
x
x
If height is a function of two variables h(x, y), then we can turn it temporarily into
the equivalent of a function of one variable, x say, simply by keeping y fixed:
h
x
lim
x 0
h( x x, y ) h( x, y )
x
which is the rate of change with respect to x, keeping y constant. At point P = (x, y),
h/dx is the slope parallel to the y axis which you get when you slice through the
marquee in the plane DCP. It is called a “partial derivative” and is denoted by the
use of instead of d in the differential. Note that all the differential equations found in
the last section involved functions of only one variable and are called “ordinary
differential equations” to distinguish them from those involving partial derivatives.
By way of example, if:
h(x,y) = 1 + x + xy2 + y3.
then the partial derivate of h with respect to x is found by differentiating with respect
to x in the normal manner while treating y as if it were a constant number:
h
= 1+ y2
x
We can find the slope at point P along the x axis in a similar way:
h
y
lim
y 0
h( x, y y ) h( x, y )
y
which is the rate of change with respect to y, keeping x constant, equivalent to a slice
through the marquee in the plane ABP. Extending our example,
h
= 2xy2 + 3y2
y
3.2 Example
A skateboard rink has height h(x, y) = x2 + cosy. Is there any slope in the middle?
h
= 2x
which equals 0 at x = y = 0
x
h
= -siny
which equals 0 at x = y = 0
y
so there is no slope.
3.3 Example
The height of a wave is h(x, t) = -sin(ax+bt). What slope does a surfer experience and
what is the rate of change of height for a swimmer at x = 0 and t = 0,?
h
x
h
t
= -acos(ax+bt)
which equals
–a
at x = t = 0
= -bcos(ax+bt)
which equals
–b
ms-1 at x = t = 0
The concept of the partial derivative has been introduced with spatial parameters, but
it is applicable whatever the function and its variables.
3.4 Sum partial derivatives to get the change in height to any point
This is all very well, but our two partial derivatives only give us the slope of the
marquee in two directions, whereas there are a whole range of directions in which one
might want to determine the slope. So consider a small patch of the surface, in the
immediate vicinity of P. If the coordinates of P are (x,y), we examine the behaviour
of the function h(x,y) as we move a small distance to the point R with coordinates
( x x, y y ) :
R
P
Q
y+y
x
x+x
y
h
;
x
h
.
from Q to R, the increase in h y
y
From P to Q, the increase in h x
So the total change in h in making a general small move ( x, y) is
h
h
h
x y .
x
y
We would have got the same answer if we had gone round the other two sides of the
rectangle to reach R from P.
x
Now suppose we invent two vectors and
y
h
x , and take their scalar product:
h
y
h
h
x x h
x y
=
h
y
y x
y
which is equal to the change in height, h. The scalar product between two vectors of
any particular magnitude is greatest if they are parallel, so we will get the maximum
x
change in height if the direction in which we move, , is parallel to
y
h
x .
h
y
It follows that:
h
direction
of maximum slope
the direction of hx is the
y
x
and if we assume that is normalized in some way, that:
y
h
the magnitude of hx is the
y
magnitude
of this maximum slope.
4 Difference equations
Mechanisms like suspension bridges often crop up in engineering which have the
property that parameters are discrete rather than continuous. For example we can in
principle work out the weights w 1 , w 2 , w 3 … on the cable of a suspension bridge with
tension T by measuring from a photograph the change in slope of the cable:
If weight were continuous, we would write that w x T
lim x x x
but
x 0
x
with a discontinuous variable we cannot let x tend to zero. Instead we use an integer
subscript to denote that these are discontinuous variables and write w n = T( n - n-1 ).
Sequences like w 1 , w 2 , w 3 … are called differences,and w n = T( n - n-1 ) is a
difference equation. There are other problems which also involve a sequence of
discrete numbers rather than a continuous function, for example voltages at nodes in a
repetitive electrical network, or populations (always whole numbers). How do we
solve them?
4.1 Solve a linear difference equation by trying y n = n
There are as many types of difference equation as there are ordinary differential
equations, but consider that equivalent to a second order linear differential equation:
yn ayn 1 byn 2
pn
n 2,3,4,.....
known coefficients
Each value yn can be calculated from its two predecessors yn 1, y n2, together with
(perhaps) a right-hand side value p n . This is a:
second-order
linear
Relates y n values up to 2 No y n 2 etc.
difference equation
Behaves quite a lot like a
places apart
differential equation
It can be solved by a "CF+PI" method very similar to that for ordinary differential
equations. Most problems don't have pn 's, so don't need the equivalent of a particular
integral. We thus consider the CF only.
For the second-order ODE, we guessed the function e t to try by considering the
solution of a first-order equation. We can do a similar thing here. A first-order linear
difference equation with no right-hand side takes the form
yn yn 1 0
Thus
y n = y n-1
=
for some .
2y n-2
=
3 y n-3
n y 0
=
So we can look for a general CF by trying y n = n
, & looking for possible roots .
For our generic equation (with pn 0) this leads to
n a n1 b n 2 0
i.e.
2 a b 0
(since we are not interested in the solution 0 ).
Usually this quadratic equation will have two roots, 1 or 2 say. Now we can
use the principle of superposition to say that anything of the form
yn A 1n B 2 n ,
where A and B are arbitrary constants, is also a solution. This is in fact the general CF
— there is a similar theorem to the case of ODEs, that
An n’th order difference equation has a general solution which involves n arbitrary
constants
If we have two conditions, e.g. known values of y0 and y1 , we can find specific
values for the constants A and B, just as for an ODE.
4.2 Example
Suppose that:
1) rabbits reach breeding age in their second season
2) all litters consist of exactly one pair
3) rabbits never die
How many rabbits will one isolated pair produce in n seasons?
Let a n = the number of pairs of rabbits after n seasons.
a n+1 =
Then
an
+
a n-
1
next generation
Try
then
so
so
So the general
solution is:
number already there
number of breeding pairs
an = n
n+1 = n + n-1
2 - - 1 = 0
=
1 5
2
n
an
1 5
1 5
+ B
= A
2
2
n
Now suppose that the initial condition (i.e.
creation) is
a0 0
a1 1
Then
A+B= 0
1 5
1 5
B
A
2 1
2
so
A=
1
,
B=-
5
1
5
n
n
1 1 5 1 5
an
2
2
5
so
So the sequence is: 0 1 1 2 3 5 8 13 21 34…
Notes
1) This, the Fibonacci sequence, is the earliest recorded example (1202) of a
mathematical model
n
1 5
1 5
1 1 5
. The number
2)
>1,
<1, so as n , a n
2
2
5 2
1 5
= 1.618… and is called the “golden ratio”
2
3) Although inaccurate for rabbits, the Fibonacci numbers often do crop up, for
example with flower petals or pineapple segments.
© Copyright 2026 Paperzz