Professional Documents
Culture Documents
Level 3 Ebe Odes (Updated)
Level 3 Ebe Odes (Updated)
Level 3 Ebe Odes (Updated)
ENVIRONMENT
Mathematics
Dr Derek Hodson
1
ODES_Rev/D Hodson
1) Introduction
dy
= x2 − 1 [1]
dx
dy
− y = 0 [2]
dx
d 2x dx
a 2
+ b + cx = 0 [3]
dt dt
are all differential equations. Technically they are ordinary differential equations (ODEs) since
they contain ordinary derivatives as opposed to partial derivatives. An equation that contains
partial derivatives is called a partial differential equation (PDE). The equation
∂ 2u 2 ∂ u
2
= c [4]
∂t2 ∂ x2
is an example of a partial differential equation. In this module we will only be dealing with
ordinary differential equations. Differential equations are important as they can describe
mathematically the behaviour of physical processes such as population dynamics, oscillatory
phenomena in electrical and mechanical systems, heat transfer within materials, as well as many
others.
dy
Given an ODE in terms of , where y is called the dependent variable and x is the
dx
independent variable, our aim is to determine y in terms of x , without any derivatives.
Consider the simple ODE
dy
= x2 − 1 . [5]
dx
y = f ( x) .
In this case, the task is simple. We seek the function that, when differentiated, gives us
x2 − 1 .
2
Hence
y =
∫ ( x 2 − 1) dx
and so
1 3
y = x − x + C . [6]
3
Notice that an arbitrary constant has been generated. This means that expression [6] does not
represent just a single solution of ODE [5], but infinitely many (one for each possible value of C).
Expression [6] is called the GENERAL SOLUTION of [5] since it covers all possible solutions
of the given ODE. Solutions with arbitrary constants are characteristic of ODEs.
The ORDER of an ODE is given by the highest derivative appearing in it. For example
dy
= x2 − 1
dx
d 2x dx
a 2 + b + cx = 0
dt dt
is 2nd order, and so on. The order of an ODE determines the number of arbitrary constants
appearing in its general solution:
Once the general solution of an ODE has been found, a PARTICULAR SOLUTION may be
determined by applying additional constraints called boundary conditions or initial/final
conditions. For the simple 1st order ODE above we might be asked to solve
dy
= x2 − 1
dx
subject to
y (0) = 1 .
That is, from the infinity of solutions of the ODE we are looking for the one that will give y = 1
when x = 0 . The general solution is
1 3
y = x − x + C . [7]
3
3
To determine the particular solution that satisfies the given condition, we determine a value for C
by substituting y = 1 and x = 0 into the general solution and solving the resulting equation :
1 = 0 − 0 + C
C = 1 ,
giving
1 3
y = x − x + 1 , [8]
3
In general, we require one condition per arbitrary constant to determine a particular solution. So
the number of conditions required equals the order of the ODE.
In the simple case above we were able to determine the general solution of the ODE by a single,
direct integration. Other ODEs may require different methods. We shall now consider some
special types of ODEs.
A separable ODE (in terms of y and x ) is one where we can algebraically move everything
dy
involving x , including the bottom bit of , to one side of the equation, and everything
dx
dy
involving y to the other side, next to the top bit of . That is, the ODE can be rewritten as
dx
f ( y ) dy = g ( x ) dx .
∫ f ( y ) dy =
∫ g ( x ) dx .
Providing we can perform the two integrations, we can obtain the functional relationship between
y and x .
Examples
In the following examples, Examples (1) – (5) illustrate the basic processes in solving separable
ODEs and tidying up the solution. Example (6) illustrates how a boundary or initial condition can
be applied as soon as the constant of integration appears. Example (7) illustrates that some
solutions cannot be manipulated into the explicit form y = f ( x ) , and so we might have to be
content with an implicit form of solution.
dy
(1) ODE = x2 + 1
dx
Separate dy = ( x 2 + 1) dx
∫ 1 dy = ∫ ( x + 1) dx
2
Form integrals
Integrate y = 1
3 x3 + x + C
dy x
(2) ODE =
dx y
Separate y dy = x dx
Form integrals
∫ y dy =
∫ x dx
~
Integrate 1
2 y2 = 1
2 x2 + C
~
Tidy up y2 = x2 + C , (C = 2C )
y = ± x2 + C
5
dy
(3) ODE = y (1 − 3 x 2 )
dx
dy
Separate = (1 − 3 x 2 ) dx
y
∫ ∫ (1
dy
Form integrals = − 3 x 2 ) dx
y
Integrate ln y = x − x3 + C
y = ex−x +C
3
Tidy up
y = e x − x eC
3
y = Aex−x
3
, A = eC
dy
(4) ODE − y = 0
dx
dy
Re-arrange = y
dx
dy
Separate = dx
y
∫ ∫ 1 dx
dy
Form integrals =
y
Integrate ln y = x + C
Tidy up y = ex+C
y = e x eC
y = Aex , A = eC
6
dy
(5) ODE + condition = y (1 − 3 x 2 ) , y (2) = 1
dx
ln y = x − x3 + C .
ln 1 = 2 − 2 3 + C
0 = −6 + C
C = 6.
Substitute value:
ln y = x − x3 + 6 .
Tidy up:
y = ex−x +6
3
.
4) Linearity
In the Section (5) we will be moving on to special types of 2nd order ODEs. The following
definitions will prove useful for the understanding of parts of that section.
Definition (1): An ODE is said to be non-linear if it contains powers and/or products of the
dependent variable or its derivatives, and linear if otherwise. For example
dy
+ p( x) y = q( x)
dx
is linear, whereas
dy
+ y3 = 1
dx
is non-linear.
The remaining types of ODEs that we shall consider are all linear and we shall exploit the special
properties of linear equations in determining their solutions. Also, we shall switch to variables x
and t since many applications of these type of ODEs are time dependent.
Definition (2): If we have two functions, x1 ( t ) and x 2 ( t ) , then a linear combination of these
functions takes the form
x ( t ) = a1 x1 ( t ) + a 2 x 2 ( t )
Definition (3): Two functions, x1 ( t ) and x 2 ( t ) are said to be linearly independent if one
function is not a constant multiple of the other, i.e.
x1 ( t ) ≠ k x 2 ( t ) .
dx
+ k x = 0
dt
where k is a constant.
dx
= −kx
dt
dx
= − k dt
x
dx
∫ x
= ∫ (− k ) dt
ln x = −kt + C
−k t + C
x = e
x = e −k t . e C
x = Ae −k t .
Notice the exponential function appearing in the final form of the solution and how the k in the
original ODE appears in that exponential. Exponential solutions also crop up in 2nd order, linear
ODEs.
8
d 2x dx
a 2 + b + cx = 0 (Homogeneous) [9]
dt dt
d 2x dx
a 2
+ b + c x = f (t ) (Non-homogeneous) [10]
dt dt
Equations of the above form are extremely useful for modelling certain types of physical systems.
Consider a simple suspension system linking a mass to some fixture via a spring and dashpot:
k c
k c
m
O
In this system:
m = mass
k = spring stiffness
c = damping coefficient
x = displacement of mass
dx d 2x
= velocity of mass = acceleration of mass
dt dt 2
dx
Force on mass due to dashpot = − c .
dt
9
d 2x dx
m 2
= −k x − c
dt dt
or
d 2x dx
m 2 + c + k x = 0 . (c.f. equation [9])
dt dt
If there are other forces acting on the mass (such as a forced vibration) then we obtain
d 2x dx
m 2
+ c + k x = f (t ) (c.f. equation [10])
dt dt
Similar ODEs can be derived that model the behaviour of current or voltage in electronic circuits.
These type of equations are applicable to many areas where oscillations or vibrations are present.
This will become apparent when we look at the solutions to the ODEs.
a) Homogeneous Equations
d 2x dx
a 2
+ b + cx = 0 [11]
dt dt
Rather than solving equations of this type by a step-by-step integration process, as we did for 1st
order equations, we are going to construct solutions based on inherent properties of linear,
homogeneous equations and certain mathematical functions.
x = e λt [12]
dx
= λ e λt
dt
and
d 2x
= λ2 e λ t .
dt 2
10
Notice that x and its derivatives have a common factor of e λt . If we substitute these
expressions into ODE [11] we obtain
( a λ2 + b λ + c ) e λ t = 0
or
a λ2 + b λ + c = 0 , [13]
Equation [13] is called the auxiliary equation or characteristic polynomial of the ODE. Solving
it allows us to construct particular solutions and, hence, the general solution of the ODE. Since
we have to solve a quadratic equation, we have to deal separately with the different types of
solution that can occur. Recall that
−b ± b2 − 4 a c
λ = .
2a
When we have b 2 − 4 a c > 0 we will end up with two values of λ ; call these
λ = λ1 and λ = λ2 .
So
x = e λ1 t
x = e λ2 t
will be another. These solutions are linearly independent. Because of the homogeneity of the
ODE (i.e. zero RHS) and its linearity, any linear combination of the two particular solutions will
also be a solution of the ODE. That is, any composite function of the form
x = A e λ1 t + B e λ2 t [14]
will be a solution. In fact expression [14] covers all possible solutions of the ODE (when
b 2 − 4 a c > 0 ) and is therefore the general solution of the ODE. Note the two arbitrary
constants. We have constructed the general solution without the need to integrate.
11
In this case we will end up with two complex roots of the auxiliary equation:
λ = λ1 = α + i β and λ = λ2 = α − i β .
or
~ ~
x = A e (α + j β )t
+ B e (α − j β )t
or
~ ~
x = A eαt e jβt
+ B eαt e − jβt
or
x = eαt [ A~ e jβt ~
+ B e − jβt ].
jβt
e = cos ( β t ) + j sin ( β t )
and
e − j β t = cos ( β t ) − j sin ( β t ) .
~ ~ ~ ~
where A = ( A + B ) and B = j ( A − B ) . In general, the constants A and B can be
complex, but we shall only deal with real values. Note: Real numbers are a subset of complex
numbers.
Equation [15] provides us with a template solution when the auxiliary equation yields complex
roots.
12
Case (iii) b2 − 4 a c = 0
For this third case we will only have one root to play around with:
λ = λ0 .
This doesn't seem enough to give us a general solution with two arbitrary constants. However in
this special case it can be shown that
x = e λ0 t [16]
and
x = t e λ0 t [17]
are both particular solutions of the ODE. They are also linearly independent, so taking a linear
combination of [16] and [17] gives us the general solution
x = A e λ0 t + B t e λ0 t [18]
or
x = ( A + B t ) e λ0 t . [19]
Summary
d 2x dx
a 2 + b + cx = 0 :
dt dt
III) write down the general solution of the ODE, depending on the nature of the solution of the
quadratic :–
Examples
d 2x dx
(6) ODE 2
− − 2x = 0
dt dt
Auxiliary equation:
λ2 − λ − 2 = 0
( λ − 2 ) ( λ + 1) = 0
λ = 2 , λ = −1
x = A e 2t + B e −t
d 2x dx
(7) ODE 2
+ + x = 0
dt dt
Auxiliary equation:
λ2 + λ + 1 = 0
−1 ± −3
λ =
2
= − 12 ± j
3
2
Complex roots:
α = − 12 , β = 2
3
x = e −1 / 2 t [ A cos ( t) +
2
3
B sin ( t )]
2
3
14
d 2x dx
(8) ODE 2
+ 2 + x = 0
dt dt
Auxiliary equation:
λ 2 + 2λ + 1 = 0
( λ + 1) 2 = 0
λ = −1
x = ( A + B t ) e −t
Since the general solution of a 2nd order ODE has two arbitrary constants, we shall require two
boundary or initial conditions to evaluate a particular solution. These conditions may be given in
the form
x ( a ) = c0 x ( b ) = c1 ,
where they are both applied to the general solution to give (in general) two simultaneous equations
for the constants A and B . Alternatively, they may be given in the form
dx
x ( a ) = c0 ( a ) = c1 ,
dt
where the 2nd condition is applied to the derivative of the general solution. Again, two
simultaneous equations for A and B will (in general) result.
Example
d 2x dx dx
(9) Solve 2
+ 5 + 6 x = 0 subject to x(0) = 2 , (0) = 1 .
dt dt dt
(λ + 3)(λ + 2) = 0
λ = − 2, λ = −3
General solution: x = Ae −2 t + Be −3 t
A + B = 2
15
Before we can apply the second condition, we must differentiate the general solution:
x = Ae −2 t + Be −3 t
dx
= − 2 Ae −2 t − 3Be −3 t .
dt
dx
Now apply ( 0 ) = 1: 1 = − 2 Ae −2 ×0 − 3Be −3×0
dt
− 2 A − 3B = 1
Substitute these values into the general solution to give the particular solution
x = 7e −2 t − 5e −3 t
(10) Consider the spring-mass-dashpot system at the start of the section. Set m = 1 , c = 1 and
k = 1 . Determine the motion of the mass if it is initially displaced by an amount h and then
released from rest.
d 2x dx
ODE 2
+ + x = 0
dt dt
So
( t) + ( t )] .
1
− t
x = e 2 3 3
[ A cos 2 B sin 2
( 0) + ( 0 )]
1
− ×0
h = e 2 3 3
[ A cos 2 B sin 2
h = A
A = h .
16
Substitute:
( t) + ( t )] .
1
− t
x = e 2 3 3
[ h cos 2 B sin 2
Before we can apply the second condition, we must determine the derivative of x. Applying
the Product Rule gives
( t) + ( t )]
1
dx − t
= − 12 e 2 [ h cos
3 3
2 B sin 2
dt
sin ( t ) + B ( t )] .
1
− t
+ [ −h
2 3 3 3 3
e 2 2 2 cos 2
dx
Now apply the second condition, (0) = 0 :
dt
( 0) + ( 0 )]
1
− ×0
0 = − 12 e 2 3 3
[ h cos 2 B sin 2
sin ( 0 ) + B ( 0 )]
1
− ×0
+ [ −h
2 3 3 3 3
e 2 2 2 cos 2
0 = − 12 h +
3
2 B
h
B =
3
( t) + ( t )]
1
− t h
x = e 2 3 3
[ h cos 2 sin 2
3
17
d 2x
(11) Solve + 4 x = 0 subject to
dt 2
(a) x(0) = 1 x ( π8 ) = − 2
dx
(b) x(0) = 1 (0) = 4 .
dt
λ2 = − 4
λ = 0 ± 2j
α = 0, β = 2
1 = A cos ( 2 × 0 ) + B sin ( 2 × 0 )
1 = A
A = 1
− 2 = A cos ( π4 ) + B sin ( π4 )
1 1
− 2 = A + B
2 2
A + B = −2
Substitute these value into the general solution to give the particular solution
x = cos ( 2 t ) − 3 sin ( 2 t )
18
1 = A
A = 1
Before we can apply the second condition, we must differentiate the general solution:
x = A cos ( 2 t ) + B sin ( 2 t )
dx
= − 2 A sin ( 2 t ) + 2 B cos ( 2 t ) .
dt
dx dx
Now apply (0) = 4 : = − 2 A sin ( 2 t ) + 2 B cos ( 2 t )
dt dt
4 = − 2 A sin ( 2 × 0 ) + 2 B cos ( 2 × 0 )
4 = 0 + 2B
B = 2
Substituting the two underlined values into the general solution gives the particular solution
x = cos ( 2 t ) + 2 sin ( 2 t )
19
b) Non-Homogeneous Equations
d2y dy
a 2
+ b + c y = f ( x) [24]
dx dx
The general solution of a non-homogeneous ODE of the form [24] is found as follows:
STEP I Determine the general solution of the corresponding homogeneous ODE (i.e.
initially set the RHS to zero). In this context, we call this the complementary
function and denote it by y c ( x ) .
STEP II Determine one particular solution of the full, non-homogeneous ODE by the
method of undetermined coefficients (see below). We denote this by y p ( x ) .
STEP III The general solution of the full, non-homogeneous equation is then given by
y = yc ( x ) + y p ( x ) .
d2y dy
2
− − 2 y = x2 + 4 .
dx dx
Aux. Eq.: λ2 − λ − 2 = 0
( λ − 2 ) ( λ + 1) = 0
λ = 2 λ = −1 .
yc ( x ) = A e 2 x + B e − x .
20
Next, the aim is to determine one particular solution of the full, non-homogeneous equation. Its
format depends on the type of function on the RHS of the ODE. Looking at the RHS above we
see (in this case) a quadratic. We look for a particular solution of a similar form, namely a
quadratic. We write down the most general form that this can take:
y p = a x2 + b x + c , [26]
where a , b and c are the, as yet, undetermined coefficients. Our task is now to determine the
values of a , b and c that make [26] a solution of ODE [25]. We do this by substituting the
general form [26] into the LHS of ODE [25] and force this new LHS to equal the given RHS. To
do this we form the 1st and 2nd derivatives of [26]:
dy p
= 2ax + b [27]
dx
d 2 yp
= 2a . [28]
dx 2
Substituting [26], [27] and [28] into the LHS of [25] we get
[ 2 a ] − [ 2 a x + b ] − 2 [ a x2 + b x + c ] = x2 + 4 .
( 2 a − b − 2 c ) − ( 2 a + 2 b ) x − 2 a x2 = x2 + 4 . [29]
If [26] is to be a solution of [25] then we must determine a , b and c so that the LHS of [29]
equals the RHS. Equating the coefficients of the powers of x on both sides yields three equations
in a , b and c :
coefficients of x2 : −2 a = 1
coefficients of x : −( 2 a + 2 b ) = 0
constant term : 2a − b − 2c = 4 .
a = − 12 b = 1
2 c = − 114 .
y p ( x ) = − 12 x 2 + 1
2 x − 11
4 .
21
We can now write down the general solution of ODE [25] by adding together the complementary
function and the particular solution:
y ( x) = A e 2x + B e −x − 1
2 x2 + 1
2 x − 11
4 .
For other forms of RHS functions f ( x ) we look for functions which are similar in form. There
are one or two exceptions so the table on the next page gives the starting choice for y p ( x )
corresponding to various RHSs.
If f ( x ) is a sum of different terms then we add together corresponding forms of yp's , using
different undetermined coefficients.
Examples
d2y
2
+ k 2 y = RHS containing cos ( k x ) or sin ( k x ) or both .
dx
23
Examples
d2y dy
(12) ODE 2
+ 3 + 2y = x + 4
dx dx
Aux. Equation λ 2 + 3λ + 2 = 0
( λ + 1) ( λ + 2 ) = 0
λ = −1 , λ = − 2
Comp. Function y c = A e − x + B e − 2 x
Since the RHS of the ODE is a linear function we select a particular solution of the
form
yp = a x + b
Differentiate:
y ′p = a
y ′p′ = 0
0 + 3a + 2( a x + b ) = x + 4
2 a x + (3a + 2b ) = x + 4
Equate coefficients:
x terms: 2a = 1
constant terms: 3a + 2b = 4
a = 1
2
b = 5
4
yp = 1
2 x + 5
4
y = A e −x + B e −2x + 1
2 x + 5
4
24
d2y
(13) ODE + y = sin ( 2 x )
dx 2
Aux. Equation λ2 + 1 = 0
λ 2 = −1
λ = ± j
= 0 ± j
Since the RHS of the ODE is a trig function whose coefficient is 2 , we select a
particular solution of the form
y p = a cos ( 2 x ) + b sin ( 2 x )
Differentiate:
y ′p = − 2 a sin ( 2 x ) + 2 b cos ( 2 x )
Equate coefficients:
cosine terms: − 3a = 0 → a = 0
sine terms: − 3b = 1 → b = − 13
Substitute into y p :
y p = − 13 sin ( 2 x )
y = A cos x + B sin x − 1
3 sin ( 2 x )
25
Tutorial Exercises
dy dy
(i) − 2y = 0 (ii) + 4 y2 = 0
dx dx
dy dy
(iii) − 2y = 4 (iv) x + y = 0
dx dx
dy dy
(v) + e x y2 = 0 (vi) = 2 x −1 y −1
dx dx
(2) Determine the particular solution of each of the following ODEs that also satisfies the given
boundary or initial condition:
dy
(i) ( x + 1) = 2y , y(0) = 1
dx
dy
(ii) + e 2x y2 = 0 , y ( 0) = −1
dx
dx
(iii) 2t = 3x , x (1) = 4
dt
d2y dy d2y dy
(i) − − 6y = 0 (ii) + − 42 y = 0
dx 2
dx dx 2 dx
d2y dy d2y dy
(iii) 2
− 6 + 9y = 0 (iv) 2
+2 + y = 0
dx dx dx dx
d2y dy d2y dy
(v) 2
− 2 + 4y = 0 (vi) 2
+ 2 + 2y = 0
dx dx dx dx
d2y d2y
(vii) − 9y = 0 (viii) + 9y = 0
dx 2 dx 2
26
(4) Determine the particular solution of each of the following ODEs that also satisfies the given
boundary or initial conditions:
d2y dy
(i) 2
− 2 − 8y = 0 , y (0) = 0 y′ ( 0 ) = 6
dx dx
d2y dy
(ii) 2
+ 6 + 13 y = 0 , y (0) = 2 y′ ( 0 ) = 0
dx dx
d2y dy
(iii) 2
+ 4 + 4y = 0 , y (0) = 1 y′ ( 0 ) = 4
dx dx
d2y dy
(iv) 2
+ 4 + 4y = 0 , y (0) = 1 y (1) = 0
dx dx
d2y
(v) + 4y = 0 , y (0) = 1 y ( π4 ) = 3
dx 2
d2y dy d2y dy
(i) 2
+ 10 + 16 y = 80 (ii) 2
− 5 + 6 y = 3x + 3
dx dx dx dx
d2y dy d2y dy
(iii) 2
+ 3 − 4 y = − 8x − 6 (iv) 2
+ 3 + 2 y = 2e 2x
dx dx dx dx
d2y dy d2y
(v) 2
+ 3 − 10 y = 4 e 3 x + 2 (vi) + 4 y = sin(3x)
dx dx dx 2
27
Answers
1
(1) (i) y = A e 2x (ii) y =
(4x − C)
A
(iii) y = A e 2x − 2 (iv) y =
x
1
(v) y = (vi) y = [ ln x + C ]2 + 1
e −C
x
(2) (i) y = ( x + 1) 2
2
(ii) y =
e −3
2x
(iii) x 2 = 16 t 3
(ii) y = A e −7 x + B e 6 x
(iii) y = ( A + B x ) e 3x
(iv) y = ( A + B x) e −x
(vii) y = A e 3x + B e −3x
(iii) y = (1 + 6 x ) e − 2 x
(iv) y = (1 − x ) e − 2 x
1 11
(ii) y = A e 2 x + B e 3x + x +
2 12
(iii) y = A e − 4x + B e x + 2x + 3
(iv) y = A e −x + B e −2x + 1
6
e 2x
1
(v) y = A e −5x + B e 2 x + 1
2 e3 x −
5