Chapter 1. Introduction to Differential Equations
Tải bản đầy đủ - 0trang
2
Numerous references like
Abell and Braselton’s
Mathematica By Example [1]
are also available to beginning
users of Mathematica.
Chapter 1 Introduction to Differential Equations
modeled with differential equations. For example, we will see that the motion of a
pendulum can be modeled by a differential equation. When we solve the problem
of the motion of a pendulum, we use technology to actually watch the pendulum
move. The same is true for the motion of a mass attached to the end of a spring
as well as many other problems. In having this ability, the study of differential
equations becomes much more meaningful as well as interesting.
If you are a beginning Mathematica user and, especially, new to Version 5.0, the
Appendix contains an introduction to Mathematica, including discussions about
entering and evaluating commands, loading packages, and taking advantage of
Mathematica’s extensive help facility.
Although Chapter 1 is short in length, Chapter 1 introduces examples that will
be investigated in subsequent chapters. Also, the vocabulary introduced in Chapter 1 will be used throughout the text. Consequently, even though, to a large extent,
it may be read quickly, subsequent chapters will take advantage of the terminology and techniques discussed here.
1.1 Deﬁnitions and Concepts
We begin our study of differential equations by explaining what a differential
equation is.
Deﬁnition 1 (Differential Equation). A differential equation is an equation that
contains the derivative or differentials of one or more dependent variables with respect to
one or more independent variables. If the equation contains only ordinary derivatives (of
one or more dependent variables) with respect to a single independent variable, the equation
is called an ordinary differential equation.
EXAMPLE 1.1.1: Thus, dy/ dx x2 / y2 cos y and dy/ dx du/ dx u x2 y
are examples of ordinary differential equations.
The equation y 1 dx x cos y dy 1 is an ordinary differential equation
written in differential form.
Using prime notation, a solution of the ordinary differential equation xy
x2 n2 y 0, which is called Bessel’s equation, is a function y
xy
y x with the property that x d 2 y/ dx2 x dy/ dx x2 n2 y is identically
the 0 function.
1.1 Deﬁnitions and Concepts
3
On the other hand,
dx
dt
dy
dt
a
by x
(1.1)
m
nx y
where a, b, m, and n are positive constants, is a system of two ordinary
differential equations, called the predator–prey equations. A solution
consists of two functions x x t and y y t that satisfy both equations.
Predator–prey models can exhibit very interesting behavior as we will
see when we study systems in more detail.
Note that a system of differential equations can consist of more than
two equations. For example, the basic equations that describe the competition between two organisms, with population densities x1 and x2 ,
respectively, in a chemostat are
S
1
x1
x1
x2
x2
m1 S
x1
a1 S
m1 S
1
a1 S
m2 S
1
a2 S
S
See texts like Giordano,
Weir, and Fox’s A First Course
in Mathematical Modeling [12]
and similar texts for detailed
descriptions of
predator–prey models.
See Smith and Waltman’s The
Theory of the Chemostat [24]
for a detailed discussion of
chemostat models.
m2 S
x2
a2 S
(1.2)
where denotes differentiation with respect to t; S
S t , x1
x1 t ,
x2 t . For equations (1.2), we remark that S denotes the conand x2
centration of the nutrient available to the competitors with population
densities x1 and x2 . We investigate chemostat models in more detail in
Chapter 9.
If the equation contains partial derivatives of one or more dependent variables,
then the equation is called a partial differential equation.
EXAMPLE 1.1.2: Because the equations involve partial derivatives of
u
u
and uux u
uyy are
an unknown function, equations like u
t
x
2
2
u
u
partial differential equations. For Laplace’s equation, 2
0a
x
y2
solution would be a function u u x, y such that uxx uyy is identically
the 0 function. A solution u u x, t of the wave equation is a function
2
2
u
u
.
satisfying 2
t
x2
4
Chapter 1 Introduction to Differential Equations
The partial differential equation
u
t
2
u
is known as the heat
x2
equation.
As with systems of ordinary differential equations, systems of partial
differential equations can be considered. With exceptions, their study is
beyond the scope of this text.
Generally, given a differential equation, our goal in this course will most often be
to construct a solution (or a numerical approximation of the solution). The approach
to solving an equation depends on various features of the equation. The ﬁrst level
of classiﬁcation, distinguishing between ordinary and partial differential equations,
was discussed above. Generally, equations with higher order are more difﬁcult to
solve than those with lower order.
Deﬁnition 2 (Order). The order of a differential equation is the order of the highest-order
derivative appearing in the equation.
EXAMPLE 1.1.3: Determine the order of each of the following differential equations: (a) dy/ dx x2 / y2 cos y ; (b) uxx uyy 0; (c) dy/ dx 4 y x;
and (d) y3 dy/ dx 1.
SOLUTION: (a) The order of this equation is one because the only
derivative it includes is a ﬁrst-order derivative, dy/ dx. (b) This equation is classiﬁed as second-order because the highest-order derivatives,
both uxx , representing 2 u/ x2 , and uyy , representing 2 u/ y2 , are of
order two. Hence, Laplace’s equation, uxx uyy 0, is a second-order
partial differential equation. (c) This is a ﬁrst-order equation because
the highest-order derivative is the ﬁrst derivative. Raising that derivative to the fourth power does not affect the order of the equation. The
expressions
dy
dx
4
and
d4y
dx4
do not represent the same quantities: dy/ dx 4 represents the derivative
of y with respect to x raised to the fourth power; d 4 y/ dx4 represents the
fourth derivative of y with respect to x. (d) Again, we have a ﬁrst-order
equation, because the highest-order derivative is the ﬁrst derivative.
Linear differential equations are deﬁned in a manner similar to algebraic linear equations that are introduced in algebra and pre-calculus courses.
1.1 Deﬁnitions and Concepts
5
Deﬁnition 3 (Linear Differential Equation). An ordinary differential equation (of
order n) is linear if it is of the form
an x
dny
dxn
an
1
x
where the functions ai x , i
function.
dn 1y
dxn 1
a2 x
d2y
dx2
a1 x
dy
dx
a0 x y
f x,
(1.3)
0, 1, . . . , n, and f x are given and an x is not the zero
If the equation does not meet the requirements of this deﬁnition, then the equation
is said to be nonlinear. If f x is identically equal to the zero function, the linear
equation (1.3) is said to be homogeneous.
EXAMPLE 1.1.4: Determine which of the following differential equations are linear: (a) dy/ dx x3 ; (b) d 2 u/ dx2 u xx ; (c) y 1 dx x cos y dy
x; (e) y x2 y x; (f) x
sin x 0; (g) uxx yuy 0; and
0; (d) y 3 yy
(h) uxx u uy 0.
SOLUTION: (a) This equation is linear, because the nonlinear term
x3 is the function f x of the independent variable in equation (1.3).
(b) This equation is also linear. Using u as the dependent variable name
does not affect the linearity. (c) Solving for dy/ dx we have dy/ dx
1
y / x cos y . Because the right-hand side of this equation includes a nonlinear function of y, the equation is nonlinear in y. However, solving for
dx/ dy, we see that
dx
dy
cos y
x
1 y
or
dx
dy
cos y
x
1 y
0.
This equation is linear in the variable x, if we take the dependent variable to be x and the independent variable to be y in this equation.
(d) The coefﬁcient of the y term is y and, thus, depends on y. Hence,
this equation is nonlinear. (e) This equation is linear. The term x2 is the
x2 of y. (f) This equation, known as the
coefﬁcient function a0 x
pendulum equation because it models the motion of a pendulum, is
nonlinear because it involves a nonlinear function of x, the dependent
variable in this case. (t is assumed to be the independent variable.) For
this equation, the nonlinear function of x is sin x. (g) This partial differential equation is linear because the coefﬁcient of uy is a function of one
of the independent variables. (h) In this case, there is a product of u and
one of its derivatives. Therefore, the equation is nonlinear.
For the linear differential
equation (1.3), f x is called
the forcing function.
A similar classiﬁcation is
followed for partial
differential equations. In this
case, the coefﬁcients in a
linear partial differential
equation are functions of the
independent variables.
6
Chapter 1 Introduction to Differential Equations
In the same manner that we consider systems of equations in algebra, we can also
consider systems of differential equations. For example, if x and y represent functions of t, we will learn to solve the system of linear equations
dx/ dt
ax
by
dy/ dt
cx
dy
where a, b, c, and d represent constants and differentiation is with respect to t
in Chapter 8. On the other hand, systems (1.1) and (1.2) involve products of the
dependent variables (x and y; S, x1 , and x2 , respectively) so are nonlinear systems
of ordinary differential equations.
We will see that linear and nonlinear systems of differential equations arise naturally in many physical situations that are modeled with more than one equation
and involve more than one dependent variable.
1.2 Solutions of Differential Equations
When faced with a differential equation, our goal is frequently, but not always, to
determine explicit and/or numerical solutions to the equation.
Deﬁnition 4 (Solution). A solution to the nth-order ordinary differential equation
F x, y, y , y , . . . , y n
0
(1.4)
on the interval a < x < b is a function Φ x that is continuous on the interval a < x < b
and has all the derivatives present in the differential equation such that
F x, Φ, Φ , Φ , . . . , Φ n
0
on a < x < b.
In subsequent chapters, we will discuss methods for solving differential equations.
Here, in order to understand what is meant to be a solution, we either give both
the equation and a solution and then verify the solution or use Mathematica to
solve equations directly.
EXAMPLE 1.2.1: Verify that the given function is a solution to the corresponding differential equation: (a) dy/ dx 3y, y x
e3x ; (b) u 16u
x
2y y 0, y x
xe .
0, u x
cos 4x; and (c) y
1.2 Solutions of Differential Equations
7
SOLUTION: (a) Differentiating y we have dy/ dx 3e3x so that substitution yields
dy
3y
or
3e3x 3e3x .
dx
4 sin 4x and u
(b) Two derivatives are required in this case: u
16 cos 4x. Therefore,
16u
u
16 cos 4x
16 cos 4x
0.
(c) In this case, we illustrate how to use Mathematica. After deﬁning y,
In[1]:= y x
Out[1]=
x
x Exp
we use ’ to compute y
In[2]:= dy
Out[2]=
x
x
x
e
xe x , naming the resulting output dy.
y x
x
x
x
Similarly, we use ’’ to compute y
output d2y.
In[3]:= d2y
Out[3]=
y
x
xe x , naming the resulting
x
x
2
2e
x
x
Finally, we compute y
2y y
2e x 2 e x xe x
xe x 0. The
result is not automatically simpliﬁed so we use Simplify to simplify
the output.
In[4]:= d2y
Out[4]=
2
2dy
x
2
y x
x
x
x
2
In[5]:= Simplify d2y
2dy
x
x
y x
Out[5]= 0
We obtain the same result by entering
In[6]:= Simplify y
x
2y x
y x
Out[6]= 0
which ﬁrst computes y
2y y and then applies the Simplify command to the result. We graph this solution with Plot. Entering
In[7]:= Plot y x , x, 1, 1
graphs y x
xe
x
on the interval
1, 1 . See Figure 1-1.
If you are a beginning
Mathematica user, see the
Appendix for help getting
started with Mathematica.
8
Chapter 1 Introduction to Differential Equations
-1
-0.5
0.5
1
-0.5
-1
-1.5
-2
-2.5
Figure 1-1 Plot of y x
xe
x
on the interval
1, 1
In the previous example, the solution is given as a function of the independent
variable. In these cases, the solution is said to be explicit. In solving some differential equations, however, we can only ﬁnd an equation involving x and y that the
solution satisﬁes. In this case, the solution is said to be implicit.
EXAMPLE 1.2.2: Verify that the given implicit function satisﬁes the
differential equation.
Function: 2x2
dy
Differential Equation:
dx
Assuming that y
dy
y.
dx
yx,
y2 2xy 5x
2y 4x 5
2y 2x
0
SOLUTION: We use implicit differentiation to compute the derivative
of the equation 2x2 y2 2xy 5y 0:
4x
2y
dy
dx
2x
dy
dx
2y
2y
2x
5
dy
dx
dy
dx
0
2y
4x
5
2y 4x 5
.
2y 2x
Hence, the given implicit solution satisﬁes the differential equation.
We also illustrate how to use Mathematica to differentiate the equa0 with respect to x. After clearing all prior
tion 2x2 y2 2xy 5x
deﬁnitions of x, y, and eq, if any, with Clear we deﬁne eq to be the
1.2 Solutions of Differential Equations
9
equation 2x2 y2 2xy 5x 0. Note how we use a double equals sign
(==) to separate the left and right-hand sides of the equation.
In[8]:= Clear x, y
2x2
eq
Out[8]= 5 x
2x
y2
2
2xy
2xy
5x
y2
0
0
Next, we use Dt to differentiate eq with respect to x, naming the resulting output step1. The symbol Dt[y,x] appearing in the result represents dy/ dx; step1 represents the equation 4x 2yy 2xy 2y 5 0.
In[9]:= step1
Dt eq, x
Out[9]= 5
2y
4x
Finally, we obtain y
with Solve.
2 x Dt y, x
2 y Dt y, x
0
dy/ dx by solving the equation step1 for Dt[y,x]
In[10]:= step2
Out[10]=
Solve step1, Dt y, x
5 4x 2y
Dt y, x
2 x y
Generally, to graph an equation of the form f x, y
C, where C is a
constant, we use the ContourPlot command which is used to graph
level curves of surfaces: the graph of f x, y
C is the same as the
graph of the level curve of z
f x, y corresponding to z
C. Thus,
0 is the same as the
the graph of the equation 2x2 y2 2xy 5x
graph of the level curve of z f x, y
2x2 y2 2xy 5x corresponding
to 0. Note how 2x2 y2 2xy 5x, the left-hand side of the equation eq,
is extracted from eq with Part ([[...]]): 2x2 y2 2xy 5x is the ﬁrst
part of eq.
In[11]:= eq 1
Out[11]= 5 x
2 x2
2xy
y2
Thus, entering
In[12]:= ContourPlot Evaluate eq 1
, x, 7, 2 ,
y, 7, 2 , Frame False, Axes Automatic,
AxesOrigin
0, 0 ,
AxesStyle GrayLevel 0.5 ,
PlotPoints 100, Contours
0 ,
ContourShading False
10
Chapter 1 Introduction to Differential Equations
2
-6
-4
-2
2
-2
-4
-6
Figure 1-2 Graph of 2x2
y2
2xy
5x
0
graphs the equation 2x2 y2 2xy 5x 0 as shown in Figure 1-2 for
7
x
2 and 7
y
2 (the option Contours->{0} instructs
Mathematica to graph only the level curve corresponding to 0). The
option ContourShading->False speciﬁes to not shade the regions
between contours, Frame->False speciﬁes that a frame is not to be
placed around the resulting graphics object, Axes->Automatic speciﬁes that axes are to be placed on the resulting graphics object while the
option AxesOrigin->{0,0} speciﬁes that they intersect at the point
0, 0 and the option AxesStyle->GrayLevel[.5] speciﬁes that they
be drawn in a medium shade of gray. The option PlotPoints->100
instructs Mathematica to increase the number of sample points to 100
(the default is 15), helping assure that the resulting graphics object
appears smooth. Be sure to enclose eq[[1]] in Evaluate as shown:
this ensures that Mathematica evaluates eq[[1]] before sampling
points; if Evaluate is not included error messages result. (Note that an
alternative way to graph equations is to use the ImplicitPlot command which is contained in the ImplicitPlot package located in the
Graphics folder (or directory).) If you are using Version 5.0 (or later)
and wish to avoid using Part, you can select the left-hand side of the
equation, copy it,
1.2 Solutions of Differential Equations
11
and then paste it into the ContourPlot command.
See Getting Started in the
Appendix.
EXAMPLE 1.2.3: On a rectangular membrane, the solution of the wave
equation,
2
w
x2
2
w
y2
1
2
c0
For details, see Graff’s Wave
Motion in Elastic Solids [13].
2
w
t2
(1.5)
12
Chapter 1 Introduction to Differential Equations
takes the form
Amn cos Ωmnt
w
Bmn sin Ωmnt Wmn ,
n 1m 1
where Amn and Bmn are constants, Ωmn 2 c0 2 Ξn 2
mΠ/ b, and the normal modes, Wnm , are given by
Wnm x, y
Ζm 2 , Ξ n
nΠ/ a, Ζm
sin Ξn x sin Ζm y.
cos Ωmnt Wmn x, y and fs x, y, t
sin Ωmnt
(a) Verify that fc x, y, t
Wmn x, y satisfy the wave equation (1.5) on a rectangular membrane.
(b) Plot the ﬁrst few normal modes of the membrane.
SOLUTION: After deﬁning Ωmn 2 c0 2 Ξn 2 Ζm 2 , Ξn nΠ/ a, Ζm mΠ/ b,
cos ΩmntWmn x, y and fs x, y, t
sin ΩmntWmn x, y .
we deﬁne fc x, y, t
In[13]:= Ω m , n
Π c0
In[14]:= Ξ n
nΠ
a
Ζ m
mΠ
b
n2
a2
m2
b2
In[15]:= fc x , y , t
Cos Ω m, n t Sin Ξ n x Sin Ζ m y
In[16]:= fs x , y , t
Sin Ω m, n t Sin Ξ n x Sin Ζ m y
2
To verify that fc x, y, t satisﬁes equation (1.5), we compute
2
and
fc
t2
fc
,
x2
in fcxx, fcyy, and fczz, respectively.
In[17]:= fcxx
Out[17]=
In[18]:= fcyy
Out[18]=
m2
b2
n2
a2
Π t Sin
nΠx
a
Sin
mΠy
b
nΠx
a
Sin
mΠy
b
a2
D fc x, y, t , y, 2
m2 Π2 Cos c0
m2
b2
n2
a2
Π t Sin
b2
In[19]:= fctt
Out[19]=
D fc x, y, t , x, 2
n2 Π2 Cos c0
D fc x, y, t , t, 2
m 2 n2
Π2 Cos c0
b2 a2
nΠx
mΠy
Sin
Sin
a
b
c02
m2
b2
n2
Πt
a2
2
fc
,
y2