0% found this document useful (0 votes)
31 views

Ordinary Differential Equations

Linear Mathematics

Uploaded by

madzkelvin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Ordinary Differential Equations

Linear Mathematics

Uploaded by

madzkelvin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

University of Zimbabwe

LINEAR ALGEBRA
Department:
Author:
Mathematics and
M. Zhangazha
computational sciences

March 12, 2022


Chapter 1

Introduction to Differential Equations

A drunkard may not know which number is larger, 2/3 or 3/5, but he knows that 2 bottles of vodka for 3
people is better than 3 bottles of vodka for 5 people.

—Edward Frenkel

1.1 Introduction

Many of the basic laws of the physical sciences, biological and social sciences are formulated in terms
of mathematical equations involving certain known and unknown quantities and their derivatives.
Such equations are called differential equations.

Definitions of terms

1. A differential equation is an equation involving a function, its derivatives, and independent


variables.

2. A function that satisfies the differential equation when substituted is called a solution of the
equation. Sometimes referred to as the integral of the equation and its graph is called an
integral curve or solution curve.

3. The term general solution will be used for a family of solutions of the differential equation
containing one or more arbitrary constants.

4. A particular solution will be any solution that is free of arbitrary constants.

5. A differential equation involving only ordinary derivatives (derivatives of a function of one


variable) is called an ordinary differential equation.

1
6. The order of a differential equation is defined as the order of the highest derivative appearing
in the equation.
Example 1.1.1. The following are differential equations with indicated orders.
dy
(a) = ay (first order).
dx
(b) x00 (t) − 3x0 (t) + x(t) = cos t (second order).
3
(c) (y (4) ) 5 − 2y 00 = cos x (fourth order).

7. A differential equation is said to be linear if it has the form


dn y dn−1 y dy
p0 (x) n
+ p 1 (x) n−1
+ · · · + pn−1 (x) + pn (x)y = f (x)
dx dx dx
where p0 (x), p1 (x), · · · , pn (x) are functions of x only.
8. A first-order linear equation has the form
dy
+ a(x)y = f (x).
dx
If f (x) is the zero function, the linear differential equation is said to be homogeneous,
otherwise we say it is non-homogeneous.

1.2 First Order Differential Equations

1. Separation of variables technique


2. Integrating factor method
3. Exact first order D.Es
4. Bernoulli equations

1.2.1 Separable Differential Equations

Solution by Integration

Simplest type of first order differential equation and is of the form


dy
= f (x).
dx
Solved by integrating both sides. This gives
Z
y(x) = f (x) dx = F (x) + c.

2
Separable equations

A first order differential equation of the form


dy
= g(x)h(y).
dx
is said to be separable or to have separable variables.
The equation may be reduced to the form
1 dy
= g(x)
h(y) dx

by dividing both sides by h(y). We now integrate both sides with respect to x and obtain
Z   Z
1 dy
dx = g(x)dx.
h(y) dx

dy 1
Example 1.2.1. Solve = .
dx 1 + x2
Solution:
Z
dx
y(x) = 2
= tan−1 x + c.
1+x
dy
Example 1.2.2. Solve = x(1 + y 2 ).
dx
Solution:
Dividing by 1 + y 2 and integrating with respect to x, we get
Z   Z Z Z
1 dy dy 1
2
dx = x dx = 2
= x dx ⇒ tan−1 y = x2 + c
y+y dx 1+y 2

where c is a constant. Therefore  


1 2
y = tan x +c .
2

1.3 Integrating factor method

Another method of solving the general first order linear non homogeneous equations is the integrat-
ing factor method. It is used to solve differential equations of the form
dy
+ a(x)y = f (x).
dx
The following steps are to be followed in using the integrating factor technique to solve first order
non homogeneous, non autonomous equations.

3
1. Rearrange the given equation as necessary to be in the form
dy
+ a(x)y = f (x).
dx
The coefficient of the derivative term must always be 1.
R
a(t)dt
2. Compute the integrating factor e .
3. Multiply both sides of the equation obtained in step 1 by the integrating factor. The result
is guaranteed to be of the form
d R R
[x(t)e a(t)dt ] = b(t)e a(t)dt
dt
4. Integrate both sides and solve for the unknown function. Make use of the initial conditions
and the fundamental theorem of calculus.
Example 1.3.1. Solve the equation y 0 = y + x2 .

Solution: Rewriting the equation as


y 0 − y = x2 , (1.1)
R
dx −x
we see that a(x) = −1, thus the integrating factor is e = e . Multiplying both sides of (1.1) by
e−x , we get
e−x (y 0 − y) = x2 e−x
or
d
ye−x = x2 e−x .

