In some cases, Mathematica’s built-in functions can immediately solve a differential equation by providing an explicit, implicit, or numerical solution; in other cases, Mathematica can b
Trang 2with Mathematica
THIRDEDITION
Trang 4Amsterdam Boston Heidelberg London New York Oxford Paris
San Diego San Francisco Singapore Sydney Tokyo
Trang 5Marketing Manager: Linda Beattie
Elsevier Academic Press
200 Wheeler Road, Burlington, MA 01803, USA
525 B Street, Suite 1900, San Diego, California 92101-4495, USA
84 Theobald’s Road, London WC1X 8RR, UK
This book is printed on acid-free paper
Copyright c 2004, Elsevier Inc All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by anymeans, electronic or mechanical, including photocopy, recording, or any informationstorage and retrieval system, without permission in writing from the publisher
Permissions may be sought directly from Elsevier’s Science & Technology Rights
Department in Oxford, UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, e-mail:permissions@elsevier.com.uk You may also complete your request on-line via the Elsevierhomepage (http://elsevier.com), by selecting “Customer Support” and then “ObtainingPermissions.”
Library of Congress Cataloging-in-Publication Data
Application submitted
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
ISBN: 0-12-041562-3
For all information on all Academic Press publications
visit our web site at www.books.elsevier.com
Printed in the United States of America
Trang 6Preface xiii
1 Introduction to Differential Equations 1
1.1 Definitions and Concepts 2
1.2 Solutions of Differential Equations 6
1.3 Initial and Boundary-Value Problems 18
1.4 Direction Fields 26
2 First-Order Ordinary Differential Equations 41
2.1 Theory of First-Order Equations: A Brief Discussion 41
2.2 Separation of Variables 46
Application: Kidney Dialysis 55
2.3 Homogeneous Equations 59
Application: Models of Pursuit 64
2.4 Exact Equations 69
2.5 Linear Equations 74
2.5.1 Integrating Factor Approach 75
2.5.2 Variation of Parameters and the Method of Undetermined Coefficients 86 Application: Antibiotic Production 89
2.6 Numerical Approximations of Solutions to First-Order Equations 92 2.6.1 Built-In Methods 92
v
Trang 7Application: Modeling the Spread of a Disease 97
2.6.2 Other Numerical Methods 103
3 Applications of First-Order Ordinary Differential Equations 119
3.1 Orthogonal Trajectories 119
Application: Oblique Trajectories 129
3.2 Population Growth and Decay 132
3.2.1 The Malthus Model 132
3.2.2 The Logistic Equation 138
Application: Harvesting 148
Application: The Logistic Difference Equation 152
3.3 Newton’s Law of Cooling 157
3.4 Free-Falling Bodies 163
4 Higher-Order Differential Equations 175
4.1 Preliminary Definitions and Notation 175
4.1.1 Introduction 175
4.1.2 The nth-Order Ordinary Linear Differential Equation 180
4.1.3 Fundamental Set of Solutions 185
4.1.4 Existence of a Fundamental Set of Solutions 191
4.1.5 Reduction of Order 193
4.2 Solving Homogeneous Equations with Constant Coefficients 196
4.2.1 Second-Order Equations 196
4.2.2 Higher-Order Equations 200
Application: Testing for Diabetes 211
4.3 Introduction to Solving Nonhomogeneous Equations with Constant Coefficients 216
4.4 Nonhomogeneous Equations with Constant Coefficients: The Method of Undetermined Coefficients 222
4.4.1 Second-Order Equations 223
4.4.2 Higher-Order Equations 239
4.5 Nonhomogeneous Equations with Constant Coefficients: Variation of Parameters 248
4.5.1 Second-Order Equations 248
4.5.2 Higher-Order Nonhomogeneous Equations 252
Trang 84.6 Cauchy–Euler Equations 255
4.6.1 Second-Order Cauchy–Euler Equations 255
4.6.2 Higher-Order Cauchy–Euler Equations 261
4.6.3 Variation of Parameters 265
4.7 Series Solutions 268
4.7.1 Power Series Solutions about Ordinary Points 268
4.7.2 Series Solutions about Regular Singular Points 281
4.7.3 Method of Frobenius 283
Application: Zeros of the Bessel Functions of the First Kind 295
Application: The Wave Equation on a Circular Plate 298
4.8 Nonlinear Equations 304
5 Applications of Higher-Order Differential Equations 321
5.1 Harmonic Motion 321
5.1.1 Simple Harmonic Motion 321
5.1.2 Damped Motion 332
5.1.3 Forced Motion 346
5.1.4 Soft Springs 365
5.1.5 Hard Springs 368
5.1.6 Aging Springs 370
Application: Hearing Beats and Resonance 372
5.2 The Pendulum Problem 373
5.3 Other Applications 387
5.3.1 L–R–C Circuits 387
5.3.2 Deflection of a Beam 390
5.3.3 Bod´e Plots 393
5.3.4 The Catenary 398
6 Systems of Ordinary Differential Equations 411
6.1 Review of Matrix Algebra and Calculus 411
6.1.1 Defining Nested Lists, Matrices, and Vectors 411
6.1.2 Extracting Elements of Matrices 416
6.1.3 Basic Computations with Matrices 419
6.1.4 Eigenvalues and Eigenvectors 422
6.1.5 Matrix Calculus 426
6.2 Systems of Equations: Preliminary Definitions and Theory 427
6.2.1 Preliminary Theory 429
Trang 96.2.2 Linear Systems 446
6.3 Homogeneous Linear Systems with Constant Coefficients 454
6.3.1 Distinct Real Eigenvalues 454
6.3.2 Complex Conjugate Eigenvalues 461
6.3.3 Alternate Method for Solving Initial-Value Problems 474
6.3.4 Repeated Eigenvalues 477
6.4 Nonhomogeneous First-Order Systems: Undetermined Coefficients, Variation of Parameters, and the Matrix Exponential 485 6.4.1 Undetermined Coefficients 485
6.4.2 Variation of Parameters 490
6.4.3 The Matrix Exponential 498
6.5 Numerical Methods 506
6.5.1 Built-In Methods 506
Application: Controlling the Spread of a Disease 513
6.5.2 Euler’s Method 525
6.5.3 Runge–Kutta Method 531
6.6 Nonlinear Systems, Linearization, and Classification of Equilibrium Points 535
6.6.1 Real Distinct Eigenvalues 535
6.6.2 Repeated Eigenvalues 543
6.6.3 Complex Conjugate Eigenvalues 548
6.6.4 Nonlinear Systems 552
7 Applications of Systems of Ordinary Differential Equations 567
7.1 Mechanical and Electrical Problems with First-Order Linear Systems 567
7.1.1 L –R–C Circuits with Loops 567
7.1.2 L–R–C Circuit with One Loop 568
7.1.3 L –R–C Circuit with Two Loops 571
7.1.4 Spring–Mass Systems 574
7.2 Diffusion and Population Problems with First-Order Linear Systems 576
7.2.1 Diffusion through a Membrane 576
7.2.2 Diffusion through a Double-Walled Membrane 578
7.2.3 Population Problems 583
7.3 Applications that Lead to Nonlinear Systems 587
7.3.1 Biological Systems: Predator–Prey Interactions, The Lotka–Volterra System, and Food Chains in the Chemostat 587
Trang 107.3.2 Physical Systems: Variable Damping 604
7.3.3 Differential Geometry: Curvature 611
8 Laplace Transform Methods 617
8.1 The Laplace Transform 618
8.1.1 Definition of the Laplace Transform 618
8.1.2 Exponential Order 621
8.1.3 Properties of the Laplace Transform 623
8.2 The Inverse Laplace Transform 629
8.2.1 Definition of the Inverse Laplace Transform 629
8.2.2 Laplace Transform of an Integral 635
8.3 Solving Initial-Value Problems with the Laplace Transform 637
8.4 Laplace Transforms of Step and Periodic Functions 645
8.4.1 Piecewise-Defined Functions: The Unit Step Function 645
8.4.2 Solving Initial-Value Problems 649
8.4.3 Periodic Functions 652
8.4.4 Impulse Functions: The Delta Function 661
8.5 The Convolution Theorem 667
8.5.1 The Convolution Theorem 667
8.5.2 Integral and Integrodifferential Equations 669
8.6 Applications of Laplace Transforms, Part I 672
8.6.1 Spring–Mass Systems Revisited 672
8.6.2 L–R–C Circuits Revisited 679
8.6.3 Population Problems Revisited 687
Application: The Tautochrone 689
8.7 Laplace Transform Methods for Systems 691
8.8 Applications of Laplace Transforms, Part II 708
8.8.1 Coupled Spring–Mass Systems 708
8.8.2 The Double Pendulum 714
Application: Free Vibration of a Three-Story Building 720
9 Eigenvalue Problems and Fourier Series 727
9.1 Boundary-Value Problems, Eigenvalue Problems, Sturm–Liouville Problems 727
9.1.1 Boundary-Value Problems 727
Trang 119.1.2 Eigenvalue Problems 730
9.1.3 Sturm–Liouville Problems 735
9.2 Fourier Sine Series and Cosine Series 737
9.2.1 Fourier Sine Series 737
9.2.2 Fourier Cosine Series 746
9.3 Fourier Series 749
9.3.1 Fourier Series 749
9.3.2 Even, Odd, and Periodic Extensions 758
9.3.3 Differentiation and Integration of Fourier Series 764
9.3.4 Parseval’s Equality 768
9.4 Generalized Fourier Series 770
10 Partial Differential Equations 783
10.1 Introduction to Partial Differential Equations and Separation of Variables 783
10.1.1 Introduction 783
10.1.2 Separation of Variables 785
10.2 The One-Dimensional Heat Equation 787
10.2.1 The Heat Equation with Homogeneous Boundary Conditions 787
10.2.2 Nonhomogeneous Boundary Conditions 791
10.2.3 Insulated Boundary 795
10.3 The One-Dimensional Wave Equation 799
10.3.1 The Wave Equation 799
10.3.2 D’Alembert’s Solution 806
10.4 Problems in Two Dimensions: Laplace’s Equation 810
10.4.1 Laplace’s Equation 810
10.5 Two-Dimensional Problems in a Circular Region 817
10.5.1 Laplace’s Equation in a Circular Region 817
10.5.2 The Wave Equation in a Circular Region 821
10.5.3 Other Partial Differential Equations 836
Appendix: Getting Started 841
Introduction to Mathematica 841
A Note Regarding Different Versions of Mathematica 843
Getting Started with Mathematica 843
Five Basic Rules of Mathematica Syntax 849
Trang 12Loading Packages 850
A Word of Caution 853
Getting Help from Mathematica 854
Mathematica Help 858
The Mathematica Menu 863
Bibliography 865
Index 867
Trang 14Mathematica’s diversity makes it particularly well suited to performing many
cal-culations encountered when solving many ordinary and partial differential
equa-tions In some cases, Mathematica’s built-in functions can immediately solve a
differential equation by providing an explicit, implicit, or numerical solution; in
other cases, Mathematica can be used to perform the calculations encountered
when solving a differential equation Because one goal of elementary differential
equations courses is to introduce students to basic methods and algorithms and
have the student gain proficiency in them, nearly every topic covered in
Differ-ential Equations with Mathematica, Third Edition, includes typical examples solved
by traditional methods and examples solved using Mathematica Differential
Equa-tions with Mathematica introduces basic commands and includes typical examples
of applications of them A study of differential equations relies on concepts from
calculus and linear algebra so the text also includes discussions of relevant
com-mands useful in those areas In many cases, seeing a solution graphically is most
meaningful so Differential Equations with Mathematica relies heavily on
Mathemat-ica’s outstanding graphics capabilities
Differential Equations with Mathematica is an appropriate reference for all users of
Mathematica who encounter differential equations in their profession, in
particu-lar, for beginning users like students, instructors, engineers, business people, and
other professionals using Mathematica to solve and visualize solutions to
differ-ential equations Differdiffer-ential Equations with Mathematica is a valuable supplement
for students and instructors at engineering schools that use Mathematica
Taking advantage of Version 5 of Mathematica, Differential Equations with
Math-ematica, Third Edition, introduces the fundamental concepts of Mathematica to
xiii
Trang 15solve (analytically, numerically, and/or graphically) differential equations of
inter-est to students, instructors, and scientists Other features to help make Differential
Equations with Mathematica, Third Edition, as easy to use and as useful as possible
include the following
1 Version 5 Compatibility All examples illustrated in Differential Equations
with Mathematica, Third Edition, were completed using Version 5 of
Math-ematica Although most computations can continue to be carried out withearlier versions of Mathematica, like Versions 2, 3, and 4, we have takenadvantage of the new features in Version 5 as much as possible
2 Applications New applications, many of which are documented by
ref-erences, from a variety of fields, especially biology, physics, and ing, are included throughout the text
engineer-3 Detailed Table of Contents The table of contents includes all chapter,
section, and subsection headings Along with the comprehensive index,
we hope that users will be able to locate information quickly and easily
4 Additional Examples We have considerably expanded the topics in
Chap-ters 1 through 6 The results should be more useful to instructors, students,business people, engineers, and other professionals using Mathematica on
a variety of platforms In addition, several sections have been added tohelp make locating information easier for the user
5 Comprehensive Index In the index, mathematical examples and
appli-cations are listed by topic, or name, as well as commands along with quently used options: particular mathematical examples as well asexamples illustrating how to use frequently used commands are easy tolocate In addition, commands in the index are cross-referenced with fre-quently used options Functions available in the various packages arecross-referenced both by package and alphabetically
fre-6 Included CD All Mathematica code that appears in Differential Equations
with Mathematica, Third Edition, is included on the CD packaged with the
text
7 Getting Started The Appendix provides a brief introduction to
Mathe-matica, including discussion about entering and evaluating commands,loading packages, and taking advantage of Mathematica’s extensive help
facilities Appropriate references to The Mathematica Book are included as
well
We began Differential Equations with Mathematica in 1990 and the first edition was
published in 1991 Back then, we were on top of the world using Macintosh IIcx’swith 8 megs of RAM and 40 meg hard drives We tried to choose examples that wethought would be relevant to typical users — typically in the context of differentialequations encountered in the undergraduate curriculum Those examples could
Trang 16also be carried out by Mathematica in a timely manner on a computer as powerful
as a Macintosh IIcx
Now, we are on top of the world with Power Macintosh G4’s with 768 megs
of RAM and 50 gig hard drives, which will almost certainly be obsolete by the
time you are reading this The examples presented in Differential Equations with
Mathematica continue to be the ones that we think are most similar to the
prob-lems encountered by beginning users and are presented in the context of someone
familiar with mathematics typically encountered by undergraduates However,
for this third edition of Differential Equations with Mathematica we have taken the
opportunity to expand on several of our favorite examples because the machines
now have the speed and power to explore them in greater detail
Other improvements to the third edition include:
1 Throughout the text, we have attempted to eliminate redundant examples
and added several interesting ones The following changes are especially
worth noting
(a) In Chapter 2, First-Order Ordinary Differential Equations, we present
the integrating factor approach, variation of parameters, and method
of undetermined coefficients when solving first-order linear equations
(b) In Chapter 3, we discuss the Logistic difference equation and give
some surprisingly simple ways to generate the classic “Pitchfork
dia-gram” with Mathematica
(c) Chapter 4, Higher-Order Equations, has been completely reorganized;
a new section on nonlinear equations has been added
(d) Chapter 5, Applications of Higher-Order Equations, has also been
completely reorganized The catenary is now included in the Other
Applications section
(e) Chapter 6, Systems of Ordinary Differential Equations, includes
sev-eral new examples See especially Example 6.2.5
(f) Chapter 7, Applications of Systems, includes several new examples
See especially Examples 7.3.3, 7.3.4, and 7.3.6
(g) We have included references that we find particularly interesting in
the Bibliography, even if they are not specific Mathematica-related
texts A comprehensive list of Mathematica-related publications can
be found at the Wolfram website
http://store.wolfram.com/catalog/books/
Finally, we must express our appreciation to those who assisted in this project
We would like to express appreciation to our editors, Tom Singer and Barbara
Holland, and our production editor, Brandy Palacios, at Academic Press for
pro-viding a pleasant environment in which to work In addition, Wolfram Research,
Trang 17especially Misty Mosely, have been most helpful in providing us up-to-date mation about Mathematica Finally, we thank those close to us, especially ImogeneAbell, Lori Braselton, Ada Braselton, and Mattie Braselton for enduring with usthe pressures of meeting a deadline and for graciously accepting our demandingwork schedules We certainly could not have completed this task without theircare and understanding.
Trang 18Equations
The purpose of Differential Equations with Mathematica, Third Edition, is twofold.
First, we introduce and discuss the topics covered in typical undergraduate and
beginning graduate courses in ordinary and partial differential equations
includ-ing topics such as Laplace transforms, Fourier series, eigenvalue problems, and
boundary-value problems Second, we illustrate how Mathematica is used to
enhance the study of differential equations not only by eliminating the
compu-tational difficulties, but also by overcoming the visual limitations associated with
the explicit solutions to differential equations, which are often quite complicated
In each chapter, we first briefly present the material in a manner similar to most
differential equations texts and then illustrate how Mathematica can be used to
solve some typical problems For example, in Chapter 2, we introduce the topic
of first-order equations First, we show how to solve certain types of problems by
hand and then show how Mathematica can be used to assist in the same
solu-tion procedures Finally, we illustrate how Mathematica commands like DSolve
and NDSolve can be used to solve some frequently encountered equations exactly
and/or numerically In Chapter 3 we discuss some applications of first-order
equa-tions Since we are experienced and understand the methods of solution covered
in Chapter 2, we make use of DSolve and similar commands to obtain solutions
In doing so, we are able to emphasize the applications themselves as opposed to
becoming bogged down in calculations
The advantages of using Mathematica in the study of differential equations
are numerous, but perhaps the most useful is that of being able to produce the
graphics associated with solutions of differential equations This is particularly
beneficial in the discussion of applications because many physical situations are
1
Trang 19modeled with differential equations For example, we will see that the motion of apendulum 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 pendulummove 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 differentialequations becomes much more meaningful as well as interesting
If you are a beginning Mathematica user and, especially, new to Version 5.0, theNumerous references like
Abell and Braselton’s
Although Chapter 1 is short in length, Chapter 1 introduces examples that will
be investigated in subsequent chapters Also, the vocabulary introduced in ter 1 will be used throughout the text Consequently, even though, to a large extent,
Chap-it may be read quickly, subsequent chapters will take advantage of the ogy and techniques discussed here
terminol-1.1 Definitions and Concepts
We begin our study of differential equations by explaining what a differentialequation is
Definition 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/ y2cos y and dy/dx du/dx u x2y
are examples of ordinary differential equations.
The equationy1dxx cos y dy 1 is an ordinary differential equation written in differential form.
Using prime notation, a solution of the ordinary differential equation xy
xy x2 n2 y 0, which is called Bessel’s equation, is a function y
y x with the property that x d2y/ dx2 x dy/dx x2 n2 y is identically
the 0 function
Trang 20On the other hand,
where a, b, m, and n are positive constants, is a system of two ordinary
differential equations, called the predator–prey equations A solution 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.
consists of two functions x xt and y yt 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
com-petition between two organisms, with population densities x1 and x2,
Theory of the Chemostat [24]
for a detailed discussion of chemostat models.
where denotes differentiation with respect to t; S St, x1 x1t,
and x2 x2t For equations (1.2), we remark that S denotes the
con-centration of the nutrient available to the competitors with population
densities x1and 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
an unknown function, equations like u u
solution would be a function u ux, y such that u xx u yyis identically
the 0 function A solution u ux, t of the wave equation is a function
satisfying 2u
t2 2u
x2
Trang 21The partial differential equation u
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 first level
of classification, distinguishing between ordinary and partial differential equations, was discussed above Generally, equations with higher order are more difficult to solve than those with lower order.
Definition 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
differen-tial equations: (a) dy/ dx x2/ y2cos y; (b) u xx u yy 0; (c) dy/dx4 yx; and (d) y3 dy/dx 1.
derivative it includes is a first-order derivative, dy/ dx (b) This
equa-tion is classified as second-order because the highest-order derivatives,
both u xx, representing 2u/ x2, and u yy, representing 2u/ ... differential equations, was discussed above Generally, equations with higher order are more difficult to solve than those with lower order.
Definition (Order). The order of a differential. .. that are modeled with more than one equationand involve more than one dependent variable
nat-1.2 Solutions of Differential Equations< /b>
When faced with a differential. .. respectively) so are nonlinear systems
of ordinary differential equations< /b>
We will see that linear and nonlinear systems of differential equations arise urally in many physical situations