Differential Equations Part2
Differential Equations Part2
Homogeneous equations
These are equations which can be written as
dy y
=f .
dx x
Often the right hand side will be a quotient of polynomials in x and y, where each term has the
same degree, such as:
x3 − x2 y
.
xy 2 + 2y 3
y = ux.
1
Example 1. The equation to be solved is
dy y 2 − 2x2
=
dx x2
which can be written as
dy y2
= 2 − 2.
dx x
This is neither linear nor separable, but it is homogeneous. So making the substitution u = y/x:
du
x + u = u2 − 2.
dx
Separating the variables:
1 1
du = dx
u2 −u−2 x
The left hand side will need to be expanded into partial fractions:
1 1
=
u2 −u−2 (u − 2)(u + 1)
1 1 1 1
= −
3u−2 3u+1
and so when we integrate both sides, we obtain:
1
(ln(u − 2) − ln(u + 1)) = ln(x) + C.
3
Now we need a bit of algebra to tame this result. First multiply by 3:
ln(u − 2) − ln(u + 1) = 3 ln x + C
2
Second order equations
A second order differential equation is one which includes a second derivative. We shall look
only at linear equations with constant coefficients; equations which look like this:
d2 y dy
a 2
+b + cy = f (x)
dx dx
where a, b and c are all constants. If f (x) = 0, then the equation is said to be homogeneous1 .
3
Example 3. Solve the equation
d2 y dy
2
−5 + 6y = 0.
dx dx
The characteristic equation is
k 2 − 5k + 6 = 0
which can be solved (by factorization, quadratic formula, whatever you like), to obtain
k = 2, k = 3.
y = Ae2x + Be3x .
k2 + k − 2 = 0
y = Aex + Be−2x .
A + B = 2.
y 0 = Aex − 2Be2x
A − 2B = 5.
A+ B =2
A − 2B = 5
for which the solutions are A = 3 and B = −1. So the solution of the original IVP is
y = 3ex − e−2x .
4
More on the characteristic equation
We know that quadratic equations don’t necessarily have two real and distinct solutions. Some-
times the solution may be equal; other times they might be complex numbers.
These different types of solutions are reflected in the solutions of the differential equation.
5
Solution of non-homogeneous equations
Now we look at what happens if we have a function f (x) other than zero on the right hand side,
such as
d2 y dy
2
−5 + 6y = x2 .
dx dx
Solving such an equation requires two steps:
1. First solve the homogeneous equation
d2 y dy
2
−5 + 6y = 0.
dx dx
Call this result the homogeneous solution, and denote it h(x).
2. Find any function which satisfies the non-homogeneous equation, and call this the partic-
ular solution, or p(x).
Have found these two functions, the solution of the equation is
y = h(x) + p(x).
We know how to find h(x)—just use the characteristic equation—but we don’t know how to find
p(x). The method we will use is called the method of undetermined coefficients. Basically we
“guess” at the form of the particular solution, and substitute it into the equation to determine
any unknown coefficients.
6
Guessing the particular solution
Guessing the particular solution depends not only on the form of f (x), but also on the form of
the homogeneous solution h(x). For example, consider the equation
d2 y dy
2
−5 + 6y = e4x .
dx dx
Here the homogeneous solution is
p(x) = ae4x
d2 y dy
−5 + 6y = e3x .
dx2 dx
We can’t try
p(x) = ae3x
as e3x is already part of the homogeneous solution, and will just collapse down to zero. Here we
need to use
p(x) = axe3x
instead.
And for the equation
d2 y dy
2
−6 + 9y = e3x .
dx dx
which we have seen to have homogeneous solution
So we can’t use either xe3x or axe3x in the particular solution. We have to go up another power
of x and try
In general the particular solution will have a form similar to that of f (x), as the following table
7
shows.
A complete solution
So, suppose we have a second-order non-homogeneous initial value problem. How do we find
the solution? There will be several steps:
4. Substitute the initial values into y and its derivative to obtain the values of the coefficients.
k 2 − 5k + 4 = 0
2. Since the right hand function f (x) is part of the homogeneous solution, we need to try
p(x) = axe4x
8
for a particular solution. Then:
3ae4x = 6e4x
p(x) = 2xe4x .
2 = A + B.
−5 = A + 4B + 2.
A = 5, B = −3
Systems of equations
Differential equations often occur in systems, such as this:
dx
= 1.5x − xy
dt
dy
= −3y + xy.
dt
This particular system represents a predator-prey model, where x(t) and y(t) represent the
numbers of prey and predators respectively at time t.
9
We will look only at linear systems, of which a 2 × 2 system has the form:
x0 = ax + by (1)
0
y = cx + dy (2)
where a, b, c and d are all constants. There are methods of solving such systems which start
from writing them in matrix form:
0
x a b x
=
y0 c d y
but we can in fact solve a 2 × 2 linear system without matrices. Start by differentiating each
equation in the system:
x00 = ax0 + by 0 (3)
00 0 0
y = cx + dy . (4)
Now substitute equation 2 into equation 3:
x00 = ax0 + b(cx + dy). (5)
However, from equation 1 we have
x0 − ax
y= (6)
b
which we can now substitute into equation 5:
x0 − ax
00 0
x = ax + b cx + d
b
0 0
= ax + bcx + d(x − ax)
= (a + d)x0 + (bc − ad)x.
This can be rewritten as a homogeneous second-order equation in x:
x00 − (a + d)x0 + (ad − bc)x = 0.
10
Solution of differential equations using a power series
Solving a differential equation, as we have seen, usually requires an integration somewhere.
But as we have also seen, many functions can’t be integrated in terms if simple functions. So
producing a solution to a differential equation can also be done in terms of a power series.
11
Bessel Functions. These are the solutions to the differential equation
d2 y dy
x2 +x + (x2 − n2 )y = 0.
dx2 dx
This equation in fact gives rise to many different functions, which are used in such applications
as vibrating membranes, or heat conduction in a cylinder, and lots of others.
If n is an integer, then we can define
∞
X (−1)k x n+2k
Jn (x) =
k!(n + k)! 2
k=0
(There are also definitions for Jn (x) when n is not an integer, but they are slightly more com-
plicated.) In this case the function Jn (x) is called a Bessel function of the first kind of order
n.
Airy functions. These are the solutions of the second order differential equation
d2 y
− xy = 0
dx2
and arise naturally in many problems involving optics. One such function is denoted Ai(x) and
can be defined as:
1 3 1·4 6 1·4·7 9
Ai(x) = Ai(0) 1 + x + x + x + ···
3! 6! 9!
0 2 4 2 · 5 7 2 · 5 · 8 10
+ Ai (0) x + x + x + x + ···
4! 7! 10!
where the values Ai(0) and Ai0 (0) would be given as initial conditions to the differential equation.
Exercises
1. Solve the second-order equations:
(a) y 00 − y 0 − 6y = 0 (b) y 00 + 2y 0 − 15y = 0 (c) y 00 − 10y 0 + 25y = 0
12
(a) y 00 − y 0 − 6y = 4e2x , p(x) = ae4x
6. Use power series to solve y 0 = x2 y. The equation can easily be solved by separating
variables. Find the solution and represent it as a power series. Compare the solutions.
(Hint: While solving via power series, expand the series to n = 12 )
7. Show that
x 1 −3t 4 2t
=A e +B e
y −1 1
is the general solution of the system
x0 = x + 4y
y 0 = x − 2y.
8. Show that
x 1 −2t 3 5t
=A e +B e
y −2 1
is the general solution of the system
x0 = 4x + 3y
y 0 = 2x − y.
13
Answers
1. (a) y = Ae3x + Be−2x , (b) y = Ae−5x + Be3x , (c) y = Ae5x + Bxe5x ,
(d) y = Ae−4x + Bxe−4x , (e) y = e−x (A cos(2x) + B sin(2x)),
(f) y = e3x (A cos(4x) + B sin(4x))
2. (a) y = 3e3x + 7e−2x , (b) y = e−5x + 3e3x , (c) y = 3e5x − 16xe5x , (d) y = 2e−4x + 11xe−4x ,
(e) y = e−x (cos(2x) − 2 sin(2x)), (f) y = e3x (3 sin(4x) − 4 cos(4x))
6. Direct solution
x3
y = Ce 3
Series solution
∞
x x2 x3 X x3 x3
a0 + a0 + a0 + a0 + · · · = a0 = a0 e 3
3 18 162 3n n!
n=0
14