dx
Integrating both sides, we get
Z
−x
ye = x2 e−x dx + c

= c − (x2 + 2x + 2)e−x
y = ce−x − (x2 + 2x + 2).
 
dy
Example 1.3.2. Solve x + 4y = x6 .
dx

Solution: Dividing by x, we have  


dy 4
+ y = x5 .
dx x
Z Z
4 4 R 4
Hence a(x) = and so a(x)dx = dx = 4 ln x = ln x4 . Thus e a(x)dx = eln x = x4 .
x x
Multiplying by x4 , we get
 
4 dy d
+ 4x3 y = x9 , or x4 y = x9 .

x
dx dx
x10
Integrating, we have x4 y = + c. Hence
10
x6 c
y= + 4.
10 x

4
Exercise 1.3.1. Find the general solution of the following equations.
(a) 3xy 0 − y = ln x + 1 (b) (sin x)y 0 + (cos x)y = 0 (c) (3x2 + 1)y 0 − 2xy = 6x
√ dy
(d) (x2 + 1)y 0 + xy = (1 − 2x) x2 + 1 (e) x sin x + (sin x + x cos x)y = xex
dx
dy dy
(f ) sin x cos x + y = tan2 x (g) (1 + sin x) + 2(cos x)y = tan x.
dx dx

1.4 Exact Equations

Solving equations of the form


M (x, y)dx + N (x, y)dy = 0.
The total differential dg of a function of two variables g(x, y) is defined by

∂g ∂g
dg = dx + dy.
∂x ∂y
Here we use partial derivatives to solve ordinary differential equations.

Given the differential equation


M (x, y)dx + N (x, y)dy = 0. (1.2)
If we can find a function g(x, y) such that

∂g ∂g
= M, = N,
∂x ∂y

then (1.2) becomes dg = 0. In this case M dx + N dy is said to be an exact differential and (1.2)
is called an exact differential equation.

To determine if a differential equation is exact we use the cross-derivative test.

Theorem 1.4.1. The equation

M (x, y)dx + N (x, y)dy = 0

is exact if and only if


∂M ∂N
= .
∂y ∂x

If M dx + N dy is exact, then we can solve the differential equation (1.2) by finding the function g
above.

Example 1.4.1. Solve the equation

(1 − sin x tan y)dx + (cos x sec2 y)dy = 0.

5
Solution: Letting M (x, y) = 1 − sin x tan y and N (x, y) = cos x sec2 y, we have

∂M ∂N
= − sin x sec2 y = ,
∂y ∂x
∂g ∂g
so the equation is exact. We now seek a function g of two variables, such that = M and = N,
∂x ∂y
then
Z Z
g(x, y) = M dx = (1 − sin x tan y)dx
= x + cos x tan y + h(y).

The constant of integration h(y) is an arbitrary function of y since we must introduce the most
general term that varnish under partial differentiation with respect to x. But
∂g
cos x sec2 y = N (x, y) = = cos x sec2 y + h0 (y).
∂y

This means h0 (y) = 0 so h(y) = k, a constant. The general solution is

g(x, y) = x + cos x tan y + k

1.5 The Bernoulli Equation

Definition 1.5.1. A Bernoulli equation is the equation of the form


dy
+ a(x)y = f (x)y n , n 6= 0, 1. (1.3)
dx

When n = 0, 1 the Bernoulli equation becomes a linear equation.

Set z = y 1−n . Then z 0 = (1 − n)y −n y 0 . So if we multiply both sides of equation (1.3) by (1 − n)y −n ,
we obtain
(1 − n)y −n y 0 + (1 − n)a(x)y 1−n = (1 − n)f (x)
or
dz
+ (1 − n)a(x)z = (1 − n)f (x).
dx
This equation is now linear and can be solved as before.

Example 1.5.1. Solve


dy y 5
− = − x2 y 3 .
dx x 2

6
Solution: Here n = 3 so let z = y −2 . Let z 0 = −2y −3 y 0 and multiply both sides of the equation by
−2y −3 to obtain
2
−2y −3 y 0 + y −2 = 5x2
x
or
2z
z0 + = 5x2 . (1.4)
x
dx 2
R
The integrating factor for this linear equation is e2 x = e2 ln x = eln x = x2 . Multiplying both sides
of equation (1.4) by x2 , we have x2 z 0 + 2xz = 5x4 or (x2 z)0 = 5x4 . Thus
Z
x z = 5 x4 dx + c = x5 + c.
2

Hence
1
y −2 = z = x3 + cx−2 or y = (x3 + cx−2 )− 2 .

