Introduction to Differential Equations
Lecture notes for MATH 2351/2352
Jeffrey R. Chasnov
The Hong Kong University of
Science and Technology
Department of Mathematics Clear Water Bay, Kowloon
Hong Kong
Copyright cβ 2009β2016 by Jeffrey Robert Chasnov
This work is licensed under the Creative Commons Attribution 3.0 Hong Kong License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/hk/
or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Preface
What follows are my lecture notes for a first course in differential equations, taught at the Hong Kong University of Science and Technology. Included in these notes are links to short tutorial videos posted on YouTube.
Much of the material of Chapters 2-6 and 8 has been adapted from the widely used textbook βElementary differential equations and boundary value problemsβ by Boyce & DiPrima (John Wiley & Sons, Inc., Seventh Edition,
β2001). Many of the examples presented in these notes may be found in thisc book. The material of Chapter 7 is adapted from the textbook βNonlinear dynamics and chaosβ by Steven H. Strogatz (Perseus Publishing, cβ1994).
All web surfers are welcome to download these notes, watch the YouTube videos, and to use the notes and videos freely for teaching and learning. An associated free review book with links to YouTube videos is also available from the ebook publisher bookboon.com. I welcome any comments, suggestions or corrections sent by email to [email protected]. Links to my website, these lecture notes, my YouTube page, and the free ebook from bookboon.com are given below.
Homepage:
http://www.math.ust.hk/~machas YouTube:
https://www.youtube.com/user/jchasnov Lecture notes:
http://www.math.ust.hk/~machas/differential-equations.pdf Bookboon:
http://bookboon.com/en/differential-equations-with-youtube-examples-ebook
iii
Contents
0 A short mathematical review 1
0.1 The trigonometric functions . . . . 1
0.2 The exponential function and the natural logarithm . . . . 1
0.3 Definition of the derivative . . . . 2
0.4 Differentiating a combination of functions . . . . 2
0.4.1 The sum or difference rule . . . . 2
0.4.2 The product rule . . . . 2
0.4.3 The quotient rule . . . . 2
0.4.4 The chain rule . . . . 3
0.5 Differentiating elementary functions . . . . 3
0.5.1 The power rule . . . . 3
0.5.2 Trigonometric functions . . . . 3
0.5.3 Exponential and natural logarithm functions . . . . 3
0.6 Definition of the integral . . . . 3
0.7 The fundamental theorem of calculus . . . . 4
0.8 Definite and indefinite integrals . . . . 5
0.9 Indefinite integrals of elementary functions . . . . 5
0.10 Substitution . . . . 6
0.11 Integration by parts . . . . 6
0.12 Taylor series . . . . 7
0.13 Complex numbers . . . . 8
1 Introduction to odes 11 1.1 The simplest type of differential equation . . . . 11
2 First-order odes 13 2.1 The Euler method . . . . 13
2.2 Separable equations . . . . 14
2.3 Linear equations . . . . 17
2.4 Applications . . . . 20
2.4.1 Compound interest . . . . 20
2.4.2 Chemical reactions . . . . 21
2.4.3 Terminal velocity . . . . 23
2.4.4 Escape velocity . . . . 24
2.4.5 RC circuit . . . . 26
2.4.6 The logistic equation . . . . 27 v
3 Second-order odes, constant coefficients 29
3.1 The Euler method . . . . 29
3.2 The principle of superposition . . . . 30
3.3 The Wronskian . . . . 30
3.4 Homogeneous odes . . . . 31
3.4.1 Real, distinct roots . . . . 32
3.4.2 Complex conjugate, distinct roots . . . . 34
3.4.3 Repeated roots . . . . 36
3.5 Inhomogeneous odes . . . . 37
3.6 First-order linear inhomogeneous odes revisited . . . . 41
3.7 Resonance . . . . 42
3.8 Damped resonance . . . . 44
4 The Laplace transform 47 4.1 Definition and properties . . . . 47
4.2 Solution of initial value problems . . . . 51
4.3 Heaviside and Dirac delta functions . . . . 54
4.3.1 Heaviside function . . . . 54
4.3.2 Dirac delta function . . . . 56
4.4 Discontinuous or impulsive terms . . . . 57
5 Series solutions 61 5.1 Ordinary points . . . . 61
5.2 Regular singular points: Cauchy-Euler equations . . . . 65
5.2.1 Real, distinct roots . . . . 67
5.2.2 Complex conjugate roots . . . . 67
5.2.3 Repeated roots . . . . 67
6 Systems of equations 69 6.1 Determinants and the eigenvalue problem . . . . 69
6.2 Coupled first-order equations . . . . 71
6.2.1 Two distinct real eigenvalues . . . . 71
6.2.2 Complex conjugate eigenvalues . . . . 75
6.2.3 Repeated eigenvalues with one eigenvector . . . . 77
6.3 Normal modes . . . . 79
7 Nonlinear differential equations 83 7.1 Fixed points and stability . . . . 83
7.1.1 One dimension . . . . 83
7.1.2 Two dimensions . . . . 84
7.2 One-dimensional bifurcations . . . . 87
7.2.1 Saddle-node bifurcation . . . . 87
7.2.2 Transcritical bifurcation . . . . 88
7.2.3 Supercritical pitchfork bifurcation . . . . 89
7.2.4 Subcritical pitchfork bifurcation . . . . 90
7.2.5 Application: a mathematical model of a fishery . . . . 92
7.3 Two-dimensional bifurcations . . . . 94
7.3.1 Supercritical Hopf bifurcation . . . . 94
7.3.2 Subcritical Hopf bifurcation . . . . 95
CONTENTS vii
8 Partial differential equations 97
8.1 Derivation of the diffusion equation . . . . 97
8.2 Derivation of the wave equation . . . . 98
8.3 Fourier series . . . 100
8.4 Fourier cosine and sine series . . . 102
8.5 Solution of the diffusion equation . . . 105
8.5.1 Homogeneous boundary conditions . . . 105
8.5.2 Inhomogeneous boundary conditions . . . 108
8.5.3 Pipe with closed ends . . . 109
8.6 Solution of the wave equation . . . 112
8.6.1 Plucked string . . . 112
8.6.2 Hammered string . . . 114
8.6.3 General initial conditions . . . 115
8.7 The Laplace equation . . . 115
8.7.1 Dirichlet problem for a rectangle . . . 116
8.7.2 Dirichlet problem for a circle . . . 117
Chapter 0
A short mathematical review
A basic understanding of calculus is required to undertake a study of differential equations. This zero chapter presents a short review.
0.1 The trigonometric functions
The Pythagorean trigonometric identity is sin2π₯ + cos2π₯ = 1, and the addition theorems are
sin(π₯ + π¦) = sin(π₯) cos(π¦) + cos(π₯) sin(π¦), cos(π₯ + π¦) = cos(π₯) cos(π¦) β sin(π₯) sin(π¦).
Also, the values of sin π₯ in the first quadrant can be remembered by the rule of quarters, with 0β= 0, 30β= π/6, 45β= π/4, 60β= π/3, 90β= π/2:
sin 0β=
βοΈ0
4, sin 30β=
βοΈ1
4, sin 45β=
βοΈ2 4, sin 60β=
βοΈ3
4, sin 90β=
βοΈ4 4. The following symmetry properties are also useful:
sin(π/2 β π₯) = cos π₯, cos(π/2 β π₯) = sin π₯;
and
sin(βπ₯) = β sin(π₯), cos(βπ₯) = cos(π₯).
0.2 The exponential function and the natural logarithm
The transcendental number π, approximately 2.71828, is defined as π = lim
πββ
(οΈ
1 + 1 π
)οΈπ .
1
The exponential function exp (π₯) = ππ₯ and natural logarithm ln π₯ are inverse functions satisfying
πln π₯= π₯, ln ππ₯= π₯.
The usual rules of exponents apply:
ππ₯ππ¦ = ππ₯+π¦, ππ₯/ππ¦= ππ₯βπ¦, (ππ₯)π= πππ₯. The corresponding rules for the logarithmic function are
ln (π₯π¦) = ln π₯ + ln π¦, ln (π₯/π¦) = ln π₯ β ln π¦, ln π₯π= π ln π₯.
0.3 Definition of the derivative
The derivative of the function π¦ = π (π₯), denoted as πβ²(π₯) or ππ¦/ππ₯, is defined as the slope of the tangent line to the curve π¦ = π (π₯) at the point (π₯, π¦). This slope is obtained by a limit, and is defined as
πβ²(π₯) = lim
ββ0
π (π₯ + β) β π (π₯)
β . (1)
0.4 Differentiating a combination of functions
0.4.1 The sum or difference rule
The derivative of the sum of π (π₯) and π(π₯) is (π + π)β² = πβ²+ πβ². Similarly, the derivative of the difference is
(π β π)β² = πβ²β πβ².
0.4.2 The product rule
The derivative of the product of π (π₯) and π(π₯) is (π π)β²= πβ²π + π πβ²,
and should be memorized as βthe derivative of the first times the second plus the first times the derivative of the second.β
0.4.3 The quotient rule
The derivative of the quotient of π (π₯) and π(π₯) is (οΈ π
π )οΈβ²
=πβ²π β π πβ² π2 ,
and should be memorized as βthe derivative of the top times the bottom minus the top times the derivative of the bottom over the bottom squared.β
0.5. DIFFERENTIATING ELEMENTARY FUNCTIONS 3
0.4.4 The chain rule
The derivative of the composition of π (π₯) and π(π₯) is (οΈπ(οΈπ(π₯))οΈ)οΈβ²
= πβ²(οΈπ(π₯))οΈ Β· πβ²(π₯),
and should be memorized as βthe derivative of the outside times the derivative of the inside.β
0.5 Differentiating elementary functions
0.5.1 The power rule
The derivative of a power of π₯ is given by π
ππ₯π₯π= ππ₯πβ1.
0.5.2 Trigonometric functions
The derivatives of sin π₯ and cos π₯ are
(sin π₯)β²= cos π₯, (cos π₯)β²= β sin π₯.
We thus say that βthe derivative of sine is cosine,β and βthe derivative of cosine is minus sine.β Notice that the second derivatives satisfy
(sin π₯)β²β²= β sin π₯, (cos π₯)β²β²= β cos π₯.
0.5.3 Exponential and natural logarithm functions
The derivative of ππ₯ and ln π₯ are
(ππ₯)β²= ππ₯, (ln π₯)β²= 1 π₯.
0.6 Definition of the integral
The definite integral of a function π (π₯) > 0 from π₯ = π to π (π > π) is defined as the area bounded by the vertical lines π₯ = π, π₯ = π, the x-axis and the curve π¦ = π (π₯). This βarea under the curveβ is obtained by a limit. First, the area is approximated by a sum of rectangle areas. Second, the integral is defined to be the limit of the rectangle areas as the width of each individual rectangle goes to zero and the number of rectangles goes to infinity. This resulting infinite sum is called a Riemann Sum, and we define
β«οΈ π π
π (π₯)ππ₯ = lim
ββ0 π
βοΈ
π=1
π(οΈπ + (π β 1)β)οΈ Β· β, (2)
where π = (π β π)/β is the number of terms in the sum. The symbols on the left-hand-side of (2) are read as βthe integral from π to π of f of x dee x.β The
Riemann Sum definition is extended to all values of π and π and for all values of π (π₯) (positive and negative). Accordingly,
β«οΈ π π
π (π₯)ππ₯ = β
β«οΈ π π
π (π₯)ππ₯ and
β«οΈ π π
(βπ (π₯))ππ₯ = β
β«οΈ π π
π (π₯)ππ₯.
Also, if π < π < π, then
β«οΈ π π
π (π₯)ππ₯ =
β«οΈ π π
π (π₯)ππ₯ +
β«οΈ π π
π (π₯)ππ₯,
which states (when π (π₯) > 0) that the total area equals the sum of its parts.
0.7 The fundamental theorem of calculus
view tutorial
Using the definition of the derivative, we differentiate the following integral:
π ππ₯
β«οΈ π₯ π
π (π )ππ = lim
ββ0
β«οΈπ₯+β
π π (π )ππ ββ«οΈπ₯ π π (π )ππ β
= lim
ββ0
β«οΈπ₯+β π₯ π (π )ππ
β
= lim
ββ0
βπ (π₯) β
= π (π₯).
This result is called the fundamental theorem of calculus, and provides a con- nection between differentiation and integration.
The fundamental theorem teaches us how to integrate functions. Let πΉ (π₯) be a function such that πΉβ²(π₯) = π (π₯). We say that πΉ (π₯) is an antiderivative of π (π₯). Then from the fundamental theorem and the fact that the derivative of a constant equals zero,
πΉ (π₯) =
β«οΈ π₯ π
π (π )ππ + π.
Now, πΉ (π) = π and πΉ (π) = β«οΈπ
π π (π )ππ + πΉ (π). Therefore, the fundamental theorem shows us how to integrate a function π (π₯) provided we can find its antiderivative:
β«οΈ π π
π (π )ππ = πΉ (π) β πΉ (π). (3)
Unfortunately, finding antiderivatives is much harder than finding derivatives, and indeed, most complicated functions cannot be integrated analytically.
We can also derive the very important result (3) directly from the definition of the derivative (1) and the definite integral (2). We will see it is convenient
0.8. DEFINITE AND INDEFINITE INTEGRALS 5 to choose the same β in both limits. With πΉβ²(π₯) = π (π₯), we have
β«οΈ π π
π (π )ππ =
β«οΈ π π
πΉβ²(π )ππ
= lim
ββ0 π
βοΈ
π=1
πΉβ²(οΈπ + (π β 1)β)οΈ Β· β
= lim
ββ0 π
βοΈ
π=1
πΉ (π + πβ) β πΉ(οΈπ + (π β 1)β)οΈ
β Β· β
= lim
ββ0 π
βοΈ
π=1
πΉ (π + πβ) β πΉ(οΈπ + (π β 1)β)οΈ.
The last expression has an interesting structure. All the values of πΉ (π₯) eval- uated at the points lying between the endpoints π and π cancel each other in consecutive terms. Only the value βπΉ (π) survives when π = 1, and the value +πΉ (π) when π = π , yielding again (3).
0.8 Definite and indefinite integrals
The Riemann sum definition of an integral is called a definite integral. It is convenient to also define an indefinite integral by
β«οΈ
π (π₯)ππ₯ = πΉ (π₯), where F(x) is the antiderivative of π (π₯).
0.9 Indefinite integrals of elementary functions
From our known derivatives of elementary functions, we can determine some simple indefinite integrals. The power rule gives us
β«οΈ
π₯πππ₯ = π₯π+1
π + 1+ π, π ΜΈ= β1.
When π = β1, and π₯ is positive, we have
β«οΈ 1
π₯ππ₯ = ln π₯ + π.
If π₯ is negative, using the chain rule we have π
ππ₯ln (βπ₯) = 1 π₯. Therefore, since
|π₯| =
{οΈ βπ₯ if π₯ < 0;
π₯ if π₯ > 0,
we can generalize our indefinite integral to strictly positive or strictly negative
π₯: β«οΈ 1
π₯ππ₯ = ln |π₯| + π.
Trigonometric functions can also be integrated:
β«οΈ
cos π₯ππ₯ = sin π₯ + π,
β«οΈ
sin π₯ππ₯ = β cos π₯ + π.
Easily proved identities are an addition rule:
β«οΈ
(οΈπ (π₯) + π(π₯))οΈππ₯ =
β«οΈ
π (π₯)ππ₯ +
β«οΈ
π(π₯)ππ₯;
and multiplication by a constant:
β«οΈ
π΄π (π₯)ππ₯ = π΄
β«οΈ
π (π₯)ππ₯.
This permits integration of functions such as
β«οΈ
(π₯2+ 7π₯ + 2)ππ₯ =π₯3 3 +7π₯2
2 + 2π₯ + π,
and β«οΈ
(5 cos π₯ + sin π₯)ππ₯ = 5 sin π₯ β cos π₯ + π.
0.10 Substitution
More complicated functions can be integrated using the chain rule. Since π
ππ₯π(οΈπ(π₯))οΈ = πβ²(οΈπ(π₯))οΈ Β· πβ²(π₯), we have
β«οΈ
πβ²(οΈπ(π₯))οΈ Β· πβ²(π₯)ππ₯ = π(οΈπ(π₯))οΈ + π.
This integration formula is usually implemented by letting π¦ = π(π₯). Then one writes ππ¦ = πβ²(π₯)ππ₯ to obtain
β«οΈ
πβ²(οΈπ(π₯))οΈπβ²(π₯)ππ₯ =
β«οΈ
πβ²(π¦)ππ¦
= π (π¦) + π
= π(οΈπ(π₯))οΈ + π.
0.11 Integration by parts
Another integration technique makes use of the product rule for differentiation.
Since
(π π)β²= πβ²π + π πβ², we have
πβ²π = (π π)β²β π πβ². Therefore,
β«οΈ
πβ²(π₯)π(π₯)ππ₯ = π (π₯)π(π₯) β
β«οΈ
π (π₯)πβ²(π₯)ππ₯.
0.12. TAYLOR SERIES 7 Commonly, the above integral is done by writing
π’ = π(π₯) ππ£ = πβ²(π₯)ππ₯ ππ’ = πβ²(π₯)ππ₯ π£ = π (π₯).
Then, the formula to be memorized is
β«οΈ
π’ππ£ = π’π£ β
β«οΈ
π£ππ’.
0.12 Taylor series
A Taylor series of a function π (π₯) about a point π₯ = π is a power series rep- resentation of π (π₯) developed so that all the derivatives of π (π₯) at π match all the derivatives of the power series. Without worrying about convergence here, we have
π (π₯) = π (π) + πβ²(π)(π₯ β π) +πβ²β²(π)
2! (π₯ β π)2+πβ²β²β²(π)
3! (π₯ β π)3+ . . . . Notice that the first term in the power series matches π (π), all other terms vanishing, the second term matches πβ²(π), all other terms vanishing, etc. Com- monly, the Taylor series is developed with π = 0. We will also make use of the Taylor series in a slightly different form, with π₯ = π₯*+ π and π = π₯*:
π (π₯*+ π) = π (π₯*) + πβ²(π₯*)π +πβ²β²(π₯*)
2! π2+πβ²β²β²(π₯*)
3! π3+ . . . .
Another way to view this series is that of π(π) = π (π₯*+ π), expanded about π = 0.
Taylor series that are commonly used include ππ₯= 1 + π₯ +π₯2
2! +π₯3 3! + . . . , sin π₯ = π₯ βπ₯3
3! +π₯5 5! β . . . , cos π₯ = 1 βπ₯2
2! +π₯4 4! β . . . , 1
1 + π₯ = 1 β π₯ + π₯2β . . . , for |π₯| < 1, ln (1 + π₯) = π₯ βπ₯2
2 +π₯3
3 β . . . , for |π₯| < 1.
A Taylor series of a function of several variables can also be developed. Here, all partial derivatives of π (π₯, π¦) at (π, π) match all the partial derivatives of the power series. With the notation
ππ₯=ππ
ππ₯, ππ¦ =ππ
ππ¦, ππ₯π₯= π2π
ππ₯2, ππ₯π¦= π2π
ππ₯ππ¦, ππ¦π¦ = π2π
ππ¦2, etc., we have
π (π₯, π¦) = π (π, π) + ππ₯(π, π)(π₯ β π) + ππ¦(π, π)(π¦ β π) + 1
2!(οΈππ₯π₯(π, π)(π₯ β π)2+ 2ππ₯π¦(π, π)(π₯ β π)(π¦ β π) + ππ¦π¦(π, π)(π¦ β π)2)οΈ + . . .
0.13 Complex numbers
view tutorial: Complex Numbers view tutorial: Complex Exponential Function
We define the imaginary number π to be one of the two numbers that satisfies the rule (π)2= β1, the other number being βπ. Formally, we write π =β
β1. A complex number π§ is written as
π§ = π₯ + ππ¦,
where π₯ and π¦ are real numbers. We call π₯ the real part of π§ and π¦ the imaginary part and write
π₯ = Re π§, π¦ = Im π§.
Two complex numbers are equal if and only if their real and imaginary parts are equal.
The complex conjugate of π§ = π₯ + ππ¦, denoted as Β―π§, is defined as
Β―
π§ = π₯ β ππ¦.
Using π§ and Β―π§, we have Re π§ = 1
2(π§ + Β―π§) , Im π§ = 1
2π(π§ β Β―π§) . Furthermore,
π§ Β―π§ = (π₯ + ππ¦)(π₯ β ππ¦)
= π₯2β π2π¦2
= π₯2+ π¦2;
and we define the absolute value of π§, also called the modulus of π§, by
|π§| = (π§ Β―π§)1/2
=βοΈ
π₯2+ π¦2.
We can add, subtract, multiply and divide complex numbers to get new complex numbers. With π§ = π₯ + ππ¦ and π€ = π + ππ‘, and π₯, π¦, π , π‘ real numbers, we have
π§ + π€ = (π₯ + π ) + π(π¦ + π‘); π§ β π€ = (π₯ β π ) + π(π¦ β π‘);
π§π€ = (π₯ + ππ¦)(π + ππ‘)
= (π₯π β π¦π‘) + π(π₯π‘ + π¦π );
π§ π€ = π§ Β―π€
π€ Β―π€
= (π₯ + ππ¦)(π β ππ‘) π 2+ π‘2
= (π₯π + π¦π‘)
π 2+ π‘2 + π(π¦π β π₯π‘) π 2+ π‘2 .
0.13. COMPLEX NUMBERS 9 Furthermore,
|π§π€| =βοΈ
(π₯π β π¦π‘)2+ (π₯π‘ + π¦π )2
=βοΈ
(π₯2+ π¦2)(π 2+ π‘2)
= |π§||π€|;
and
π§π€ = (π₯π β π¦π‘) β π(π₯π‘ + π¦π )
= (π₯ β ππ¦)(π β ππ‘)
= Β―π§ Β―π€.
Similarly
β
β
β π§ π€
β
β
β= |π§|
|π€|, (π§ π€) = π§Β―
Β― π€.
Also, π§ + π€ = π§ + π€. However, |π§ + π€| β€ |π§| + |π€|, a theorem known as the triangle inequality.
It is especially interesting and useful to consider the exponential function of an imaginary argument. Using the Taylor series expansion of an exponential function, we have
πππ= 1 + (ππ) +(ππ)2
2! +(ππ)3
3! +(ππ)4
4! +(ππ)5 5! . . .
= (οΈ
1 β π2 2! +π4
4! β . . . )οΈ
+ π (οΈ
π βπ3 3! +π5
5! + . . . )οΈ
= cos π + π sin π.
Therefore, we have
cos π = Re πππ, sin π = Im πππ.
Since cos π = β1 and sin π = 0, we derive the celebrated Eulerβs identity πππ+ 1 = 0,
that links five fundamental numbers, 0, 1, π, π and π, using three basic mathe- matical operations, addition, multiplication and exponentiation, only once.
Using the even property cos (βπ) = cos π and the odd property sin (βπ) =
β sin π, we also have
πβππ= cos π β π sin π;
and the identities for πππ and πβππ results in the frequently used expressions, cos π =πππ+ πβππ
2 , sin π = πππβ πβππ 2π .
The complex number π§ can be represented in the complex plane with Re π§ as the π₯-axis and Im π§ as the π¦-axis. This leads to the polar representation of π§ = π₯ + ππ¦:
π§ = ππππ,
where π = |π§| and tan π = π¦/π₯. We define arg π§ = π. Note that π is not unique, though it is conventional to choose the value such that βπ < π β€ π, and π = 0 when π = 0.
Useful trigonometric relations can be derived using πππand properties of the exponential function. The addition law can be derived from
ππ(π₯+π¦)= πππ₯πππ¦. We have
cos(π₯ + π¦) + π sin(π₯ + π¦) = (cos π₯ + π sin π₯)(cos π¦ + π sin π¦)
= (cos π₯ cos π¦ β sin π₯ sin π¦) + π(sin π₯ cos π¦ + cos π₯ sin π¦);
yielding
cos(π₯ + π¦) = cos π₯ cos π¦ β sin π₯ sin π¦, sin(π₯ + π¦) = sin π₯ cos π¦ + cos π₯ sin π¦.
De Moivreβs Theorem derives from ππππ = (πππ)π, yielding the identity cos(ππ) + π sin(ππ) = (cos π + π sin π)π.
For example, if π = 2, we derive
cos 2π + π sin 2π = (cos π + π sin π)2
= (cos2π β sin2π) + 2π cos π sin π.
Therefore,
cos 2π = cos2π β sin2π, sin 2π = 2 cos π sin π.
With a little more manipulation using cos2π + sin2π = 1, we can derive cos2π = 1 + cos 2π
2 , sin2π = 1 β cos 2π
2 ,
which are useful formulas for determining
β«οΈ
cos2π ππ = 1
4(2π + sin 2π) + π,
β«οΈ
sin2π ππ = 1
4(2π β sin 2π) + π, from which follows
β«οΈ 2π 0
sin2π ππ =
β«οΈ 2π 0
cos2π ππ = π.
Chapter 1
Introduction to odes
A differential equation is an equation for a function that relates the values of the function to the values of its derivatives. An ordinary differential equation (ode) is a differential equation for a function of a single variable, e.g., π₯(π‘), while a partial differential equation (pde) is a differential equation for a function of several variables, e.g., π£(π₯, π¦, π§, π‘). An ode contains ordinary derivatives and a pde contains partial derivatives. Typically, pdeβs are much harder to solve than odeβs.
1.1 The simplest type of differential equation
view tutorial
The simplest ordinary differential equations can be integrated directly by finding antiderivatives. These simplest odes have the form
πππ₯
ππ‘π = πΊ(π‘),
where the derivative of π₯ = π₯(π‘) can be of any order, and the right-hand-side may depend only on the independent variable π‘. As an example, consider a mass falling under the influence of constant gravity, such as approximately found on the Earthβs surface. Newtonβs law, πΉ = ππ, results in the equation
ππ2π₯
ππ‘2 = βππ,
where π₯ is the height of the object above the ground, π is the mass of the object, and π = 9.8 meter/sec2 is the constant gravitational acceleration. As Galileo suggested, the mass cancels from the equation, and
π2π₯ ππ‘2 = βπ.
Here, the right-hand-side of the ode is a constant. The first integration, obtained by antidifferentiation, yields
ππ₯
ππ‘ = π΄ β ππ‘, 11
with π΄ the first constant of integration; and the second integration yields π₯ = π΅ + π΄π‘ β1
2ππ‘2,
with π΅ the second constant of integration. The two constants of integration π΄ and π΅ can then be determined from the initial conditions. If we know that the initial height of the mass is π₯0, and the initial velocity is π£0, then the initial conditions are
π₯(0) = π₯0, ππ₯
ππ‘(0) = π£0.
Substitution of these initial conditions into the equations for ππ₯/ππ‘ and π₯ allows us to solve for π΄ and π΅. The unique solution that satisfies both the ode and the initial conditions is given by
π₯(π‘) = π₯0+ π£0π‘ β1
2ππ‘2. (1.1)
For example, suppose we drop a ball off the top of a 50 meter building. How long will it take the ball to hit the ground? This question requires solution of (1.1) for the time π it takes for π₯(π ) = 0, given π₯0 = 50 meter and π£0 = 0.
Solving for π ,
π =βοΈ 2π₯0
π
=
βοΈ2 Β· 50 9.8 sec
β 3.2sec.
Chapter 2
First-order differential equations
Reference: Boyce and DiPrima, Chapter 2
The general first-order differential equation for the function π¦ = π¦(π₯) is written
as ππ¦
ππ₯ = π (π₯, π¦), (2.1)
where π (π₯, π¦) can be any function of the independent variable π₯ and the depen- dent variable π¦. We first show how to determine a numerical solution of this equation, and then learn techniques for solving analytically some special forms of (2.1), namely, separable and linear first-order equations.
2.1 The Euler method
view tutorial
Although it is not always possible to find an analytical solution of (2.1) for π¦ = π¦(π₯), it is always possible to determine a unique numerical solution given an initial value π¦(π₯0) = π¦0, and provided π (π₯, π¦) is a well-behaved function.
The differential equation (2.1) gives us the slope π (π₯0, π¦0) of the tangent line to the solution curve π¦ = π¦(π₯) at the point (π₯0, π¦0). With a small step size Ξπ₯, the initial condition (π₯0, π¦0) can be marched forward in the x-coordinate to π₯ = π₯0+ Ξπ₯, and along the tangent line using Eulerβs method to obtain the y-coordinate
π¦(π₯0+ Ξπ₯) = π¦(π₯0) + Ξπ₯π (π₯0, π¦0).
This solution (π₯0+ Ξπ₯, π¦0+ Ξπ¦) then becomes the new initial condition and is marched forward in the x-coordinate another Ξπ₯, and along the newly deter- mined tangent line. For small enough Ξπ₯, the numerical solution converges to the exact solution.
13
2.2 Separable equations
view tutorial
A first-order ode is separable if it can be written in the form π(π¦)ππ¦
ππ₯ = π (π₯), π¦(π₯0) = π¦0, (2.2) where the function π(π¦) is independent of π₯ and π (π₯) is independent of π¦. Inte- gration from π₯0 to π₯ results in
β«οΈ π₯ π₯0
π(π¦(π₯))π¦β²(π₯)ππ₯ =
β«οΈ π₯ π₯0
π (π₯)ππ₯.
The integral on the left can be transformed by substituting π’ = π¦(π₯), ππ’ = π¦β²(π₯)ππ₯, and changing the lower and upper limits of integration to π¦(π₯0) = π¦0 and π¦(π₯) = π¦. Therefore,
β«οΈ π¦ π¦0
π(π’)ππ’ =
β«οΈ π₯ π₯0
π (π₯)ππ₯,
and since π’ is a dummy variable of integration, we can write this in the equivalent form
β«οΈ π¦ π¦0
π(π¦)ππ¦ =
β«οΈ π₯ π₯0
π (π₯)ππ₯. (2.3)
A simpler procedure that also yields (2.3) is to treat ππ¦/ππ₯ in (2.2) like a fraction.
Multiplying (2.2) by ππ₯ results in
π(π¦)ππ¦ = π (π₯)ππ₯,
which is a separated equation with all the dependent variables on the left-side, and all the independent variables on the right-side. Equation (2.3) then results directly upon integration.
Example: Solve ππ¦ππ₯+12π¦ = 32, with π¦(0) = 2.
We first manipulate the differential equation to the form ππ¦
ππ₯ =1
2(3 β π¦), (2.4)
and then treat ππ¦/ππ₯ as if it was a fraction to separate variables:
ππ¦ 3 β π¦ =1
2ππ₯.
We integrate the right-side from the initial condition π₯ = 0 to π₯ and the left-side from the initial condition π¦(0) = 2 to π¦. Accordingly,
β«οΈ π¦ 2
ππ¦ 3 β π¦ =1
2
β«οΈ π₯ 0
ππ₯. (2.5)
2.2. SEPARABLE EQUATIONS 15
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6
x
y
dy/dx + y/2 = 3/2
Figure 2.1: Solution of the following ode: ππ¦ππ₯+12π¦ = 32.
The integrals in (2.5) need to be done. Note that π¦(π₯) < 3 for finite π₯ or the integral on the left-side diverges. Therefore, 3 β π¦ > 0 and integration yields
β ln (3 β π¦)]οΈπ¦ 2=1
2π₯]οΈπ₯ 0, ln (3 β π¦) = β1
2π₯, 3 β π¦ = πβ12π₯, π¦ = 3 β πβ12π₯.
Since this is our first nontrivial analytical solution, it is prudent to check our result. We do this by differentiating our solution:
ππ¦ ππ₯ =1
2πβ12π₯
=1
2(3 β π¦);
and checking the initial conditions, π¦(0) = 3 β π0 = 2. Therefore, our solution satisfies both the original ode and the initial condition.
Example: Solve ππ₯ππ¦ +12π¦ = 32, with π¦(0) = 4.
This is the identical differential equation as before, but with different initial conditions. We will jump directly to the integration step:
β«οΈ π¦ 4
ππ¦ 3 β π¦ = 1
2
β«οΈ π₯ 0
ππ₯.
Now π¦(π₯) > 3, so that π¦ β 3 > 0 and integration yields
β ln (π¦ β 3)]οΈπ¦ 4= 1
2π₯]οΈπ₯ 0, ln (π¦ β 3) = β1
2π₯, π¦ β 3 = πβ12π₯, π¦ = 3 + πβ12π₯.
The solution curves for a range of initial conditions is presented in Fig. 2.1.
All solutions have a horizontal asymptote at π¦ = 3 at which ππ¦/ππ₯ = 0. For π¦(0) = π¦0, the general solution can be shown to be π¦(π₯) = 3+(π¦0β3) exp(βπ₯/2).
Example: Solve ππ¦ππ₯ = 2 cos 2π₯3+2π¦ , with π¦(0) = β1. (i) For what values of π₯ > 0 does the solution exist? (ii) For what value of π₯ > 0 is π¦(π₯) maximum?
Notice that the solution of the ode may not exist when π¦ = β3/2, since ππ¦/ππ₯ β
β. We separate variables and integrate from initial conditions:
(3 + 2π¦)ππ¦ = 2 cos 2π₯ ππ₯
β«οΈ π¦
β1
(3 + 2π¦)ππ¦ = 2
β«οΈ π₯ 0
cos 2π₯ ππ₯ 3π¦ + π¦2]οΈπ¦
β1= sin 2π₯]οΈπ₯ 0
π¦2+ 3π¦ + 2 β sin 2π₯ = 0 π¦Β±=1
2[β3 Β±β
1 + 4 sin 2π₯].
Solving the quadratic equation for π¦ has introduced a spurious solution that does not satisfy the initial conditions. We test:
π¦Β±(0) = 1
2[β3 Β± 1] = {οΈ -1;
-2.
Only the + root satisfies the initial condition, so that the unique solution to the ode and initial condition is
π¦ = 1
2[β3 +β
1 + 4 sin 2π₯]. (2.6)
To determine (i) the values of π₯ > 0 for which the solution exists, we require 1 + 4 sin 2π₯ β₯ 0,
or
sin 2π₯ β₯ β1
4. (2.7)
Notice that at π₯ = 0, we have sin 2π₯ = 0; at π₯ = π/4, we have sin 2π₯ = 1;
at π₯ = π/2, we have sin 2π₯ = 0; and at π₯ = 3π/4, we have sin 2π₯ = β1 We therefore need to determine the value of π₯ such that sin 2π₯ = β1/4, with π₯ in the range π/2 < π₯ < 3π/4. The solution to the ode will then exist for all π₯ between zero and this value.
2.3. LINEAR EQUATIONS 17
0 0.5 1 1.5
β1.6
β1.4
β1.2
β1
β0.8
β0.6
β0.4
β0.2 0
x
y
(3+2y) dy/dx = 2 cos 2x, y(0) = β1
Figure 2.2: Solution of the following ode: (3 + 2π¦)π¦β²= 2 cos 2π₯, π¦(0) = β1.
To solve sin 2π₯ = β1/4 for π₯ in the interval π/2 < π₯ < 3π/4, one needs to recall the definition of arcsin, or sinβ1, as found on a typical scientific calculator.
The inverse of the function
π (π₯) = sin π₯, βπ/2 β€ π₯ β€ π/2
is denoted by arcsin. The first solution with π₯ > 0 of the equation sin 2π₯ = β1/4 places 2π₯ in the interval (π, 3π/2), so to invert this equation using the arcsine we need to apply the identity sin (π β π₯) = sin π₯, and rewrite sin 2π₯ = β1/4 as sin (π β 2π₯) = β1/4. The solution of this equation may then be found by taking the arcsine, and is
π β 2π₯ = arcsin (β1/4), or
π₯ = 1 2
(οΈ
π + arcsin1 4
)οΈ
.
Therefore the solution exists for 0 β€ π₯ β€ (π + arcsin (1/4)) /2 = 1.6971 . . . , where we have used a calculator value (computing in radians) to find arcsin(0.25) = 0.2527 . . . . At the value (π₯, π¦) = (1.6971 . . . , β3/2), the solution curve ends and ππ¦/ππ₯ becomes infinite.
To determine (ii) the value of π₯ at which π¦ = π¦(π₯) is maximum, we examine (2.6) directly. The value of π¦ will be maximum when sin 2π₯ takes its maximum value over the interval where the solution exists. This will be when 2π₯ = π/2, or π₯ = π/4 = 0.7854 . . . .
The graph of π¦ = π¦(π₯) is shown in Fig. 2.2.
2.3 Linear equations
view tutorial
The first-order linear differential equation (linear in π¦ and its derivative) can be written in the form
ππ¦
ππ₯+ π(π₯)π¦ = π(π₯), (2.8)
with the initial condition π¦(π₯0) = π¦0. Linear first-order equations can be inte- grated using an integrating factor π(π₯). We multiply (2.8) by π(π₯),
π(π₯)[οΈ ππ¦
ππ₯ + π(π₯)π¦ ]οΈ
= π(π₯)π(π₯), (2.9)
and try to determine π(π₯) so that π(π₯)[οΈ ππ¦
ππ₯+ π(π₯)π¦ ]οΈ
= π
ππ₯[π(π₯)π¦]. (2.10)
Equation (2.9) then becomes π
ππ₯[π(π₯)π¦] = π(π₯)π(π₯). (2.11)
Equation (2.11) is easily integrated using π(π₯0) = π0 and π¦(π₯0) = π¦0: π(π₯)π¦ β π0π¦0=
β«οΈ π₯ π₯0
π(π₯)π(π₯)ππ₯, or
π¦ = 1 π(π₯)
(οΈ
π0π¦0+
β«οΈ π₯ π₯0
π(π₯)π(π₯)ππ₯ )οΈ
. (2.12)
It remains to determine π(π₯) from (2.10). Differentiating and expanding (2.10) yields
πππ¦
ππ₯ + πππ¦ = ππ
ππ₯π¦ + πππ¦ ππ₯; and upon simplifying,
ππ
ππ₯ = ππ. (2.13)
Equation (2.13) is separable and can be integrated:
β«οΈ π π0
ππ π =
β«οΈ π₯ π₯0
π(π₯)ππ₯,
ln π π0 =
β«οΈ π₯ π₯0
π(π₯)ππ₯,
π(π₯) = π0exp (οΈβ«οΈ π₯
π₯0
π(π₯)ππ₯ )οΈ
.
Notice that since π0cancels out of (2.12), it is customary to assign π0= 1. The solution to (2.8) satisfying the initial condition π¦(π₯0) = π¦0 is then commonly written as
π¦ = 1 π(π₯)
(οΈ
π¦0+
β«οΈ π₯ π₯0
π(π₯)π(π₯)ππ₯ )οΈ
, with
π(π₯) = exp (οΈβ«οΈ π₯
π₯0
π(π₯)ππ₯ )οΈ
the integrating factor. This important result finds frequent use in applied math- ematics.