Ordinary Differential Equations SCHOOL OF ENGINEERING

advertisement
SCHOOL OF ENGINEERING & BUILT
ENVIRONMENT
Mathematics
Ordinary Differential Equations
1.
2.
3.
4.
5.
Introduction ……………………………………………
Ordinary Differential Equations – The Basics ………
1st Order, Separable ……………………………………
Linearity ……………………………………………….
2nd Order, Linear ODEs with Constant Coefficients …..
a) Homogeneous Equations …………………….
b) Non-Homogeneous Equations ……………….
Tutorial Exercises ………………………………………
Answers to Tutorial Exercises ………………................
Dr Derek Hodson
1
1
3
6
8
9
19
25
27
1
ODES_Rev/D Hodson
Ordinary Differential Equations
1)
Introduction
A differential equation is an equation that contains derivatives of a function. For example
dy
= x2 − 1
dx
[1]
dy
− y = 0
dx
[2]
a
d 2x
dx
+ b
+ cx = 0
2
dt
dt
[3]
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
2
∂ 2u
2 ∂ u
=
c
∂t2
∂ x2
[4]
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.
2)
Ordinary Differential Equations – The Basics
dy
, 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
Given an ODE in terms of
dy
= x2 − 1 .
dx
[5]
The solution we desire will be of the form
y = f ( x) .
In this case, the task is simple. We seek the function that, when differentiated, gives us
x2 − 1 .
2
Hence
y =
∫
y =
1 3
x − x + C .
3
( x 2 − 1) dx
and so
[6]
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
is a 1st order ODE,
d 2x
dx
+ cx = 0
a 2 + b
dt
dt
is 2nd order, and so on. The order of an ODE determines the number of arbitrary constants
appearing in its general solution:
1st order 2nd order -
1 arbitrary constant
2 arbitrary constants.
We will not be considering ODEs of order higher that 2.
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
y =
1 3
x − x + C .
3
[7]
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
y =
1 3
x − x + 1 ,
3
[8]
which satisfies both the ODE and the condition.
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.
3)
1st Order, Separable
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
. That is, the ODE can be rewritten as
involving y to the other side, next to the top bit of
dx
f ( y ) dy = g ( x ) dx .
Integrating both sides we obtain
∫
f ( y ) dy =
∫ g ( x ) dx
.
Providing we can perform the two integrations, we can obtain the functional relationship between
y and x .
Examples / Over the page . . .
4
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.
(1)
ODE
dy
= x2 + 1
dx
Separate
dy = ( x 2 + 1) dx
Form integrals
∫ 1 dy = ∫ ( x
Integrate
y
=
1
3
2
+ 1) dx
x3 + x + C
[ Note that we only need one constant of integration. ]
(2)
ODE
dy
x
=
dx
y
Separate
y dy = x dx
Form integrals
∫
Integrate
1
2
Tidy up
y2 = x2 + C
y dy =
y2 =
y = ±
1
2
∫ x dx
~
x2 + C
x2 + C
,
~
(C = 2C )
5
(3)
ODE
dy
= y (1 − 3 x 2 )
dx
Separate
dy
= (1 − 3 x 2 ) dx
y
Form integrals
∫
Integrate
ln y
Tidy up
y = ex−x
dy
=
y
∫ (1
− 3 x 2 ) dx
= x − x3 + C
3
+C
y = e x − x eC
3
y = Aex−x
(4)
3
ODE
dy
− y = 0
dx
Re-arrange
dy
= y
dx
Separate
dy
= dx
y
Form integrals
∫
Integrate
ln y
Tidy up
y = ex+C
dy
=
y
,
A = eC
∫ 1 dx
= x + C
y = e x eC
y = Aex
,
A = eC
6
(5)
ODE + condition
dy
= y (1 − 3 x 2 )
dx
,
y (2) = 1
From Example (3):
= x − x3 + C .
ln y
y = 1
Apply condition:
when
x = 2
ln 1 = 2 − 2 3 + C
0
=
−6
+ C
C = 6.
Substitute value:
ln y
= x − x3 + 6 .
Tidy up:
y = ex−x
4)
3
+6
.
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): / Over the page . . .
7
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 )
where a 1 and a 2 are constants. A non-linear combination would contain
powers and/or products of the yi's.
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.
Definition (3):
x1 ( t ) ≠ k x 2 ( t ) .
5)
1st Order, Linear ODEs
For the moment, we shall restrict ourselves to the basic form:
dx
+ k x = 0
dt
where k is a constant.
We can solve this equation using separation of variables:
dx
= −kx
dt
dx
= − k dt
x
∫
dx
=
x
ln x
∫
(− k ) dt
= −kt + C
x = e
−k t + C
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
6)
2nd Order, Linear ODEs with Constant Coefficients
These type of ODEs come in two forms:
d 2x
dx
a 2 + b
+ cx = 0
dt
dt
a
(Homogeneous)
d 2x
dx
+ b
+ c x = f (t )
2
dt
dt
(Non-homogeneous)
[9]
[10]
where a , b and c are constants.
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:
Equilibrium state
k
c
Disturbed state
k
c
m
O
m
x
In this system:
m = mass
k = spring stiffness
c = damping coefficient
x = displacement of mass
dx
= velocity of mass
dt
d 2x
= acceleration of mass
dt 2
Force on mass due to spring = − k x
Force on mass due to dashpot = − c
dx
.
dt
9
Newton's 2nd law of motion states that Mass × Acceleration = Force, so
m
d 2x
dx
= −k x − c
2
dt
dt
or
d 2x
dx
m 2 + c
+ k x = 0 .
dt
dt
(c.f. equation [9])
If there are other forces acting on the mass (such as a forced vibration) then we obtain
m
d 2x
dx
+ c
+ k x = f (t )
2
dt
dt
(c.f. equation [10])
where f ( t ) is called the forcing term.
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
a
d 2x
dx
+ b
+ cx = 0
2
dt
dt
[11]
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.
Consider a function x of the form
x = e λt
where λ is unspecified. If we differentiate this function twice we obtain
dx
= λ e λt
dt
and
d 2x
= λ2 e λ t .
dt 2
[12]
10
Notice that x and its derivatives have a common factor of
expressions into ODE [11] we obtain
e λt .
If we substitute these
( a λ2 + b λ + c ) e λ t = 0
or
a λ2 + b λ + c = 0 ,
[13]
since e λ t ≠ 0 . If we choose λ to satisfy this quadratic equation then, automatically, the
function [12] will be a particular solution of the ODE.
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
λ =
Case (i)
−b ±
b2 − 4 a c
2a
.
b2 − 4 a c > 0
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
will be one particular solution of the ODE and
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
Case (ii)
b2 − 4 a c < 0
In this case we will end up with two complex roots of the auxiliary equation:
λ = λ1 = α + i β
λ = λ2 = α − i β .
and
Just as in case (i) the general solution can be written down as
~
~
x = A e λ1 t + B e λ2 t
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
].
Using a result from complex number theory we can write
e
jβt
= cos ( β t ) + j sin ( β t )
and
e − j β t = cos ( β t ) − j sin ( β t ) .
Therefore the general solution of the ODE can be rewritten as
x = eαt
[ A cos ( β t )
+ B sin ( β t )
]
[15]
~ ~
~ ~
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]
x = t e λ0 t
[17]
and
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]
x = ( A + B t ) e λ0 t .
[19]
or
Summary
To solve the ODE
d 2x
dx
a 2 + b
+ cx = 0 :
dt
dt
a λ2 + b λ + c = 0 ;
I)
form the auxiliary equation
II)
solve the auxiliary equation;
III)
write down the general solution of the ODE, depending on the nature of the solution of the
quadratic :–
Two real roots:
x = A e λ1 t + B e λ2 t
Two complex roots:
x = eαt
One real root:
x = ( A + B t ) e λ0 t .
[ A cos ( β t )
+ B sin ( β t )
]
13
Examples
(6)
ODE
d 2x
dx
−
− 2x = 0
2
dt
dt
Auxiliary equation:
λ2 − λ − 2 = 0
( λ − 2 ) ( λ + 1) = 0
λ = 2
λ = −1
,
Two real and distinct roots:
x = A e 2t + B e −t
(7)
ODE
d 2x
dx
+
+ x = 0
2
dt
dt
Auxiliary equation:
λ2 + λ + 1 = 0
λ =
−1 ±
−3
2
= − 12 ± j
3
2
Complex roots:
α = − 12
,
β =
x = e −1 / 2 t [ A cos
3
2
( t) +
3
2
B sin
( t )]
3
2
14
(8)
d 2x
dx
+ 2
+ x = 0
2
dt
dt
ODE
Auxiliary equation:
λ 2 + 2λ + 1 = 0
( λ + 1) 2 = 0
λ = −1
One root only:
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
x ( a ) = c0
dx
( a ) = c1 ,
dt
where the 2nd condition is applied to the derivative of the general solution.
simultaneous equations for A and B will (in general) result.
Again, two
Example
d 2x
dx
+ 5
+ 6 x = 0 subject to
2
dt
dt
(9)
Solve
(a)
Auxiliary equation:
x(0) = 2 ,
λ 2 + 5λ + 6 = 0
(λ + 3)(λ + 2) = 0
λ
= − 2, λ
= −3
General solution:
x = Ae −2 t + Be −3 t
Apply x ( 0 ) = 2 :
2 = A e −2×0 + B e −3×0
A + B = 2
dx
(0) = 1 .
dt
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
Now apply
dx
( 0 ) = 1:
dt
1 = − 2 Ae −2 ×0 − 3Be −3×0
− 2 A − 3B = 1
The two underlined equations solve simultaneously to give A = 7 and B = − 5 .
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
+
+ x = 0
2
dt
dt
ODE
x(0) = h
dx
(0) = 0
dt
Initial displacement
Initial velocity
The ODE is just that from Example (7).
So
x = e
−
1
t
2
[ A cos
( t) +
3
2
B sin
( t )] .
3
2
Apply first condition, x ( 0 ) = h :
h = e
−
1
×0
2
h = A
A = h .
[ A cos
( 0) +
3
2
B sin
( 0 )]
3
2
16
Substitute:
x = e
−
1
t
2
[ h cos
( t) +
3
2
B sin
( t )] .
3
2
Before we can apply the second condition, we must determine the derivative of x. Applying
the Product Rule gives
1
− t
dx
= − 12 e 2 [ h cos
dt
+
e
−
1
t
2
Now apply the second condition,
0 = − 12 e
−
1
×0
2
e
0 = − 12 h +
B =
−
3
2
3
2
[ −h
3
2
( t )]
sin ( t ) + B
B sin
3
2
3
2
3
2
cos
1
×0
2
( 0) +
3
2
[ −h
3
2
( 0 )]
sin ( 0 ) + B
B sin
3
2
3
2
B
3
Substitute this to give the final form for the displacement x:
−
1
t
2
3
2
3
2
h
x = e
( t )] .
dx
(0) = 0 :
dt
[ h cos
+
( t) +
[ h cos
( t) +
3
2
h
sin
3
( t )]
3
2
cos
( 0 )]
3
2
17
(11) Solve
(a)
d 2x
+ 4 x = 0 subject to
dt 2
(a)
x(0) = 1
x ( π8 ) = −
(b)
x(0) = 1
dx
(0) = 4 .
dt
2
λ2 + 4 = 0
Auxiliary equation:
λ2 = − 4
λ = 0 ± 2j
General solution:
α = 0,
β = 2
x = eαt
[ A cos ( β t )
+ B sin ( β t )
x = e 0×t
[ A cos ( 2 t )
+ B sin ( 2 t )
]
]
x = A cos ( 2 t ) + B sin ( 2 t )
Apply x ( 0 ) = 1 :
x = A cos ( 2 t ) + B sin ( 2 t )
1 = A cos ( 2 × 0 ) + B sin ( 2 × 0 )
1 = A
A = 1
Apply x ( π8 ) = −
x
2 :
= A cos ( 2 t ) + B sin ( 2 t )
−
2 = A cos ( π4 ) + B sin ( π4 )
−
2 = A
1
2
+ B
1
2
A + B = −2
The two underlined equations solve simultaneously to give A = 1 and B = − 3 .
Substitute these value into the general solution to give the particular solution
x = cos ( 2 t ) − 3 sin ( 2 t )
18
(b)
Everything starts exactly as in part (a):
General solution:
x = A cos ( 2 t ) + B sin ( 2 t )
Apply x ( 0 ) = 1 :
( same as before)
x = A cos ( 2 t ) + B sin ( 2 t )
1 = A cos ( 2 × 0 ) + B sin ( 2 × 0 )
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
Now apply
dx
(0) = 4 :
dt
dx
= − 2 A sin ( 2 t ) + 2 B cos ( 2 t )
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
a
dy
d2y
+ b
+ c y = f ( x)
2
dx
dx
[24]
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 ) .
The Method of Undetermined Coefficients
This method is best illustrated by example. Consider the ODE
d2y
dy
−
− 2 y = x2 + 4 .
2
dx
dx
First we determine the complementary function:
Aux. Eq.: λ2 − λ − 2 = 0
( λ − 2 ) ( λ + 1) = 0
λ = 2
λ = −1 .
Two real roots, so
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
dx
d 2 yp
dx 2
= 2ax + b
[27]
= 2a .
[28]
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 .
Collecting together the powers of x on the LHS gives us
( 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 :
−2 a = 1
coefficients of x2 :
coefficients of x :
−( 2 a + 2 b ) = 0
constant term :
2a − b − 2c = 4 .
Solving these equations gives
a = − 12
b =
c = − 114 .
1
2
Our particular solution is therefore
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
See Examples (12) – (13) after the table of yp starting forms.
22
Table of Starting Forms for Particular Solutions
of Non-homogeneous ODEs
RHS function f ( x )
Starting form for y p ( x )
Any constant term ( e.g. 4 , −3 )
a
Any linear term ( e.g. 2 x , 5 x − 8 )
ax + b
Any quadratic term ( e.g. 3 x2 + 2 x − 6 )
a x2 + b x + c
RHS contains an exponential of the form e k x
(where k is not a root of the AE)
a ekx
RHS contains an exponential of the form e k x
(where k is one of two distinct roots of the
AE)
a x ekx
RHS contains an exponential of the form e k x
(where k is a repeated root of the AE)
a x2 e k x
RHS contains cos ( k x ) or sin ( k x ) or both
a cos ( k x ) + b sin ( k x )
or
x [ a cos ( k x ) + b sin ( k x ) ] ∗
∗ This only occurs with ODEs of the form
d2y
+ k 2 y = RHS containing cos ( k x ) or sin ( k x ) or both .
2
dx
23
Examples
(12) ODE
d2y
dy
+ 3
+ 2y = x + 4
2
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
Substitute into ODE:
0 + 3a + 2( a x + b ) = x + 4
Collect like terms:
2 a x + (3a + 2b ) = x + 4
Equate coefficients:
= 1
x terms:
2a
constant terms:
3a + 2b = 4
Solve simultaneous equations and substitute into y p :
a =
1
2
b =
5
4
yp =
1
2
x +
5
4
Combine y c and y p to give the general solution of the full ODE:
y = A e −x + B e −2x +
1
2
x +
5
4
24
(13) ODE
d2y
+ y = sin ( 2 x )
dx 2
Aux. Equation
λ2 + 1 = 0
λ 2 = −1
λ = ± j
= 0 ± j
Comp. Function y c = A cos x + B sin x
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 )
y ′p′ = − 4 a cos ( 2 x ) − 4 b sin ( 2 x )
Substitute into ODE:
[ − 4 a cos ( 2 x ) − 4 b sin ( 2 x ) ] + [ a cos ( 2 x ) + b sin ( 2 x ) ] = sin ( 2 x )
Collect like terms:
− 3 a cos ( 2 x ) − 3 b sin ( 2 x ) = sin ( 2 x )
Equate coefficients:
cosine terms:
sine terms:
− 3a
− 3b
= 0
= 1
→
→
a = 0
b = − 13
Substitute into y p :
y p = − 13 sin ( 2 x )
Combine y c and y p to give the general solution of the full ODE:
y = A cos x + B sin x −
1
3
sin ( 2 x )
25
Tutorial Exercises
1st Order ODEs – Separable
(1)
(2)
Determine the general solution of each of the following ODEs:
(i)
dy
− 2y = 0
dx
(ii)
dy
+ 4 y2 = 0
dx
(iii)
dy
− 2y = 4
dx
(iv)
x
(v)
dy
+ e x y2 = 0
dx
(vi)
dy
= 2 x −1
dx
dy
+ y = 0
dx
y −1
Determine the particular solution of each of the following ODEs that also satisfies the given
boundary or initial condition:
dy
= 2y
dx
(i)
( x + 1)
(ii)
dy
+ e 2x y2 = 0
dx
(iii)
2t
dx
= 3x
dt
y(0) = 1
,
y ( 0) = −1
,
x (1) = 4
,
2nd Order ODEs – Linear, Constant Coefficients (Homogeneous)
(3)
Determine the general solution of each of the following ODEs:
(i)
d2y
dy
−
− 6y = 0
2
dx
dx
(iii)
d2y
dy
− 6
+ 9y = 0
2
dx
dx
(v)
d2y
dy
− 2
+ 4y = 0
2
dx
dx
d2y
− 9y = 0
(vii)
dx 2
(ii)
d2y
+
dx 2
(iv)
d2y
dy
+2
+ y = 0
2
dx
dx
(vi)
dy
− 42 y = 0
dx
d2y
dy
+ 2
+ 2y = 0
2
dx
dx
d2y
(viii)
+ 9y = 0
dx 2
26
(4)
Determine the particular solution of each of the following ODEs that also satisfies the given
boundary or initial conditions:
(i)
d2y
dy
− 2
− 8y = 0
2
dx
dx
,
y (0) = 0
(ii)
d2y
dy
+ 6
+ 13 y = 0
2
dx
dx
,
y (0) = 2
y′ ( 0 ) = 0
(iii)
d2y
dy
+ 4
+ 4y = 0
2
dx
dx
,
y (0) = 1
y′ ( 0 ) = 4
(iv)
d2y
dy
+ 4
+ 4y = 0
2
dx
dx
,
y (0) = 1
y (1) = 0
(v)
d2y
+ 4y = 0
dx 2
,
y (0) = 1
y ( π4 ) = 3
y′ ( 0 ) = 6
2nd Order ODEs – Linear, Constant Coefficients (Non-Homogeneous)
(5)
Determine the general solution of each of the following ODEs:
(i)
d2y
dy
+ 10
+ 16 y = 80
2
dx
dx
(ii)
(iii)
d2y
dy
+ 3
− 4 y = − 8x − 6
2
dx
dx
(iv)
(v)
d2y
dy
+ 3
− 10 y = 4 e 3 x + 2
2
dx
dx
(vi)
d2y
dy
− 5
+ 6 y = 3x + 3
2
dx
dx
d2y
dy
+ 3
+ 2 y = 2e 2x
2
dx
dx
d2y
+ 4 y = sin(3x)
dx 2
27
Answers
(1)
(2)
(3)
(i)
y = A e 2x
(ii)
y =
1
(4x − C)
(iii)
y = A e 2x − 2
(iv)
y =
A
x
(v)
y =
(vi)
y = [ ln x
1
e −C
x
(i)
y = ( x + 1) 2
(ii)
y =
(iii)
x 2 = 16 t 3
(i)
y = A e 3x + B e −2x
(ii)
y = A e −7 x + B e 6 x
(iii)
y = ( A + B x ) e 3x
(iv)
y = ( A + B x) e −x
(v)
y = e x [ A cos (
(vi)
y = e − x [ A cos ( x ) + B sin ( x ) ]
(vii)
y = A e 3x + B e −3x
(viii)
y = A cos ( 3 x ) + B sin ( 3 x )
2
e −3
2x
3 x ) + B sin (
3 x) ]
+ C ]2 + 1
28
(4)
(5)
(i)
y = e 4x − e −2x
(ii)
y = e − 3 x [ 2 cos ( 2 x ) + 3 sin ( 2 x ) ]
(iii)
y = (1 + 6 x ) e − 2 x
(iv)
y = (1 − x ) e − 2 x
(v)
y = cos ( 2 x ) + 3 sin ( 2 x )
(i)
y = A e −8x + B e − 2 x + 5
(ii)
y = A e 2 x + B e 3x +
(iii)
y = A e − 4x + B e x + 2x + 3
(iv)
y = A e −x + B e −2x +
(v)
y = A e −5x + B e 2 x +
(vi)
y = A cos ( 2 x ) + B sin ( 2 x ) −
1
11
x +
2
12
1
2
1
6
e 2x
e3 x −
1
5
1
5
sin ( 3 x )
Download