1.6 Initial Value Problems (IVPs)

If we interested in solving a first order differential equation


dy
= f (x, y)
dx
subject to the condition y = y0 when x = x0 or y(x0 ) = y0 .

This is an example of an initial value problem and the condition y(x0 ) = y0 is called an initial
condition and x0 is called the initial point.
dy
Example 1.6.1. (a) = 2y − 3x, y(0) = 2. (x = 0 is the initial point)
dx
(b) x00 (t) + 5x0 (t) + sin x(t) = 0, x(1) = 0, x0 (1) = 7. (t = 1 is the initial point)

1.7 Boundary Value Problems (BVPs)

A boundary value problem consists of a differential equation and a collection of values that must
be satisfied by the solution of the differential equation or its derivatives.
d2 y
Example 1.7.1. (a) + 5xy = cos x, y(0) = 0, y 0 (1) = 2.
dx2
dy
(b) + 5xy = 0, y(0)y(1) = 2.
dx

7
Chapter 2

Second order differential equations

A second order d.e is linear if it can be written in the form

y 00 + p(x)y 0 + q(x)y = r(x).

The equation is linear in the unknown function y and its derivatives, whereas p(x), q(x)[and] r(x)
may be any given functions of x.

Superposition principle
If y1 (x) and y2 (x) are any two solutions of a linear homogeneous differential equation

y 00 + p(x)y 0 + q(x)y = 0,

then c1 y( x) + c2 y2 (x) is also a solution to the differential equation for any constants c1 and c2 .

Proof. Exercise.

Linear independence and dependence of solutions


Suppose y1 and y2 are defined on [a, b] then they are linearly dependent if there exists c1 and c2
(c1 , c2 6= 0) such that
c1 y1 + c2 y2 = 0
otherwise they are linearly independent.

1. y1 and y2 are linearly independent if c1 y1 + c2 y2 = 0 −→ c1 and = 0.

2. y1 and y2 are linearly dependent iff one is a constant multiple of the other. i.e c1 + c2 =
0, c1 , c2 6= 0 −→ y1 = − cc12 y2 , y1 is a constant multiple of y2 .

Definition 2.0.1. A basis of y 00 + p(x)y 0 + q(x)y = 0 on an interval [a, b] is a pair y1 , y2 of linearly


independent solutions of the differential equation on the interval [a, b].

8
Example 2.0.2. Show that y1 = cos x and y2 = sin x are linearly independent solutions of the D.E.
y 00 + y = 0
Assuming everyone can show that the two are solutions of the D.E, cos x and sin x are not propor-
tional, i.e yy21 = cot x 6= constant. Hence they form a basis of the D.E for all x and a general
solution takes the form y = c1 cos x + c2 sin x..

We now look at a condition under which y1 and y2 are linearly independent.

The wronskian

Suppose the functions y1 and y2 are differentiable on [a, b], the wronskian of y1 and y2 is the
determinant
y1 (x) y2 (x)
W (x) = = y1 y20 − y10 y2
y10 (x) y20 (x)

2.1 Homogeneous second order equations with constant co-


efficients

We discuss the method of solving second order linear equations with constant coefficients.
Example 2.1.1. Determine solutions to y 00 − 9y = 0
We can get some solutions here simply by inspection. We need functions whose second derivative is
9 times the original function. One of the first functions that I can think of that comes back to itself
after two derivatives is an exponential function and with proper exponents the 9 will get taken care
of as well. So, it looks like the following two functions are solutions.

y(t) = e3x and y(x) = e−3x

In fact if you think about it any function that is in the form y(x) = c1 e3x + c2 e−3x will be a solution
to the differential equation. This example leads us to the principle of superposition.

In order to solve the linear homogeneous D.E. with constant coefficients, the general method is
as follows:

• Try a solution of the form emx . This produces the characteristic equation (a quadratic eqn in
this case) to be solved for m.

• Solve the characteristic equation.

• The general solution of the D.E is obtained from the roots of the characteristic equation.

9
• Make use of initial conditions to determine the unknown constants in the general solution.
d2 x dx
Example 2.1.2. Solve 2
= −4 − 3x
dt dt
Let x(t) = emt , then, x0 (t) = memt , x00 (t) = m2 emt , substituting in the D.E we have
m2 emt + 4memt + 3emt = 0
(m2 + 4m + 3)emt = 0, −→ (m2 + 4m + 3) = 0
m = 3 orm = −1
hence
x(t) = c1 e−3t + c2 e−t .

As we have noted, the characteristic equation is quadratic and so will have two roots, m1 and m2 .
The roots will have three possible forms. These are

