Introduction to Differential Equations

1
Introduction to Differential Equations
A differential equation is an equation that involves the derivative of some unknown
function. For example, consider the equation
f 0 (x) = 4x3 .
(1)
This equation tells us information about the derivative f 0 (x) of some function f (x),
but it doesn’t actually give us a formula for f (x).
Of course, in this example, it’s not too hard to figure out what f (x) might be. If
the derivative of f (x) is 4x3 , then one possibility is that
f (x) = x4 .
This formula is a solution to the differential equation, because it matches the information about f 0 (x) that we were given.
Most differential equations have more than one solution. For example,
f (x) = x4 + 2
and
f (x) = x4 + 5
are also solutions to equation (1), since the derivative of either of these is equal to 4x3 .
More generally, any formula of the form
f (x) = x4 + C
Really
Z all we’ve done here is integrate,
i.e. 4x3 dx = x4 + C.
(2)
is a solution, where C can be any constant, and every possible solution has this form.
Thus, this formula is the general solution to equation (1).
The general solution to a differential equation usually involves one or more arbitrary
constants.
Because of this, most differential equations have infinitely many different
solutions, with one solution for every possible value of the constant(s).
Notation
Letters other than y are often used in
applications.
When writing differential equations, it is common to use the letter y for the function,
instead of the letter f . Thus, equation (1) would be written
y 0 (x) = 4x3 .
It is common in applications to use
the variable t (for time) in place of x.
In this case, the derivative would be
written y 0 or dy/dt, or possibly ẏ
(with a dot above the y).
Moreover, it is common to simply write y 0 or dy/dx instead of y 0 (x):
y 0 = 4x3
or
dy
= 4x3 .
dx
In any case, the goal is to find a formula for y in terms of x that satisfies the given
differential equation.
Basic Examples
Let’s look at a few more examples of differential equations, to help us get a feel for the
subject.
INTRODUCTION TO DIFFERENTIAL EQUATIONS
2
EXAMPLE 1 Find the general solution to the following differential equation.
y 0 = 2x cos x2 .
SOLUTION This isn’t much harder than our initial example. All we need to do is
integrate:
Z
y =
2x cos x2 dx.
This integral is most easily evaluated by substituting u = x2 , which gives
Z
y = cos u du = sin u + C = sin x2 + C
In general, any differential equation of the form
y 0 = f (x)
can be solved by integrating:
Z
y =
f (x) dx.
However, not every differential equation is so simple.
EXAMPLE 2 Find the general solution to the following differential equation.
y 0 = y.
Actually, it is essentially the definition
of the number e that the derivative of
ex is ex . That is, e is defined so that
ex is a solution to the differential
equation y 0 = y.
SOLUTION This equation is much more interesting than those we have encountered
so far. In words, it says the following: find a formula that doesn’t change when you
take its derivative.
Here is one solution that immediately leaps to mind:
y = ex .
The derivative of ex is just ex , so if y = ex then y 0 will be equal to y.
But how can we find the general solution? Where should we place the constant C?
So far, we have always just added C to the end of the formula:
y = ex + C
But this doesn’t work: if y = ex + C, then y 0 is just ex , so y and y 0 are not the same.
The answer is that C should be the coefficient instead.
y = Cex
This works, since the derivative of Cex is Cex for any constant C.
In the last example, we started by finding a particular solution to the dfferential
equation, and then we figured out how to add a constant C to get the general solution.
This is a common two-step process when solving differential equations
EXAMPLE 3 Find a general solution to the following differential equation.
y 0 = −y 2
INTRODUCTION TO DIFFERENTIAL EQUATIONS
3
SOLUTION Where do we even begin? How can we possibly find a formula for y that
satisfies this equation?
When we have no idea how to solve a math problem, one method we can always
resort to is guess and check. We have no idea what formula might work here, and
there’s no way to find out without making some guesses, and then checking whether
they work.
Here are some possible guesses:
y = sin x,
y = ex ,
y=
√
x,
y=
1
,
x
y = x2 ,
y = ln x.
Do any of these work?
It turns out that y = 1/x is the right guess. If y = 1/x, then y 0 = −1/x2 , and the
equation becomes
2
1
1
.
− 2 = −
x
x
Later on, we will learn a method
called separation of variables that
allows us to solve this equation
without any guessing.
So y = 1/x is a particular solution to this differential equation.
Now, what about the general solution? We need to figure out how to include an
arbitrary constant C. Here are a few possibilities:
y =
1
+ C,
x
y =
C
,
x
y =
1
,
Cx
y =
1
,
x+C
y =
1
.
xC
Do any of these work? Yes — it is easy to check that
Actually, this answer isn’t quite
correct. In particular, y = 0 is a
solution to the given equation, though
it doesn’t correspond to any value
of C. (Intuitively, it’s the solution you
get when C = ∞.)
y =
1
x+C
is always a solution, so presumably this is the general solution to the given differential
equation.
Making up Differential Equations
Although our goal is to learn how to solve differential equations, you can learn a lot by
trying to make up differential equations that have a certain solution. For example, suppose
we want a differential equation that has
y = x3
as a solution. The simplest possibility is
y 0 = 3x2 .
However, any differential equation that holds when you plug in y = x3 and y 0 = 3x2 will
work. For example,
xy 0 = 3y
has y = x3 as a solution, since x 3x2 = 3 x3 . Some other differential equations with
3
y = x as a solution include
3
y 0 = 27y 2 ,
xy 0 + 4y = 7x3 ,
and
yy 0 = 3x5 .
On your own, you could try making some differential equations that have y = x2 as a
solution, or perhaps y = sin x.
INTRODUCTION TO DIFFERENTIAL EQUATIONS
4
Initial Value Problems
An initital value problem consists of the following information:
1. A differential equation involving an unknown function y.
Instead of including y(0), sometimes
an initial value problem includes a
different value of y, such as y(1), or
possibly the limiting value of y as
x → −∞ or x → ∞.
2. An initial value for y, i.e. the value y(0) of the function y when x = 0.
The idea is that the value of y(0) is usually enough information to specify a single
solution to the differential equation.
Usually, an initial value problem has only one solution.
Here is the most common procedure for solving an initial value problem.
SOLVING INITIAL-VALUE PROBLEMS
1. Find the general solution to the given differential equation, involving an arbitrary
constant C.
2. Plug in the initial value to get an equation involving C, and then solve for C.
EXAMPLE 4 Find the solution to the following initial value problem.
y 0 = −y 2 ,
y(0) = 3.
SOLUTION We found the general solution to this differential equation in Example 3:
y =
1
x+C
Therefore, all that remains is figure out a value for C so that y(0) = 3. Plugging in
x = 0 and y = 3 gives the equation
3 =
1
.
0+C
Solving for C gives C = 1/3, and hence
y =
1
x + 1/3
We can simplify our answer by multiplying the numerator and denominator by 3:
y =
3
3x + 1
EXAMPLE 5 Find the solution to the following initial value problem.
y 0 = 2y,
y(0) = 5.
SOLUTION The given differential equation isn’t very different from the equation
y0 = y
from Example 2. In that case, the general solution was y = Cex . How can we modify
this solution to account for the extra 2?
INTRODUCTION TO DIFFERENTIAL EQUATIONS
5
A few minutes of thought reveals the answer:
More generally, the solution to any
equation of the form y 0 = ky (where k
is a constant) is y = Cekx .
y = Ce2x
So this is the general solution to the given equation. Plugging in x = 0 and y = 5 gives
the equation
5 = Ce0 ,
so C = 5, and the solution is y = 5e2x .
Second-Order Equations
When using t (for time) instead of x,
the second derivative is sometimes
written with two dots, i.e. ÿ.
Recall that the second derivative of a function y is the derivative of the derivative.
This can be written
d2 y
.
y 00
or
dx2
A second-order equation is a differential equation that involves y 00 , as well as perhaps
y 0 , y, and x.
EXAMPLE 6 Find the general solution to the following second-order equation.
y 00 = 12x2 .
SOLUTION Integrating once gives a formula for y 0 :
Z
y0 =
12x2 dx = 4x3 + C.
We can now integrate again to get a formula for y.
Z
y =
4x3 + C dx = x4 + Cx + C2 .
Here C2 represents a new constant of integration, which may be different from the
original C. Actually, it would make more sense to refer to the original C as C1 :
y = x4 + C1 x + C2
This is the general solution to the given second-order equation.
Note that the general solution in the last example involved two arbitrary constants.
This is fairly common.
1. The general solution to a first-order equation usually involves one arbitrary
constant.
2. The general solution to a second-order equation usually involves two arbitrary
constants.
Here the phrase “first-order equation” refers to an equation that has only first
derivatives, i.e. the sort of equation we were discussing initially.
Incidentally, it is of course possible to discuss third-order equations (involving the
third derivative), fourth-order equations, and so forth. As you would expect, the general
solution to an nth order equation usually involves n arbitrary constants. However, we
will mostly restrict our attention to first and second order equations, since equations
of third order or higher are rare in both science and mathematics.
INTRODUCTION TO DIFFERENTIAL EQUATIONS
6
EXAMPLE 7 Find the general solution to the following second-order equation.
y 00 = y.
SOLUTION Obviously y = ex is a solution, and more generally y = C1 ex is a solution
for any constant C1 . However, this is not the general solution—we are expecting one
more arbitrary constant.
So how can we find another solution to this differential equation? Think about this
for a minute—we want a function other than a multiple of ex that is equal to its own
second derivative.
The answer is quite clever: what about y = e−x ? Though the derivative of e−x
has an extra minus sign, the second derivative is again e−x , so e−x is a solution to the
above equation. Indeed, anything of the form y = C2 e−x is a solution, where C2 can
be any constant.
But how can we combine the two solutions into a single formula? In this case, it
turns out that it works to just add them together:
y = C1 ex + C2 e−x
(The reader may want to check this by plugging this formula into the original equation.)
This formula includes two arbitrary constants, so it ought to be the general solution
to the given second-order equation.
It is common in applications that the
two known values of y are at the
boundary points of the interval of
possible x-values. Hence the
terminology “boundary value
problem”.
Because the general solution to a second-order equation involves two arbitrary constants, you need two additional pieces of information to determine a single solution.
One option is to give two different values for y, e.g. y(0) and y(1). This is called a
boundary value problem, and you can solve it using the following procedure.
SOLVING BOUNDARY-VALUE PROBLEMS
1. Find the general solution to the given second-order equation, involving constants
C1 and C2 .
2. Plug in the first value for y to get an equation involving C1 and C2 .
3. Plug in the second value for y 0 to get another equation involving C1 and C2 .
4. Solve the two equations for the unknown constants C1 and C2 .
EXAMPLE 8 Find the solution to the following boundary-value problem
y 00 = 12x,
y(−1) = 3,
y(1) = 5.
SOLUTION We can integrate to get a formula for y 0 :
Z
y0 =
12x dx = 6x2 + C1 ,
and then integrate again to get a formula for y:
Z
y = (6x2 + C1 ) dx = 2x3 + C1 x + C2 ,
All that remains is to find the values of C1 and C2 .
Plugging in x = −1 and y = 3 gives the equation
3 = −2 − C1 + C2 ,
INTRODUCTION TO DIFFERENTIAL EQUATIONS
7
and plugging in x = 1 and y = 5 gives the equation
5 = 2 + C1 + C2 ,
We can solve these two equations to get C1 = −1 and C2 = 4, so
y = 2x3 − x + 4
Instead of giving two pieces of information about y, another way of specifying a
single solution to a second-order differential equation is to give one piece of information
about y and one piece of information about y 0 . In particular, a second-order initial
value problem consists of the following information:
1. A second-order differential equation involving an unknown function y.
2. An initial value for y, such as y(0).
3. An initial value for y 0 , such as y 0 (0).
You can solve such a problem using the following procedure.
SOLVING SECOND-ORDER INITIAL VALUE PROBLEMS
1. Find the general solution to the given second-order equation, involving constants
C1 and C2 .
2. Plug in the initial value for y to get an equation involving C1 and C2 .
3. Take the derivative of the general formula for y to get a general formula for y 0 .
4. Plug in the initial value for y 0 to get another equation involving C1 and C2 .
5. Solve the two equations for the unknown constants C1 and C2 .
EXAMPLE 9 Find the solution to the following initial value problem.
y 00 = y,
y(0) = 7,
y 0 (0) = 3.
SOLUTION As we saw in Example 7, the general solution to the given equation is
y = C1 ex + C2 e−x .
Therefore, we need only figure out the values of C1 and C2 .
Plugging in x = 0 and y = 7 gives the equation
7 = C1 + C2 .
Next we take the derivative of the general formula for y to get a general formula for y 0 .
y 0 = C1 ex − C2 e−x .
Plugging in x = 0 and y 0 = 3 gives the equation
3 = C1 − C2 .
We can now solve the equations C1 + C2 = 7 and C1 − C2 = 3 for C1 and C2 . The
result is that C1 = 5 and C2 = 2, so
y = 5ex + 2e−x
INTRODUCTION TO DIFFERENTIAL EQUATIONS
8
Guessing the Form
One basic method for solving differential equations is an enhanced version of guess &
check: we can guess the form of the solution, and then solve for any missing constants.
For example, we might guess that a differential equation has a solution of the form
y = eax
for some unknown value of a. We then check this solution by plugging it into the
differential equation, and then try to figure out which values of a will make the solution
work.
EXAMPLE 10 Suppose we wish to find a solution the equation
y 00 = 7y 0 − 10y.
We might guess that this equation has solutions of the form y = eax for some constant a.
In this case, we have
y 0 = aeax
and
y 00 = a2 eax .
Plugging these into the equation gives
a2 eax = 7aeax − 10eax
which simplifies to
a2 eax = (7a − 10)eax .
Now, how can we arrange it so that the left and right sides of this equation are the
same? Well, they will be the same as long as
For this equation we only found two
solutions y = e2x and y = e5x of the
given form, but there ought to be
many more solutions not of this form.
Indeed, the general solution to this
differential equation is
y = C1 e2x + C2 e5x .
a2 = 7a − 10
The solutions to this quadratic equation are a = 2 and a = 5, and therefore y = e2x
and y = e5x are two solutions to the given differential equation.
EXAMPLE 11 Find a solution to the equation
x2 y 00 = 2xy 0 + 10y
of the form y = xa .
SOLUTION If y = xa , then
y 0 = axa−1
and
y 00 = a(a − 1)xa−2
Plugging these into differential equation gives
x2 a(a − 1)xa−2 = 2x axa−1 + 10xa
which simplifies to
a(a − 1)xa = (2a + 10)xa .
Now, how can we arrange it so that the left and right sides of this equation are the
same? Well, they will be the same as long as
Again, we only found two solutions to
the given equation, but it turns out
that the general solution is
y = C1 x5 + C2 x−2 .
a(a − 1) = 2a + 10
Solving gives a = 5 or a = −2, so y = x5 and y = x−2 are two solutions to this
equation.
INTRODUCTION TO DIFFERENTIAL EQUATIONS
9
Forms with Two Constants
Sometimes it works well to guess a form that involves two constants. For example, consider
the equation
y 0 y 00 = 2y
We might guess that this equation has solutions of the form y = axb , where a and b are
constants. The derivatives of this form are
y 0 = abxb−1
and
y 00 = ab(b − 1)xb−2 .
Plugging these into the differential equation and simplifying yields
a2 b2 (b − 1)x2b−3 = 2axb .
The only way for the left and right sides of this equation to be the same is if the coefficients
are the same and the exponents are the same. This gives us the following two equations:
a2 b2 (b − 1) = 2a
and
2b − 3 = b.
The second equation tells us that b = 3. Plugging this into the first equation and solving
for a yields a = 0 or a = 1/9. Therefore, y = 0 and y = 91 x3 are two solutions to the given
equation.
EXERCISES
1–6
Use integration to find the general solution to the given
differential equation.
1. y 0 = x
p
x2 + 1
2. y 0 = x cos x
17–18
Solve the given boundary value problem.
17. y 00 = sin x, y(0) = 4, y(π) = 6
3. y 0 + cos(3x) = 0
4. y 0 ex = 1
18. y 00 = y, y(0) = 7, y(ln 2) = 8
5. xy 0 + 4x3 = 1
6. y 0 = 1 − x2 y 0
19–20
7. y 00 =
√
3
x
8. x3 y 00 = x + 2
9–10
Use guess & check to find the general solution to the
given differential equation.
9. y 0 + y tan x = 0
10. y 0
2
= 4y
11–14
Use guess & check to find just one solution to the
given differential equation.
11. y 0 + y = 9e2x
12. yy 0 = 4e8x
13. x2 y 0 + ey = 2x
14. y 0 y 00 = 14y + 4x3
15–16
Solve the given initial value problem.
15. y 0 = xex , y(0) = 3
16. y 0 = 3y, y(2) = 4
Solve the given initial value problem.
19. y 00 = x2 , y(1) = 1/2, y 0 (1) = 1/2
20. y 00 = 4y, y(0) = 5, y 0 (0) = 2
Find all solutions to the given differential equation of
21–24
the specified form.
21. y 00 = 3y 0 + 4y (y = eax )
22. x2 y 00 − 7xy 0 + 12y = 0 (y = xa )
23. y 0 y 00 = −36y 3 (y = xa )
24. 5yy 00 = y 0
2
+ 36y 2 (y = eax )
Answers
1. y =
1
3
3/2
+C
x2 + 1
5. y = ln |x| − 43 x3 +C
9. y = C cos x
6. y = arctan x +C
10. y = (x +C)2
19. y =
1
12
23. y = x−3
x4 + 2x + 3
7. y =
11. y = 3e2x
16. y = 4e3x−6
15. y = (x − 1)ex + 4
3. y = − 13 sin(3x) +C
2. y = x sin x + cos x +C
12. y = e4x
8. y = − ln |x| + x−1 +C1 x +C2
13. y = ln x
17. y = − sin x + (2/π)x + 4
20. y = 3e2x + 2e−2x
24. y = e3x and y = e−3x
9 7/3
+C1 x +C2
28 x
4. y = −e−x +C
21. y = e−x and y = e4x
14. y = x3
18. y = 3ex + 4e−x
22. y = x2 and y = x6