Solving Ordinary Differential Equations

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Solving Ordinary Differential Equations

It is expected that you can solve first order ODEs by separation of variables and by
substitution, and that you can solve linear, constant-coefficient second order ODEs (by
finding the complementary function and the particular integral). These techniques are
very important and before the course starts you should make sure that you are very
familiar with them. The theory of solving such ODEs is covered in many standard texts,
such as ‘Advanced Engineering Mathematics’ by Kreyszig (published by Wiley) or the
Schaum Outline Series ‘Differential Equations’ by Bronson. It is also covered in the OU
undergraduate course MST209 (and its predecessors MST207 and MST204). If you feel
that you are happy with the general procedures, then you could try working through the
questions given here. These are relatively hard questions, and each question has been
chosen to make a particular point, such as the use of ln c in Question 1. Even if you
know you can answer the questions it might still be worth reading through my answers.

Find the general solutions of the following differential equations:


dy
1. xy = y 2 + 1;
dx
dy 2
2. y = ex+y ;
dx
d2 y
3. − 4y = x2 + e3x ;
dx2
d2 y
4. + 4y = sin(2x);
dx2
dy y y
 
5. = − tan (hint: use the substitution y = ux where u is a function of x);
dx x x
d2 y dy
6. 4x2 + 4x − y = 0 (hint: use the substitution x = et );
dx2 dx
d4 y
7. − 4y = 8.
dx4
(And I know that the final question is a fourth-order ODE and that you might not have
come across one of these before; you could make an intuitive guess about how the answer
might proceed, however.)

1
Answers
Z
y Z
1
1. Separating the variables and integrating gives dy = dx so that
y2 + 1 x
1
ln(y 2 + 1) = ln x + ln c,
2
where c is a constant and we use ln c for the constant of integration to make
subsequent manipulations easier. Hence ln(y 2 + 1) = ln(xc)2 so that

y = ± (dx2 − 1),

where d is a constant (equal to c2 ). Note that with a theoretical question such as


this we would assume that the solution holds, namely that the square root in this
case can actually be taken. If we know something about any physical situation
being modelled then we might be able to take the solution further, perhaps by
restricting y to be positive, for example.
dy 2
2. We can write the differential equation as y = ex ey so that on separating the
Z Z dx
2
variables we get ye−y dy = ex dx.
Z
For the left-hand integral we use the standard result f 0 (x)ef (x) dx = ef (x) to ob-
tain
1 2
− e−y = ex + c,
2
√ x
so that y = ± (− ln(−2e + d)) (for c and d both constants).

3. The auxiliary equation is m2 − 4 = 0 which has solutions m = ±2 and so the


complementary function is y = Ae2x + Be−2x (A and B both constants) or y =
C sinh(2x) + D cosh(2x) (C and D both constants). (Either form is perfectly
acceptable as a solution; in M820 you will often find that the latter form is easier
to manipulate in specific situations. If you haven’t seen this form before, have a
think about how sinh x and cosh x are defined.)
For the particular solution try y = ax2 + bx + c + de3x so that y 00 = 2a + 9de3x and
on substituting these into the original differential equation we obtain

2a + 9de3x − 4(ax2 + bx + c + de3x ) = x2 + e3x .

On equating coefficients we get 9d − 4d = 1 so that d = 1/5, −4a = 1 so that


a = −1/4, 2a − 4c = 0 so that c = −1/8, and b = 0. Hence the general solution is
1 1 1
y = C sinh(2x) + D cosh(2x) − x2 − + e3x .
4 8 5

4. Here the auxiliary equation has roots m = ±2i and so the complementary function
is y = A sin(2x) + B cos(2x), for A and B both constants. Since the right-hand
side of the differential equation, i.e. sin(2x), occurs in the complementary function

2
then the standard ‘guess’ for the particular integral of y = a sin(2x) + b cos(2x)
will fail (if you don’t believe me, try it). So instead we multiply by x and try
y = ax sin(2x) + bx cos(2x) (and note that we DO need the cos term, as b will turn
out to be non-zero). So, y 0 = a sin(2x) + 2ax cos(2x) + b cos(2x) − 2bx sin(2x) and
y 00 = 2a cos(2x) + 2a cos(2x) − 4ax sin(2x) − 2b sin(2x) − 2b sin(2x) − 4bx cos(2x).
Substituting these into the original differential equation and equating coefficients
gives, for sin(2x), −2b−2b = 1; for cos(2x), 2a+2a = 0; for x sin(2x), −4a+4a = 0
and for x cos(2x), −4b + 4b = 0. So a = 0, b = −1/4 and
x
y = A sin(2x) + B cos(2x) − cos(2x).
4
Note that for a different differential equation a would not necessarily be zero - can
you see how a equals zero in this case?

5. We want to solve the equation


dy y y
 
= − tan . (1)
dx x x
This is not separable, so it can’t be solved by separation of variables. However,
notice that dy/dx is a function of y/x, and so this leads us to consider a substitution
of the form y/x = u(x) or y = xu(x). What we hope to do is find the function
u(x); then the solution to (1) will be y(x) = xu(x).

So let y = xu (where we drop the explicit dependence on x of y and u, but we


remember that it’s there). Then the product rule for differentiation gives y 0 =
xu0 + u, the prime denoting differentiation with respect to x. Substituting this,
along with y = xu, into (1) gives xu0 + u = u − tan u so that the original differential
equation has transformed into
du
x = − tan u.
dx
This can be solved by separating the variables:
Z
cos u Z
1
du = − dx
sin u x
so that ln(sin u) = − ln x + ln c = ln(c/x), where c is an arbitrary (positive) con-
stant. Hence u = arcsin(c/x), and so the solution to (1) is

y = x arcsin(c/x).

6. Here we look at an example of an important type of second-order differential equa-


tion, called Euler’s equation, which takes the general form

d2 y dy
a2 x 2 2
+ a1 x + a0 y = f (x),
dx dx
where the ai are known constants.

3
Consider the equation
d2 y dy
4x2 2
+ 4x − y = 0, (2)
dx dx
which is an example of Euler’s equation. The substitution needed (and one which
you should be able to remember, having identified the equation as Euler’s) is x = et .
In order to use the substitution, note that
dy dy dt dy
= = e−t
dx dt dx dt
and that
d2 y d2 y
! ! !
d −t dy d dy dt d dy −t dy
= e = e−t = e−t e = e−2t 2 − e−2t .
dx2 dx dt dt dt dx dt dt dt dt

d2 y
Substituting these into (2) and simplifying results in 4 − y = 0, the general
dt2
solution of which is y = Aet/2 + Be−t/2 , where A and B are arbitrary constants.
Hence the general solution of (2) is
√ B
y =A x+ √ .
x
√ √
7. Here the auxiliary equation is m4 − 4 = √0, which has√ solutions
√ m = ± 2, ±
√ 2i.
So the complementary function is y = Ae 2x + Be− 2x + C sin( 2x) + D cos( 2x),
where A, B,√ C and D are constants.
√ Alternatively
√ this solution
√ may be written as
y = A sinh( 2x) + B cosh( 2x) + C sin( 2x) + D cos( 2x), where A and B are
still constants, just not the same as the A and B before.
For the particular integral, let y = a. Then y (iv) = 0 and so −4a = 8. Hence the
general solution is
√ √ √ √
y = A sinh( 2x) + B cosh( 2x) + C sin( 2x) + D cos( 2x) − 2.

Cath Wilkins
January 19 2008

You might also like