1. Real, distinct roots, m1 6= m2 .


2. Complex roots, m1,2 = a ± bi.
3. Double roots,m1 = m2 = m.

2.1.1 Case 1 Real, distinct roots, m1 6= m2 .

Example 2.1.3. Solve the following IVP. y 00 + 11y 0 + 24y = 0, y(0) = 0, y 0 (0) = −7
Solution
The characteristic equation is
m2 + 11y 0 + 24y = (m + 8)(m + 3) = 0
whose roots arem1 = −8 and m2 = −3 and so the general solution is
y(t) = c1 e−8t + c2 e−3t and its derivative is
y 0 (t) = −8c1 e−8t − 3c2 e−3t
Now, plug in the initial conditions to get the following system of equations.
0 = y(0) = C1 + C2
(2.1)
−7 = y 0 (0) = −8C1 − 3C2

giving C1 = 7/5 and C2 = −7/5.


The actual solution to the differential equation is then

y(t) = 7/5e−8t − 7/5e−3t

Exercise 2.1.1. Solve the following initial value problems

1. y 00 + 3y 0 − 10y = 0 y(0) = 4, y 0 (0) = 2.


2. 3y 00 + 2y 0 − 8y = 0 y(0) = −6, y 0 (0) = −18.
3. 4y 00 − 5y 0 = 0 y(−2) = 0, y 0 (2) = 7.

10
2.1.2 Case 2 Complex roots, m1,2 = a ± bi.

Consider the D.E


ay 00 + by 0 + cy = 0
whose characteristic equation is am2 + bm + c = 0, whose roots are complex in the form
m1,2 = λ ± µi
Now, recall that we arrived at the characteristic equation by assuming that all solutions to the
differential equation will be of the form y(t) = emt .
Plugging our two roots into the general form of the solution gives the following solutions to the
differential equation. y1 (t) = eλ+µi , y2 (t) = eλ−µi
Recall Euler’s formula
eiθ = cos θ + i sin θ.
A nice variant of Euler’s formula that we also need is
e−iθ = cos(−θ) + i sin(−θ) = cos θ − i sin θ.
Now, split up our two solutions into exponentials that only have real exponents and exponentials
that only have imaginary exponents. Then use Euler?s formula, or its variant, to rewrite the second
exponential.
y1 (t) = eλ+µi = eλt (cos(µt) + i sin(µt))
y2 (t) = eλ−µi = eλt (cos(µt) − i sin(µt))
This does not eliminate the complex nature of the solutions, but it does put the two solutions
into a form that we can eliminate the complex parts. Recall from superposition/linearity principle,
that the general solution can be written as a combination of the two solutions in other words
y(t) = C1 y1 (t) + C2 y2 (t) will also be a solution. Using this, note that if we add the two solutions
together we will arrive at
y1 + y2 = 2eλt cos(µt).
This is a real solution and just to eliminate the 2 let’s divide everything by 2.
Thus U (t) = 1/2y1 (t)+1/2y2 (t) = eλt cos(µt). Note that this is equivalent to taking C1 = C2 = 1/2.

Now we can arrive at a second solution in a similar manner. This time let’s subtract the two original
solutions to arrive at
y( t) − y2 (t) = 2ieλt sin µt
On the surface this doesn’t appear to fix the problem as the solution is still complex. However,
upon learning that the two constants, c1 and c2 can be complex numbers we can arrive at a real
solution by dividing this by 2i. This is equivalent to taking c1 = 2i1 and c2 = −1
2i
.
Our second solution will be
1 1
V (t) = y1 (t) − y2 (t) = eλt sin(µt)
2i 2i
and we now have two solutions to the D.E.

So if the roots of the characteristic equation happen to be m1,2 = λ ± µi, the general solution to
the D.E is
y(t) = C1 eλt cos µt + C2 eλt sin(µt).

11
Example 2.1.4. Solve the I.V.P y 00 − 4y 0 + 9y = 0, y(0) = 0, y 0 (0 = −8) √
The characteristic equation for this D.E is m2 − 4m + 9 = 0 whose roots are m1,2 = 2 ± i 5.
The general solution to the D.E is then
√ √
y(t) = C1 e2t cos( 5t) + C2 e2t sin( 5t)
−8 √
After applying initial conditions show that √ e2t sin( 5t)
5
Exercise 2.1.2. Solve

1. y 00 − 8y 0 + 17y = 0, y(0) = −4, y 0 (0) = −1

2. 4y 00 + 24y 0 + 37y = 0, y(π) = 1, y 0 (π) = 0

2.1.3 Case 3 Repeated roots,m1 = m2 = m.

Consider the D.E


ay 00 + by 0 + cy = 0
whose characteristic equation is am2 + bm + c = 0, whose roots are complex in the form

m1 = m2 = m

. This leads to a problem however. Recall that the solutions are

y1 (t) = em1 t = emt , y2 (t) = em2 t = emt

These are the same solution and will NOT be ”good enough” to form a general solution. Lets get
out of our way a bit.

From the quadratic formula we know that the roots to the characteristic equation are

−b ± b2 − 4ac
m1,2 =
2a
In this case, since we have double roots we must have b2 − 4ac = 0. This is the only way we can
get double roots and in this case the roots will be m1,2 = −b 2a
so the one solution that we have got
bt
− 2a
is y1 (t) = e .
To find a second solution we will use the fact that a constant times a solution to a linear homogeneous
differential equation is also a solution. If this is true then maybe we will get lucky and the following
will also be a solution
bt
y2 (t) = v(t)y1 (t) = v(t)e− 2a
with a proper choice of v(t). To determine if this in fact can be done, let us plug this back into the
differential equation and see what we get. We will first need a couple of derivatives.
bt b − bt
y2 (t) = v 0 e− 2a − ve 2a
2a
12
bt b 0 − bt b bt b2 bt
y200 = v 00 e− 2a − v e 2a − e− 2a + 2 ve− 2a
2a 2a 4a
2
bt b bt b bt
= v 00 e− 2a − v 0 e− 2a + 2 ve− 2a
a 4a
Now plugging these into the D.E
bt b bt b2 bt bt b bt bt
a(v 00 e− 2a − v 0 e− 2a + 2 ve− 2a ) + b(v 0 e− 2a − ve− 2a ) + c(ve− 2a = 0
a 4a 2a
We can factor out an exponential out of all the terms. Collecting all the coefficients of v and its
derivatives.
bt b2 b2
e− 2a (av 00 + (−b + b)v 0 + ( − + c)v) = 0
4a 2a
bt b2
e− 2a (av 00 + (− + c)v) = 0
4a
bt 1
e− 2a (av 00 − (b2 − 4ac)v) = 0
4a
Now, because we are working with a double root we know that that the second term will be zero.
bt
Also exponentials are never zero. Therefore, y2 (t) = v(t)y1 (t) = v(t)e− 2a will be a solution to the
differential equation provided v(t) is a function that satisfies the following differential equation.
av 00 = 0 or v 00 = 0
Note that we can drop a because it cannot be zero otherwise we would not have the second order
D.E. Z Z
0 00
v = v dt = c, v(t) = v 0 dt = ct + k.

Thus the two solutions are then


bt bt
y1 (t) = e− 2a , y2 (t) = (ct + k)e− 2a
Thus
bt bt bt bt
y(t) = C1 e− 2a + C2 (ct + k)e− 2a = (C1 + C2 k)e− 2a + C2 cte− 2a .
Notice that we rearranged things a little. Now, c, k, c1 , and c2 are all unknown constants so any
combination of them will also be unknown constants. In particular, c1 + c2 k and c2 c are unknown
constants so we will just rewrite them as follows.
bt bt
y(t) = c1 e− 2a + c2 te− 2a
So if the roots of the characteristic equation are m1 = m2 = m, then the general solution is
y(t) = c1 emt + c2 temt .
Example 2.1.5. Solve the I.V.P y 00 − 4y 0 + 4y = 0, y(0) = 12, y 0 (0) = −3
Show that the general solution is y(t) = c1 e2t + c2 te2t and hence y(t) = 12e2t − 27te2t
Exercise 2.1.3. Solve

9
1. 16y 00 − 40y 0 + 25y = 0, y(0) = 3, y 0 (0) = −
4
2. y 00 + 14y 0 + 49y = 0, y(−4) = −1, y 0 (−4) = 5

13
2.2 Homogeneous second order equations with non-constant
coefficients

2.2.1 Reduction of Order

Finding solutions to non-constant coefficient, second order D.Es of the form

p(t)y 00 + q(t)y 0 + r(t)y = 0 (2.2)

In general, finding solutions to these kinds of differential equations can be much more difficult than
finding solutions to constant coefficient differential equations. Reduction of order requires that a
solution be known. Without this known solution we will not be able to do reduction of order.
A procedure exists for finding the second solution y2 when the other solution y1 is known.

We assume that y1 is a non-zero solution of (2.2) and seek another solution y2 such that y1 and y2
are linearly independent. Since, y1 and y2 are linearly independent, y2 6= ky1 , for any constant k.
y2
So = v(x) must be a non constant function of x and y2 = vy1 must satisfy (2.2). Thus
y1

(vy1 )00 + a(vy1 )0 + b(vy1 ) = 0.

But
(vy1 )0 = vy10 + v 0 y1
and
(vy1 )00 = (vy10 + v 0 y1 )0 = vy100 + v 0 y10 + v 00 y10 + v 00 y1 = vy100 + 2v 0 y10 + v 00 y1 .
Then
(vy100 + 2v 0 y10 + v 00 y1 ) + a(vy1 + v 0 y1 ) + bvy1 = 0
or
v(y100 + ay1 + by1 ) + v 0 (2y10 + ay1 ) + v 00 y1 = 0.
The first term vanishes, since y1 is a solution of (??), so we obtain

v 00 y1 + v 0 (2y10 + ay1 ) = 0.

Dividing by v 0 y1 ,
v 00 2y10
= − − a.
v0 y1
Let z = v 0 , then z 0 = v 00 and
z0 2y 0
= − 1 − a,
z y1
which is a separable first order equation. Thus we have reduced the order of our equation.
Integrating with respect to x to obtain
Z
ln z = −2 ln y1 − a(x)dx.

14
Exponentiating, we have
R 1 − R a(x)dx
z = eln z = e−2 ln y1 − a(x)dx
= e .
y12
But since z = v 0 ,
1 − R a(x)dx
v0 = e .
y12
To find v, we perform another integration and obtain
Z − R a(x)dx
e
y2 = y1 v = y1 (x) dx.
y12 (x)

Example 2.2.1. Find the general solution to 2t2 y 00 + ty 0 − 3y = 0 given that t−1 is a solution.
Once we have a first solution we will then assume that a second solution will have the form

y2 (t) = v(t)y1 (t)

for a proper choice of v(t). To determine the proper choice, we plug the guess into the differential
equation and get a new differential equation that can be solved for v(t). So, let’s do that for this
problem. Here is the form of the second solution as well as the derivatives that we’ll need.

y2 (t) = t−1 v(t), y20 (t) = −t−2 v + t−1 v 0 , y200 (t) = 2t−3 v − 2t−2 v 0 + t−1 v 00

Plugging these into the D.E. gives

2t2 (2t−3 v − 2t−2 v 0 + t−1 v 00 ) + t(−t−2 v + t−1 v 0 ) − 3(t−1 v(t) = 0

Rearranging and simplifying gives

2tv 00 + (−4 + 1)v 0 + (4t−1 − t−1 − 3t−1)v = 0

2tv 00 − 3v 0 = 0
Note that upon simplifying, the only terms remaining are those involving the derivatives of v. The
term involving v drops out. If you’ve done all of your work correctly this should always happen.
Sometimes, as in the repeated roots case, the first derivative term will also drop out. So in order
for y2 (t) = v(t)y1 (t) to be a solution then v must satisfy

2tv 00 − 3v 0 = 0 (2.3)

This appears to be a problem. In order to find a solution to a second order non-constant coefficient
differential equation we need to solve a different second order non-constant coefficient differential
equation. However, this isn’t the problem that it appears to be. Because the term involving the v
drops out we can actually solve (2.3) and we can do it with the knowledge that we already have at
this point. We will solve this by making the following change of variable.

w = v0, w0 = v 00

with this change of variable, (2.3) becomes

2tw0 − 3w = 0

15
and this is a linear, first order D.E. that we can solve. This also explains the name of this method.
We’ve managed to reduce a second order differential equation down to a first order differential
equation.
3
w(t) = Ct 2
Recall our change of variable
v0 = w
with this we can easily solve for v(t)
Z Z
3 2 5
v(t) = wdt = Ct 2 = Ct 2 + k
5
This is the most general possible v(t) that we can use to get a second solution. So, just as we did
in the repeated roots section, we can choose the constants to be anything we want so choose them to
clear out all the extraneous constants. In this case we can use
5
C= , k=0
2
Using these gives the following for v(t) and for the second solution.
5
v(t) = t 2
5 3
y2 (t) = t−1 (t 2 ) = t 2
The general solution will then be
3
y(t) = C1 t−1 + C2 t 2 .
Exercise 2.2.1. Find the general solution to

t2 y 00 + 2ty 0 − 2y = 0

given that y1 (t) = t is a solution.

2.3 Non-homogeneous Second order linear equations

2.3.1 Method of undetermined coefficients

Consider the non-homogeneous linear second order differential equation given by

y 00 + p(x)y 0 + q(x)y = r(x) (2.4)

with constant coefficients p(x) and q(x). The method of undetermined coefficients is used to
find particular solutions to a given non-homogeneous linear second order differential equation, with
r(x) being

(a) a polynomial including constants.

16
(b) a constant multiplied by the sine and cosine function and their linear combination.
(c) exponential functions.
(d) linear combination of functions in (a),(b) and (c).

f (x) Appropriate form of yp


1 or any constant A
ax + b Ax + B
2
ax + bx + c Ax2 + bx + C
sin kx A sin kx + B cos kx
cos kx A sin kx + B cos kx
aekx Aekx
(ax + b)ekx (Ax + B)ekx
x2 ekx (Ax2 + Bx + C)ekx
ekx sin mx Aekx sin mx + Bekx cos mx

The following steps are used to find the solution of the equation (2.4)

1. First find the general solution of the corresponding homogeneous equation yc .


2. Find the solution of the non-homogeneous equation, call this yp .
3. The general solution of the original non-homogeneous equation is then y = yc + yp .
Example 2.3.1. Solve y 00 + 3y 0 + 2y = 1 + 6x
Solution
We first find the complimentary solution yc which is the general solution to the homogeneous D.E.
y 00 + 3y 0 + 2y = 0
The characteristic equation is
m2 + 3m + 2 = 0 giving us (m + 2)(m + 1) = 0 impliying m1 = −2, m2 = −1
which leads to the solution
yc = c1 e−2x + c2 e−x
Now we want to find the particular solution yp . Since r(x) is a polynomial of order 1, choose
yp = A + Bx, yp0 = B, yp00 = 0
Substituting into the original equation we have
0 + 3B + 2(A + Bx) = 1 + 6x
3B + 2A = 1
2B = 6
B=1 (2.5)
9 − 1 = −2A
A = −4
yp = −4 + 3x
y = yc + yp = c1 e−2x + c2 e−x − 4 + 3x

17
Example 2.3.2. Solve y 00 + 6y 0 + 9y = 27x2 , y(0) = 2, y 0 (0) = 1
Solution
For the homogeneous equation, the characteristic equation is

m2 + 6m + 9 = 0, (m + 3)(m + 3) = 0 hence m = −3 twice

yc = c1 e−3x + c2 xe−3x
For the particular solution choose
yp = A + Bx + Cx2
yp0 = B + 2Cx (2.6)
yp00 = 2C
Substitute in the original equation we have

2C + 6(B + 2Cx) + 9(A + bx + Cx2 ) = 27x2


2C + 6B + 9A = 0
12C + 9B = 0
(2.7)
9C = 27, implying C = 3
B = −4 and A = 2
yp = 2 − 4x + 3x2

y(x) = c1 e−3x + c2 xe−3x + 2 − 4x + 3x2 .


Now make use of initial conditions to find c1 and c2 .

Example 2.3.3. Solve y 00 + 4y = 8e−2t , y(0) = 0, y 0 (0) = 2


Solution
For the complimentary solution, m = ±2i

yc = c1 cos(2t) + c2 sin(2t)

Choose
yp = M e−2t , such that yp0 = −2M e−2t , yp00 = 4M e−2t
Substitute in D.E we have

4M e−2t + 4M e−2t = 8e−2t , hence M = 1

y = c1 cos(2t) + c2 sin(2t) + e−2t


Applying initial conditions
y(t) = 2 sin 2t − cos 2t + e−3t

Note that r(x) is a trig function e.g. y 00 − 4y = 13 cos 3x, then choose yp = A cos 3x + B sin 3x
If r(x) takes a combination of polynomials and trig functions, also choose yp as a combination of
those.

18
2.3.2 Method of variation of parameters

The technique of undetermined coefficients has severe limitations. It can only be used when the
coefficients p(x) and q(x) are constants, and even then, it only works if r(x) takes a particular
simple form. We now develop a more powerful method that always works regardless of the nature
of p, q, and r, provided the general solution of the corresponding homogeneous equation

y 00 + p(x)y 0 + q(x)y = 0 is already known.

We assume that in some way, the general solution of the corresponding homogeneous equation has
been found. Lets say
y(x) = c1 y1 (x) + c2 y2 (x) (2.8)
We then replace c1 and c2 by unknown functions v1 (x) and v2 (x) and attempt to determine v1 and
v2 in such a manner that
y = v1 y1 + v2 y2 (2.9)
will be a solution to
y 00 + p(x)y 0 (x) + q(x)y(x) = r(x). (2.10)
With two unknown functions (v1 and v2 ) to find, we need two equations relating these functions.
One of these is obtained by requiring that (2.9) be a solution to (2.10). We will later see what the
second equation should be. We begin by computing the derivative of (2.9) arranged as follows:

y 0 = (v1 y10 + v2 y20 ) + (v10 y1 + v20 y2 ) (2.11)

Another differentiation will introduce second derivatives of unknowns v1 and v2 . We avoid the
second expression of (2.11) by letting

v10 y1 + v20 y2 = 0 (2.12)

This leads to
y 0 = v1 y10 + v2 y20 (2.13)
00
y = v1 y100 + v10 y10 + v2 y200 + v20 y20 (2.14)
Substituting (2.9), (2.13) and (2.14) into (2.10) and rearranging we get

v1 (y100 + py10 + qy1 ) + v2 (y200 + py20 + qy2 ) + v10 y10 + v20 y20 = r(x) (2.15)

Since y1 and y2 are solutions to the homogeneous equation, we have

v10 y10 + v20 y20 = r(x) (2.16)

Taking (2.12) and (2.16), we have two equations in 2 unknowns v10 and v20 i.e

v10 y1 + v20 y2 = 0
(2.17)
v10 y10 + v20 y20 = r(x)

v10 y20 −y2


    
1 0
=
v20 y1 y2 −y10 y1 r(x)
y10 y20

19
This gives
−y2 r(x) y1 r(x)
v10 = and v20 = (2.18)
W (y1 , y2 ) W (y1 , y2 )
The above formulae are legitimate, for the Wronskian is non-zero by the linear independence of y1
and y2 .
Next we integrate (2.18) to find v1 and v2
−y2 r(x)
Z Z
y1 r(x)
v1 = dx and v2 = dx
W W
Putting everything together we have
−y2 r(x)
Z Z
y1 r(x)
y = y1 dx + y2 dx
W W
is the particular solution to (2.10).
Example 2.3.4. Find the general solution to y 00 + y = tan x

Solution
The complimentary function is
yc = c1 cos x + c2 sin x
Set up yp = v1 cos x + v2 sin x

yp0 = v10 cos x − v1 sin x + v20 sin x + v2 cos x


but v10 cos x + v20 sin x = 0
hence yp0 = −v1 sin x + v2 cos x
yp00 = −v10 sin x − v1 cos x + v20 cos x − v2 sin x
Substituting in y 00 + y = tan x we have
−v10 sin x − v1 cos x + v20 cos x − v2 sin x + v1 cos x + v2 sin x = tan x
−v10 sin x + v20 cos x = tan x
Thus we have
v10
    
cos x sin x 0
=
− sin x cos x v20 tan x
cos x sin x
In this case the Wronskian W = =1
− sin x cos x
2 cos2 x−1
v10 = − sin x1 tan x = sin x
= = cos x − sec x
0
cos x cos x (2.19)
v2 = cos x tan x = sin x
Integrating we have
v1 = sin x − ln | sec x + tan x|
(2.20)
v2 = − cos x
Thus
y(x) = c1 cos x + c2 sin x − cos x ln | sec x + tan x|

20
Exercise 2.3.1. Solve

1. y 00 + 5y 0 + 6y = x2 + 2x
ex
2. y 00 − 2y 0 + y = x
, y(1) = 0, y 0 (1) = 0

21
Tutorial 2.3.1. Answer all questions

d2
1. Solve the equation dt2
A(t) = 6t + 8 with A(0) = 4 and A0 (0) = 9.
2
2. Suppose dtd 2 x(t) = −4x(t) + e−t . What is the solution of the equation if the initial displacement
is 1 and the initial velocity is 0?

3. Find the general solution of the equation A00 (t) + A(t) = et .

4. Find the general solution of the equation A00 (t) + A(t) = sint
d2
5. Solve the equation dt2
x(t) + 9x(t) = 5 with initial conditions x(0) = 1 and x0 (0) = 0.
d2
6. Solve the equation dt2
x(t) + 9x(t) = t2 + t with initial conditions x(0) = 1 and x0 (0) = 0.
d
7. Solve the equation dt
x(t) = 4x(t) + t using the method of undetermined coefficients.
2
8. Solve dtd 2 x(t) = −4x(t) + sin2t. Hint: For the undetermined coefficients method try Atcos2t +
Btsin2t.

9. Using the method of variation of parameters, solve the following


ex
(a) y 00 + 5y 0 + 6y = x2 + 2x (b) y 00 − 2y 0 + y = x
, y(1) = 0, y 0 (1) = 1

10. Consider the following equation


2 2
y 00 − y 0 + 2 y = x sin x, x ∈ [0, ∞)
x x
Given that y1 (x) = x and y2 (x) = x2 are linearly independent solutions of the homogeneous
equation on (1, ∞), find the particular solution using the method of variation of parameters.

22

You might also like