Learn the mathematical theory of ordinary differential equations and its application to biological and physical systems.
The Laplace equation Dirichlet problem for a rectangle Dirichlet problem for a circle Introduction to Differential Equations Lecture notes for MATH 2351/2352 Jeffrey R. Chasnov The Hong Kong University of Science and Technology The Hong Kong University of Science and Technology Department of Mathematics Clear Water Bay, Kowloon Hong Kong c 2009–2014 by Jeffrey Robert Chasnov Copyright ○ 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, c 2001). Many of the examples presented in these notes may be found in this ○ book. The material of Chapter 7 is adapted from the textbook “Nonlinear c 1994). dynamics and chaos” by Steven H. Strogatz (Perseus Publishing, ○ 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 jeffrey.chasnov@ust.hk. 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 0.1 The trigonometric functions . . . . . . . . . . . . . . 0.2 The exponential function and the natural logarithm 0.3 Definition of the derivative . . . . . . . . . . . . . . 0.4 Differentiating a combination of functions . . . . . . 0.4.1 The sum or difference rule . . . . . . . . . . . 0.4.2 The product rule . . . . . . . . . . . . . . . . 0.4.3 The quotient rule . . . . . . . . . . . . . . . . 0.4.4 The chain rule . . . . . . . . . . . . . . . . . 0.5 Differentiating elementary functions . . . . . . . . . 0.5.1 The power rule . . . . . . . . . . . . . . . . . 0.5.2 Trigonometric functions . . . . . . . . . . . . 0.5.3 Exponential and natural logarithm functions 0.6 Definition of the integral . . . . . . . . . . . . . . . . 0.7 The fundamental theorem of calculus . . . . . . . . . 0.8 Definite and indefinite integrals . . . . . . . . . . . . 0.9 Indefinite integrals of elementary functions . . . . . . 0.10 Substitution . . . . . . . . . . . . . . . . . . . . . . . 0.11 Integration by parts . . . . . . . . . . . . . . . . . . 0.12 Taylor series . . . . . . . . . . . . . . . . . . . . . . . 0.13 Complex numbers . . . . . . . . . . . . . . . . . . . 1 1 1 2 2 2 2 2 3 3 3 3 3 3 4 5 5 6 6 7 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Introduction to odes 11 1.1 The simplest type of differential equation . . . . . . . . . . . . . 11 2 First-order odes 2.1 The Euler method . . . . . 2.2 Separable equations . . . . 2.3 Linear equations . . . . . . 2.4 Applications . . . . . . . . . 2.4.1 Compound interest . 2.4.2 Chemical reactions . 2.4.3 Terminal velocity . . 2.4.4 Escape velocity . . . 2.4.5 RC circuit . . . . . 2.4.6 The logistic equation 13 13 14 17 20 20 21 23 24 26 27 . . . . . . . . . . . . . . . . . . . . v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi 3 Second-order odes, constant coefficients 3.1 The Euler method . . . . . . . . . . . . . . . . 3.2 The principle of superposition . . . . . . . . . . 3.3 The Wronskian . . . . . . . . . . . . . . . . . . 3.4 Homogeneous odes . . . . . . . . . . . . . . . . 3.4.1 Real, distinct roots . . . . . . . . . . . . 3.4.2 Complex conjugate, distinct roots . . . 3.4.3 Repeated roots . . . . . . . . . . . . . . 3.5 Inhomogeneous odes . . . . . . . . . . . . . . . 3.6 First-order linear inhomogeneous odes revisited 3.7 Resonance . . . . . . . . . . . . . . . . . . . . . 3.8 Damped resonance . . . . . . . . . . . . . . . . 4 The 4.1 4.2 4.3 Laplace transform Definition and properties . . . . . . . Solution of initial value problems . . Heaviside and Dirac delta functions . 4.3.1 Heaviside function . . . . . . 4.3.2 Dirac delta function . . . . . Discontinuous or impulsive terms . . CONTENTS 29 29 30 30 31 32 34 36 37 41 42 44 47 47 51 54 54 56 57 61 61 65 67 67 67 69 69 71 71 75 77 79 83 83 83 84 87 87 88 88 89 92 94 94 95 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Series solutions 5.1 Ordinary points . . . . . . . . . . . . . . . . . . . 5.2 Regular singular points: Cauchy-Euler equations 5.2.1 Real, distinct roots . . . . . . . . . . . . . 5.2.2 Complex conjugate roots . . . . . . . . . 5.2.3 Repeated roots . . . . . . . . . . . . . . . 6 Systems of equations 6.1 Determinants and the eigenvalue problem . . . . 6.2 Coupled first-order equations . . . . . . . . . . . 6.2.1 Two distinct real eigenvalues . . . . . . . 6.2.2 Complex conjugate eigenvalues . . . . . . 6.2.3 Repeated eigenvalues with one eigenvector 6.3 Normal modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Nonlinear differential equations 7.1 Fixed points and stability . . . . . . . . . . . . . . . . 7.1.1 One dimension . . . . . . . . . . . . . . . . . . 7.1.2 Two dimensions . . . . . . . . . . . . . . . . . 7.2 One-dimensional bifurcations . . . . . . . . . . . . . . 7.2.1 Saddle-node bifurcation . . . . . . . . . . . . . 7.2.2 Transcritical bifurcation . . . . . . . . . . . . . 7.2.3 Supercritical pitchfork bifurcation . . . . . . . 7.2.4 Subcritical pitchfork bifurcation . . . . . . . . 7.2.5 Application: a mathematical model of a fishery 7.3 Two-dimensional bifurcations . . . . . . . . . . . . . . 7.3.1 Supercritical Hopf bifurcation . . . . . . . . . . 7.3.2 Subcritical Hopf bifurcation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CONTENTS 8 Partial differential equations 8.1 Derivation of the diffusion equation . . . . . 8.2 Derivation of the wave equation . . . . . . . 8.3 Fourier series . . . . . . . . . . . . . . . . . 8.4 Fourier cosine and sine series . . . . . . . . 8.5 Solution of the diffusion equation . . . . . . 8.5.1 Homogeneous boundary conditions . 8.5.2 Inhomogeneous boundary conditions 8.5.3 Pipe with closed ends . . . . . . . . 8.6 Solution of the wave equation . . . . . . . . 8.6.1 Plucked string . . . . . . . . . . . . 8.6.2 Hammered string . . . . . . . . . . . 8.6.3 General initial conditions . . . . . . 8.7 The Laplace equation . . . . . . . . . . . . 8.7.1 Dirichlet problem for a rectangle . . 8.7.2 Dirichlet problem for a circle . . . . vii 97 97 98 100 102 104 104 108 109 112 112 114 114 115 115 116 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii CONTENTS 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 sin2 �� + cos2 �� = 1, The Pythagorean trigonometric identity is 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: √ √ √ 0 1 2 ∘ ∘ ∘ , sin 30 = , sin 45 = , sin 0 = 4 4 4 √ √ 3 4 sin 60∘ = , sin 90∘ = . 4 4 The following symmetry properties are also useful: sin(��/2 − ��) = cos ��, and sin(−��) = − sin(��), cos(−��) = cos(��). cos(��/2 − ��) = sin ��; 0.2 The exponential function and the natural logarithm The transcendental number ��, approximately 2.71828, is defined as ( )�� 1 �� = lim 1 + . ��→∞ �� 1 2 CHAPTER 0. A SHORT MATHEMATICAL REVIEW 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 �� (�� + ℎ) − �� (��) . ℎ (1) ℎ→0 0.4 0.4.1 Differentiating a combination of functions 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 ( )′ �� ′ �� − �� �� ′ �� = , �� �� 2 The derivative of the quotient of �� (��) and �� (��) is 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 0.5.1 Differentiating elementary functions The power rule �� �� �� = ������−1 . ���� The derivative of a power of �� is given by 0.5.2 Trigonometric functions (sin ��)′ = cos ��, (cos ��)′ = − sin ��. The derivatives of sin �� and cos �� are 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 1 . �� The derivative of ���� and ln �� are (���� )′ = ���� , (ln ��)′ = 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 4 CHAPTER 0. A SHORT MATHEMATICAL REVIEW 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 = lim �� ℎ→0 �� (��)���� − ℎ ∫ �� �� �� (��)���� �� (��)���� ℎ ℎ�� (��) = lim ℎ→0 ℎ = �� (��). �� ℎ→0 ∫ ��+ℎ This result is called the fundamental theorem of calculus, and provides a connection 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 to choose the same ℎ in both limits. With �� ′ (��) = �� (��), we have ∫ �� ∫ �� �� (��)���� = �� ′ (��)���� �� �� 5 = lim �� ∑ ��=1 ℎ→0 ( ) �� ′ �� + (�� − 1)ℎ · ℎ = lim ( ) �� ∑ �� (�� + ��ℎ) − �� �� + (�� − 1)ℎ ·ℎ ℎ→0 ℎ ��=1 �� ∑ ��=1 = lim ℎ→0 ( ) �� (�� + ��ℎ) − �� �� + (�� − 1)ℎ . The last expression has an interesting structure. All the values of �� (��) evaluated 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 1 �� ln (−��) = . ���� �� Therefore, since { |��| = −�� �� if �� < 0; if �� > 0, we can generalize our indefinite integral to strictly positive or strictly negative ��: ∫ 1 ���� = ln |��| + ��. �� 6 CHAPTER 0. A SHORT MATHEMATICAL REVIEW 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 ∫ ��3 7��2 (��2 + 7�� + 2)���� = + + 2�� + ��, 3 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 Commonly, the above integral is done by writing �� = �� (��) ���� = �� ′ (��)���� ���� = �� ′ (��)���� �� = �� (��). 7 Then, the formula to be memorized is ∫ ∫ ������ = ���� − ������. 0.12 Taylor series A Taylor series of a function �� (��) about a point �� = �� is a power series representation 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 + (�� − ��)3 + . . . . 2! 3! Notice that the first term in the power series matches �� (��), all other terms vanishing, the second term matches �� ′ (��), all other terms vanishing, etc. Commonly, the Taylor series is developed with �� = 0. We will also make use of the Taylor series in a slightly different form, with �� = ��* + �� and �� = ��* : �� (��* + ��) = �� (��* ) + �� ′ (��* )�� + �� ′′ (��* ) 2 �� ′′′ (��* ) 3 �� + �� + . . . . 2! 3! Another way to view this series is that of �� (��) = �� (��* + ��), expanded about �� = 0. Taylor series that are commonly used include ���� = 1 + �� + sin �� = �� − ��2 ��3 + + ..., 2! 3! 5 �� + − ..., 5! ��4 + − ..., 4! ��3 3! ��2 cos �� = 1 − 2! 1 = 1 − �� + ��2 − . . . , for |��| < 1, 1 + �� ��2 ��3 ln (1 + ��) = �� − + − . . . , for |��| < 1. 2 3 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 ���� = we have �� (��, �� ) = �� (��, ��) + ���� (��, ��)(�� − ��) + ���� (��, ��)(�� − ��) ) 1 ( ������ (��, ��)(�� − ��)2 + 2������ (��, ��)(�� − ��)(�� − ��) + ������ (��, ��)(�� − ��)2 + . . . + 2! ���� , ���� ���� = ���� , ���� ������ = �� 2 �� , ����2 ������ = �� 2 �� , �������� ������ = �� 2 �� , ���� 2 etc., 8 CHAPTER 0. A SHORT MATHEMATICAL REVIEW 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 �� = 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 �� + �� = (�� + ��) + ��(�� + ��); �� − �� = (�� − ��) + ��(�� − ��); 1 (�� + �� ¯) , 2 Im �� = 1 (�� − �� ¯) . 2�� ���� = (�� + ���� )(�� + ����) = (���� − ����) + ��(���� + ����); �� �� ¯ �� = �� ���� ¯ (�� + ���� )(�� − ����) = ��2 + ��2 (���� + ����) (���� − ����) = 2 + �� 2 . �� + ��2 �� + ��2 0.13. COMPLEX NUMBERS Furthermore, |����| = = √ √ (���� − ����)2 + (���� + ����)2 (��2 + �� 2 )(��2 + ��2 ) 9 = |�� ||��|; 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 (����)2 (����)3 (����)4 (����)5 ������ = 1 + (����) + + + + ... 2! 3! ( 4! 5! ( ) ) 2 4 3 5 �� �� �� �� = 1− + − . . . + �� �� − + + ... 2! 4! 3! 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 mathematical 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. 10 CHAPTER 0. A SHORT MATHEMATICAL REVIEW 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 ��. 2 With a little more manipulation using cos �� + sin2 �� = 1, we can derive cos2 �� = 1 + cos 2�� , 2 sin2 �� = 1 − cos 2�� , 2 which are useful formulas for determining ∫ ∫ 1 1 cos2 �� ���� = (2�� + sin 2��) + ��, sin2 �� ���� = (2�� − sin 2��) + ��, 4 4 from which follows ∫ 0 2�� sin �� ���� = 0 2 ∫ 2�� 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 12 CHAPTER 1. INTRODUCTION TO ODES 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 1 ��(��) = ��0 + ��0 �� − ����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 = sec 9.8 ≈ 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 dependent 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 determined tangent line. For small enough Δ��, the numerical solution converges to the exact solution. 13 14 CHAPTER 2. FIRST-ORDER ODES 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 �� . Integration 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 ���� ���� 1 +2 �� = 3 2 , with �� (0) = 2. We first manipulate the differential equation to the form ���� 1 = (3 − �� ), ���� 2 and then treat ����/���� as if it was a fraction to separate variables: ���� 1 = ����. 3 − �� 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 �� (2.4) ���� 1 = 3 − �� 2 ∫ 0 �� ����. (2.5) 2.2. SEPARABLE EQUATIONS dy/dx + y/2 = 3/2 6 5 4 3 2 1 0 y 15 0 1 2 3 x 4 5 6 7 Figure 2.1: Solution of the following ode: ���� ���� 1 +2 �� = 3 2. 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 ]�� 1 ]�� − ln (3 − �� ) 2 = �� 0 , 2 1 ln (3 − �� ) = − ��, 2 1 −2 �� 3 − �� = �� , �� = 3 − ��− 2 �� . Since this is our first nontrivial analytical solution, it is prudent to check our result. We do this by differentiating our solution: ���� 1 1 = ��− 2 �� ���� 2 1 = (3 − �� ); 2 and checking the initial conditions, �� (0) = 3 − ��0 = 2. Therefore, our solution satisfies both the original ode and the initial condition. 1 Example: Solve ���� ���� 3 +1 2 �� = 2 , 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 �� 1 ���� = 3 − �� 2 ∫ 0 �� ����. 16 CHAPTER 2. FIRST-ORDER ODES Now �� (��) > 3, so that �� − 3 > 0 and integration yields − ln (�� − 3) 1 ]�� �� , 4 2 0 1 ln (�� − 3) = − ��, 2 1 �� − 3 = ��− 2 �� , ]�� = �� = 3 + ��− 2 �� . 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). ���� cos 2�� = 23+2 Example: Solve ���� �� , with �� (0) = −1. (i) For what values of �� > 0 does the solution exist? (ii) For what value of �� > 0 is �� (��) maximum? 1 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�� ���� ∫ �� (3 + 2�� )���� = 2 cos 2�� ���� −1 0 ]�� ]�� 3�� + �� 2 −1 = sin 2�� 0 �� ∫ �� 2 + 3�� + 2 − sin 2�� = 0 √ 1 ��± = [−3 ± 1 + 4 sin 2��]. 2 Solving the quadratic equation for �� has introduced a spurious solution that does not satisfy the initial conditions. We test: { 1 -1; ��± (0) = [−3 ± 1] = -2. 2 Only the + root satisfies the initial condition, so that the unique solution to the ode and initial condition is √ 1 �� = [−3 + 1 + 4 sin 2��]. (2.6) 2 To determine (i) the values of �� > 0 for which the solution exists, we require 1 + 4 sin 2�� ≥ 0, 1 sin 2�� ≥ − . (2.7) 4 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. or 2.3. LINEAR EQUATIONS (3+2y) dy/dx = 2 cos 2x, y(0) = −1 0 −0.2 −0.4 −0.6 −0.8 −1 −1.2 −1.4 −1.6 0 0.5 x 1 1.5 y 17 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 ( 1 �� + arcsin 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 18 CHAPTER 2. FIRST-ORDER ODES 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 integrated using an integrating factor ��(��). We multiply (2.8) by ��(��), [ ] ���� ��(��) + ��(��)�� = ��(��)�� (��), (2.9) ���� and try to determine ��(��) so that ] [ �� ���� + ��(��)�� = [��(��)�� ]. ��(��) ���� ���� Equation (2.9) then becomes �� [��(��)�� ] = ��(��)�� (��). ���� Equation (2.11) is easily integrated using ��(��0 ) = ��0 and �� (��0 ) = ��0 : ∫ �� ��(��)�� − ��0 ��0 = ��(��)�� (��)����, ��0 (2.10) (2.11) or 1 �� = ��(��) ( ∫ ��0 ��0 + �� ) ��(��)�� (��)���� . (2.12) ��0 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 (∫ ) �� ��(��) = ��0 exp ��(��)���� . ��0 Notice that since ��0 cancels 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 mathematics. 2.3. LINEAR EQUATIONS Example: Solve ���� ���� 19 + 2�� = ��−�� , with �� (0) = 3/4. Note that this equation is not separable. With ��(��) = 2 and �� (��) = ��−�� , we have ) (∫ �� 2���� ��(��) = exp 0 = ��2�� , and �� = ��−2�� ) ∫ �� 3 ��2�� ��−�� ���� + 4 0 ( ) ∫ �� 3 = ��−2�� + ���� ���� 4 0 ( ) 3 = ��−2�� + (���� − 1) 4 ( ) 1 = ��−2�� ���� − 4 ( ) 1 = ��−�� 1 − ��−�� . 4 ( Example: Solve ���� ���� − 2���� = ��, with �� (0) = 0. This equation is separable, and we solve it in two ways. First, using an integrating factor with ��(��) = −2�� and �� (��) = ��: ( ∫ �� ) ��(��) = exp −2 ������ 0 = �� and −��2 , �� �� = ���� 2 ∫ 0 ����−�� ����. 2 The integral can be done by substitution with �� = ��2 , ���� = 2������: ∫ 0 �� ����−�� ���� = 2 1 2 ∫ 0 ��2 ��−�� ���� ]��2 1 = − ��−�� 0 2 ) 2 1 ( = 1 − ��−�� . 2 Therefore, �� = ) 2 1 ��2 ( �� 1 − ��−�� 2 ) 1 ( ��2 �� − 1 . = 2 20 CHAPTER 2. FIRST-ORDER ODES Second, we integrate by separating variables: ���� − 2���� = ��, ���� ���� = ��(1 + 2�� ), ∫ ������ ∫ �� ���� ������, = 0 1 + 2�� 0 1 1 ln (1 + 2�� ) = ��2 , 2 2 2 1 + 2�� = ���� , ) 1 ( ��2 �� − 1 . �� = 2 The results from the two different solution methods are the same, and the choice of method is a personal preference. 2.4 2.4.1 Applications Compound interest view tutorial The equation for the growth of an investment with continuous compounding of interest is a first-order differential equation. Let �� (��) be the value of the investment at time ��, and let �� be the annual interest rate compounded after every time interval Δ��. We can also include deposits (or withdrawals). Let �� be the annual deposit amount, and suppose that an installment is deposited after every time interval Δ��. The value of the investment at the time �� + Δ�� is then given by �� (�� + Δ��) = �� (��) + (��Δ��)�� (��) + �� Δ��, (2.14) where at the end of the time interval Δ��, ��Δ���� (��) is the amount of interest credited and �� Δ�� is the amount of money deposited (�� > 0) or withdrawn (�� < 0). As a numerical example, if the account held $10,000 at time ��, and �� = 6% per year and �� = $12,000 per year, say, and the compounding and deposit period is Δ�� = 1 month = 1/12 year, then the interest awarded after one month is ��Δ���� = (0.06/12) × $10,000 = $50, and the amount deposited is �� Δ�� = $1000. Rearranging the terms of (2.14) to exhibit what will soon become a derivative, we have �� (�� + Δ��) − �� (��) = ���� (��) + ��. Δ�� The equation for continuous compounding of interest and continuous deposits is obtained by taking the limit Δ�� → 0. The resulting differential equation is ���� = ���� + ��, ���� (2.15) which can solved with the initial condition �� (0) = ��0 , where ��0 is the initial capital. We can solve either by separating variables or by using an integrating 2.4. APPLICATIONS 21 factor; I solve here by separating variables. Integrating from �� = 0 to a final time ��, ∫ �� ∫ �� ���� ����, = ��0 ���� + �� 0 ( ) 1 ���� + �� ln = ��, �� ����0 + �� ���� + �� = (����0 + �� )������ , ����0 ������ + �������� − �� , �� ( ) �� �� = ��0 ������ + ������ 1 − ��−���� , �� �� = (2.16) where the first term on the right-hand side of (2.16) comes from the initial invested capital, and the second term comes from the deposits (or withdrawals). Evidently, compounding results in the exponential growth of an investment. As a practical example, we can analyze a simple retirement plan. It is easiest to assume that all amounts and returns are in real dollars (adjusted for inflation). Suppose a 25 year-old plans to set aside a fixed amount every year of his/her working life, invests at a real return of 6%, and retires at age 65. How much must he/she invest each year to have $8,000,000 at retirement? We need to solve (2.16) for �� using �� = 40 years, �� (��) = $8,000,000, ��0 = 0, and �� = 0.06 per year. We have �� = ���� (��) , ������ − 1 0.06 × 8,000,000 �� = , ��0.06×40 − 1 = $47,889 year−1 . To have saved approximately one million US$ at retirement, the worker would need to save about HK$50,000 per year over his/her working life. Note that the amount saved over the worker’s life is approximately 40 × $50,000 = $2,000,000, while the amount earned on the investment (at the assumed 6% real return) is approximately $8,000,000 − $2,000,000 = $6,000,000. The amount earned from the investment is about 3× the amount saved, even with the modest real return of 6%. Sound investment planning is well worth the effort. 2.4.2 Chemical reactions Suppose that two chemicals �� and �� react to form a product �� , which we write as �� �� + �� → ��, where �� is called the rate constant of the reaction. For simplicity, we will use the same symbol �� , say, to refer to both the chemical �� and its concentration. The law of mass action says that ����/���� is proportional to the product of the concentrations �� and �� , with proportionality constant �� ; that is, ���� = ������. ���� (2.17) 22 CHAPTER 2. FIRST-ORDER ODES Similarly, the law of mass action enables us to write equations for the timederivatives of the reactant concentrations �� and �� : ���� = −������, ���� ���� = −������. ���� (2.18) The ode given by (2.17) can be solved analytically using conservation laws. We assume that ��0 and ��0 are the initial concentrations of the reactants, and that no product is initially present. From (2.17) and (2.18), �� (�� + �� ) = 0 ���� �� (�� + �� ) = 0 ���� =⇒ =⇒ �� + �� = ��0 , �� + �� = ��0 . Using these conservation laws, (2.17) becomes ���� = �� (��0 − �� )(��0 − �� ), ���� �� (0) = 0, which is a nonlinear equation that may be integrated by separating variables. Separating and integrating, we obtain ∫ �� ∫ �� ���� = �� ���� 0 0 (��0 − �� )(��0 − �� ) = ����. (2.19) The remaining integral can be done using the method of partial fractions. We write 1 �� �� = + . (2.20) (��0 − �� )(��0 − �� ) ��0 − �� ��0 − �� The cover-up method is the simplest method to determine the unknown coefficients �� and ��. To determine ��, we multiply both sides of (2.20) by ��0 − �� and set �� = ��0 to find 1 �� = . ��0 − ��0 Similarly, to determine ��, we multiply both sides of (2.20) by ��0 − �� and set �� = ��0 to find 1 �� = . ��0 − ��0 Therefore, ( ) 1 1 1 1 = − , (��0 − �� )(��0 − �� ) ��0 − ��0 ��0 − �� ��0 − �� and the remaining integral of (2.19) becomes (using �� < ��0 , ��0 ) (∫ ) ∫ �� ∫ �� �� ���� 1 ���� ���� = − ��0 − ��0 0 (��0 − �� )(��0 − �� ) 0 ��0 − �� 0 ��0 − �� ( ( ) ( )) 1 ��0 − �� ��0 − �� = − ln + ln ��0 − ��0 ��0 ��0 ( ) 1 ��0 (��0 − �� ) = ln . ��0 − ��0 ��0 (��0 − �� ) 2.4. APPLICATIONS 23 Using this integral in (2.19), multiplying by (��0 − ��0 ) and exponentiating, we obtain ��0 (��0 − �� ) = ��(��0 −��0 )���� . ��0 (��0 − �� ) Solving for �� , we finally obtain �� (��) = ��0 ��0 ��(��0 −��0 )���� − 1 , ��0 ��(��0 −��0 )���� − ��0 which appears to be a complicated expression, but has the simple limits { ��0 , if ��0 < ��0 , lim �� (��) = ��→∞ ��0 , if ��0 < ��0 = min(��0 , ��0 ). As one would expect, the reaction stops after one of the reactants is depleted; and the final concentration of product is equal to the initial concentration of the depleted reactant. 2.4.3 Terminal velocity view tutorial Using Newton’s law, we model a mass �� free falling under gravity but with air resistance. We assume that the force of air resistance is proportional to the speed of the mass and opposes the direction of motion. We define the ��-axis to point in the upward direction, opposite the force of gravity. Near the surface of the Earth, the force of gravity is approximately constant and is given by −���� , with �� = 9.8 m/s2 the usual gravitational acceleration. The force of air resistance is modeled by −���� , where �� is the vertical velocity of the mass and �� is a positive constant. When the mass is falling, �� < 0 and the force of air resistance is positive, pointing upward and opposing the motion. The total force on the mass is therefore given by �� = −���� − ���� . With �� = ���� and �� = ����/����, we obtain the differential equation �� ���� = −���� − ����. ���� (2.21) The terminal velocity ��∞ of the mass is defined as the asymptotic velocity after air resistance balances the gravitational force. When the mass is at terminal velocity, ����/���� = 0 so that ��∞ = − ���� . �� (2.22) The approach to the terminal velocity of a mass initially at rest is obtained by solving (2.21) with initial condition �� (0) = 0. The equation is both linear and 24 CHAPTER 2. FIRST-ORDER ODES separable, and I solve by separating variables: ∫ �� ∫ �� ���� �� =− ����, 0 ���� + ���� 0 ( ) ���� + ���� �� ln = −��, �� ���� ���� 1+ = ��−����/�� , ���� ) ���� ( 1 − ��−����/�� . �� = − �� ( ) Therefore, �� = ��∞ 1 − ��−����/�� , and �� approaches ��∞ as the exponential term decays to zero. As an example, a skydiver of mass �� = 100 kg with his parachute closed may have a terminal velocity of 200 km/hr. With �� = (9.8 m/s )(10−3 km/m)(60 s/min)2 (60 min/hr)2 = 127, 008 km/hr , one obtains from (2.22), �� = 63, 504 kg/hr. One-half of the terminal velocity for free-fall (100 km/hr) is therefore attained when (1 − ��−����/�� ) = 1/2, or �� = �� ln 2/�� ≈ 4 sec. Approximately 95% of the terminal velocity (190 km/hr ) is attained after 17 sec. 2 2 2.4.4 Escape velocity view tutorial An interesting physical problem is to find the smallest initial velocity for a mass on the Earth’s surface to escape from the Earth’s gravitational field, the so-called escape velocity. Newton’s law of universal gravitation asserts that the gravitational force between two massive bodies is proportional to the product of the two masses and inversely proportional to the square of the distance between them. For a mass �� a position �� above the surface of the Earth, the force on the mass is given by �� �� �� = −�� , (�� + ��)2 where �� and �� are the mass and radius of the Earth and �� is the gravitational constant. The minus sign means the force on the mass �� points in the direction of decreasing ��. The approximately constant acceleration �� on the Earth’s surface corresponds to the absolute value of ��/�� when �� = 0: �� = ���� , ��2 and �� ≈ 9.8 m/s2 . Newton’s law �� = ���� for the mass �� is thus given by ��2 �� ���� =− 2 ���� (�� + ��)2 �� =− , (1 + ��/��)2 where the radius of the Earth is known to be �� ≈ 6350 km. (2.23) 2.4. APPLICATIONS 25 A useful trick allows us to solve this second-order differential equation as a first-order equation. First, note that ��2 ��/����2 = ����/����. If we write �� (��) = �� (��(��))—considering the velocity of the mass �� to be a function of its distance above the Earth—we have using the chain rule ���� ���� ���� = ���� ���� ���� ���� = �� , ���� where we have used �� = ����/����. Therefore, (2.23) becomes the first-order ode �� �� ���� , =− ���� (1 + ��/��)2 which may be solved assuming an initial velocity �� (�� = 0) = ��0 when the mass is shot vertically from the Earth’s surface. Separating variables and integrating, we obtain ∫ �� ∫ �� ���� ������ = −�� . (1 + ��/��)2 0 ��0 1 2 2 (�� − ��0 ), and the right integral can be performed using The left integral is 2 the substitution �� = 1 + ��/��, ���� = ����/��: ∫ �� ∫ 1+��/�� ���� ���� = �� 2 (1 + ��/�� ) ��2 0 1 ]1+��/�� �� =− �� 1 = �� − = Therefore, ��2 �� + �� ���� . �� + �� ������ 1 2 2 (�� − ��0 )=− , 2 �� + �� which when multiplied by �� is an expression of the conservation of energy (the change of the kinetic energy of the mass is equal to the change in the potential energy). Solving for �� 2 , 2������ 2 �� 2 = ��0 − . �� + �� The escape velocity is defined as the minimum initial velocity ��0 such that the mass can escape to infinity. Therefore, ��0 = ��escape when �� → 0 as �� → ∞. Taking this limit, we have 2 ��escape = lim ��→∞ 2������ �� + �� = 2����. √ 2 With �� ≈ 6350 km and �� = 127 008 km/hr , we determine ��escape = 2���� ≈ 40 000 km/hr. In comparison, the muzzle velocity of a modern high-performance rifle is 4300 km/hr, almost an order of magnitude too slow for a bullet, shot into the sky, to escape the Earth’s gravity. 26 CHAPTER 2. FIRST-ORDER ODES i (a) R (b) + ߝ _ C Figure 2.3: RC circuit diagram. 2.4.5 RC circuit view tutorial Consider a resister �� and a capacitor �� connected in series as shown in Fig. 2.3. A battery providing an electromotive force, or emf ℰ , connects to this circuit by a switch. Initially, there is no charge on the capacitor. When the switch is thrown to a, the battery connects and the capacitor charges. When the switch is thrown to b, the battery disconnects and the capacitor discharges, with energy dissipated in the resister. Here, we determine the voltage drop across the capacitor during charging and discharging. The equations for the voltage drops across a capacitor and a resister are given by ���� = ��/��, ���� = ����, (2.24) where �� is the capacitance and �� is the resistance. The charge �� and the current �� are related by ���� �� = . (2.25) ���� Kirchhoff’s voltage law states that the emf ℰ in any closed loop is equal to the sum of the voltage drops in that loop. Applying Kirchhoff’s voltage law when the switch is thrown to a results in ���� + ���� = ℰ . (2.26) Using (2.24) and (2.25), the voltage drop across the resister can be written in terms of the voltage drop across the capacitor as ���� = ���� ������ , ���� and (2.26) can be rewritten to yield the first-order linear differential equation for ���� given by ������ + ���� /���� = ℰ /����, (2.27) ���� with initial condition ���� (0) = 0. 2.4. APPLICATIONS The integrating factor for this equation is ��(��) = ����/���� , and (2.27) integrates to ���� (��) = ��−��/���� with solution ∫ 0 �� 27 (ℰ /���� )����/���� ����, ( ) ���� (��) = ℰ 1 − ��−��/���� . The voltage starts at zero and rises exponentially to ℰ , with characteristic time scale given by ���� . When the switch is thrown to b, application of Kirchhoff’s voltage law results in ���� + ���� = 0, with corresponding differential equation ������ + ���� /���� = 0. ���� Here, we assume that the capacitance is initially fully charged so that ���� (0) = ℰ . The solution, then, during the discharge phase is given by ���� (��) = ℰ ��−��/���� . The voltage starts at ℰ and decays exponentially to zero, again with characteristic time scale given by ���� . 2.4.6 The logistic equation view tutorial Let �� = �� (��) be the size of a population at time �� and let �� be the growth rate. The Malthusian growth model (Thomas Malthus, 1766-1834), similar to a compound interest model, is given by ���� = ����. ���� Under a Malthusian growth model, a population grows exponentially like �� (��) = ��0 ������ , where ��0 is the initial population size. However, when the population growth is constrained by limited resources, a heuristic modification to the Malthusian growth model results in the Verhulst equation, ( ) �� ���� = ���� 1 − , (2.28) ���� �� where �� is called the carrying capacity of the environment. Making (2.28) dimensionless using �� = ���� and �� = ��/�� leads to the logistic equation, ���� = ��(1 − ��), ���� 28 CHAPTER 2. FIRST-ORDER ODES where we may assume the initial condition ��(0) = ��0 > 0. Separating variables and integrating ∫ �� ∫ �� ���� ����. = ��0 ��(1 − ��) 0 The integral on the left-hand-side can be done using the method of partial fractions: 1 �� �� = + ��(1 − ��) �� 1 − �� �� + (�� − ��)�� = ; ��(1 − ��) and equating the coefficients of the numerators proportional to ��0 and ��1 , we have �� = �� = 1. Therefore, ∫ �� ∫ �� ∫ �� ���� ���� ���� = + �� (1 − �� ) �� (1 − ��) ��0 ��0 ��0 1 − �� �� − ln = ln ��0 1 − ��0 ��(1 − ��0 ) = ln ��0 (1 − ��) = ��. Solving for ��, we first exponentiate both sides and then isolate ��: ��(1 − ��0 ) = ���� , ��0 (1 − ��) ��(1 − ��0 ) = ��0 ���� − ����0 ���� , ��(1 − ��0 + ��0 ���� ) = ��0 ���� , ��0 �� = . ��0 + (1 − ��0 )��−�� We observe that for ��0 > 0, we have lim�� →∞ ��(�� ) = 1, corresponding to ��→∞ (2.29) lim �� (��) = ��. The population, therefore, grows in size until it reaches the carrying capacity of its environment. Chapter 3 Second-order linear differential equations with constant coefficients Reference: Boyce and DiPrima, Chapter 3 The general second-order linear differential equation with independent variable �� and dependent variable �� = ��(��) is given by �� ¨ + ��(��)�� ˙ + �� (��)�� = �� (��), (3.1) where we have used the standard physics notation �� ˙ = ����/���� and �� ¨ = ��2 ��/����2 . A unique solution of (3.1) requires initial values ��(��0 ) = ��0 and �� ˙ (��0 ) = ��0 . The equation with constant coefficients—on which we will devote considerable effort—assumes that ��(��) and �� (��) are constants, independent of time. The second-order linear ode is said to be homogeneous if �� (��) = 0. 3.1 The Euler method view tutorial In general, (3.1) cannot be solved analytically, and we begin by deriving an algorithm for numerical solution. Consider the general second-order ode given by �� ¨ = �� (��, ��, �� ˙ ). We can write this second-order ode as a pair of first-order odes by defining �� = �� ˙ , and writing the first-order system as �� ˙ = ��, �� ˙ = �� (��, ��, ��). (3.2) (3.3) The first ode, (3.2), gives the slope of the tangent line to the curve �� = ��(��); the second ode, (3.3), gives the slope of the tangent line to the curve �� = ��(��). Beginning at the initial values (��, ��) = (��0 , ��0 ) at the time �� = ��0 , we move along the tangent lines to determine ��1 = ��(��0 + Δ��) and ��1 = ��(��0 + Δ��): ��1 = ��0 + Δ����0 , ��1 = ��0 + Δ���� (��0 , ��0 , ��0 ). 29 30 CHAPTER 3. SECOND-ORDER ODES, CONSTANT COEFFICIENTS The values ��1 and ��1 at the time ��1 = ��0 + Δ�� are then used as new initial values to march the solution forward to time ��2 = ��1 + Δ��. As long as �� (��, ��, ��) is a well-behaved function, the numerical solution converges to the unique solution of the ode as Δ�� → 0. 3.2 The principle of superposition view tutorial Consider the second-order linear homogeneous ode: �� ¨ + ��(��)�� ˙ + �� (��)�� = 0; (3.4) and suppose that �� = ��1 (��) and �� = ��2 (��) are solutions to (3.4). We consider a linear combination of ��1 and ��2 by letting �� (��) = ��1 ��1 (��) + ��2 ��2 (��), (3.5) with ��1 and ��2 constants. The principle of superposition states that �� = �� (��) is also a solution of (3.4). To prove this, we compute ( ) ¨ + ���� ˙ + ���� = ��1 �� ¨ 1 + ��2 �� ¨ 2 + �� ��1 �� ˙ 1 + ��2 �� ˙ 2 + �� (��1 ��1 + ��2 ��2 ) �� ( ) ( ) ¨ 1 + ���� ˙ 1 + ����1 + ��2 �� ¨ 2 + ���� ˙ 2 + ����2 = ��1 �� = ��1 × 0 + ��2 × 0 = 0, since ��1 and ��2 were assumed to be solutions of (3.4). We have therefore shown that any linear combination of solutions to the second-order linear homogeneous ode is also a solution. 3.3 The Wronskian view tutorial Suppose that having determined that two solutions of (3.4) are �� = ��1 (��) and �� = ��2 (��), we attempt to write the general solution to (3.4) as (3.5). We must then ask whether this general solution will be able to satisfy the two initial conditions given by ��(��0 ) = ��0 , �� ˙ (��0 ) = ��0 . (3.6) Applying these initial conditions to (3.5), we obtain ��1 ��1 (��0 ) + ��2 ��2 (��0 ) = ��0 , ˙ 1 (��0 ) + ��2 �� ˙ 2 (��0 ) = ��0 , ��1 �� (3.7) which is observed to be a system of two linear equations for the two unknowns ��1 and ��2 . Solution of (3.7) by standard methods results in ��1 = ˙ 2 (��0 ) − ��0 ��2 (��0 ) ��0 �� , �� ��2 = ˙ 1 (��0 ) ��0 ��1 (��0 ) − ��0 �� , �� 3.4. HOMOGENEOUS ODES where �� is called the Wronskian and is given by ˙ 2 (��0 ) − �� ˙ 1 (��0 )��2 (��0 ). �� = ��1 (��0 )�� 31 (3.8) Evidently, the Wronskian must not be equal to zero (�� ̸= 0) for a solution to exist. For examples, the two solutions ��1 (��) = �� sin ����, ��2 (��) = �� sin ����, have a zero Wronskian at �� = ��0 , as can be shown by computing �� = (�� sin ����0 ) (���� cos ����0 ) − (���� cos ����0 ) (�� sin ����0 ) = 0; while the two solutions ��1 (��) = sin ����, ��2 (��) = cos ����, with �� ̸= 0, have a nonzero Wronskian at �� = ��0 , �� = (sin ����0 ) (−�� sin ����0 ) − (�� cos ����0 ) (cos ����0 ) = −��. When the Wronskian is not equal to zero, we say that the two solutions ��1 (��) and ��2 (��) are linearly independent. The concept of linear independence is borrowed from linear algebra, and indeed, the set of all functions that satisfy (3.4) can be shown to form a two-dimensional vector space. 3.4 Second-order linear homogeneous ode with constant coefficients view tutorial We now study solutions of the homogeneous, constant coefficient ode, written as ���� ¨ + ���� ˙ + ���� = 0, (3.9) with ��, ��, and �� constants. Such an equation arises for the charge on a capacitor in an unpowered RLC electrical circuit, or for the position of a freely-oscillating frictional mass on a spring, or for a damped pendulum. Our solution method finds two linearly independent solutions to (3.9), multiplies each of these solutions by a constant, and adds them. The two free constants can then be used to satisfy two given initial conditions. Because of the differential properties of the exponential function, a natural ansatz, or educated guess, for the form of the solution to (3.9) is �� = ������ , where �� is a constant to be determined. Successive differentiation results in �� ˙ = �������� 2 ���� and �� ¨ = �� �� , and substitution into (3.9) yields ����2 ������ + ���������� + �������� = 0. (3.10) Our choice of exponential function is now rewarded by the explicit cancelation in (3.10) of ������ . The result is a quadratic equation for the unknown constant ��: ����2 + ���� + �� = 0. (3.11) 32 CHAPTER 3. SECOND-ORDER ODES, CONSTANT COEFFICIENTS Our ansatz has thus converted a differential equation into an algebraic equation. Equation (3.11) is called the characteristic equation of (3.9). Using the quadratic formula, the two solutions of the characteristic equation (3.11) are given by ) √ 1 ( −�� ± ��2 − 4���� . ��± = 2�� There are three cases to consider: (1) if ��2 − 4���� > 0, then the two roots are distinct and real; (2) if ��2 − 4���� < 0, then the two roots are distinct and complex conjugates of each other; (3) if ��2 − 4���� = 0, then the two roots are degenerate and there is only one real root. We will consider these three cases in turn. 3.4.1 Real, distinct roots When ��+ ̸= ��− are real roots, then the general solution to (3.9) can be written as a linear superposition of the two solutions ����+ �� and ����− �� ; that is, ��(��) = ��1 ����+ �� + ��2 ����− �� . The unknown constants ��1 and ��2 can then be determined by the given initial conditions ��(��0 ) = ��0 and �� ˙ (��0 ) = ��0 . We now present two examples. Example 1: Solve �� ¨ + 5�� ˙ + 6�� = 0 with ��(0) = 2, �� ˙ (0) = 3, and find the maximum value attained by ��. view tutorial We take as our ansatz �� = ������ and obtain the characteristic equation ��2 + 5�� + 6 = 0, which factors to (�� + 3)(�� + 2) = 0. The general solution to the ode is thus ��(��) = ��1 ��−2�� + ��2 ��−3�� . The solution for �� ˙ obtained by differentiation is �� ˙ (��) = −2��1 ��−2�� − 3��2 ��−3�� . Use of the initial conditions then results in two equations for the two unknown constant ��1 and ��2 : ��1 + ��2 = 2, −2��1 − 3��2 = 3. Adding three times the first equation to the second equation yields ��1 = 9; and the first equation then yields ��2 = 2 − ��1 = −7. Therefore, the unique solution that satisfies both the ode and the initial conditions is ��(��) = 9��−2�� − 7��−3�� ) ( 7 = 9��−2�� 1 − ��−�� . 9 3.4. HOMOGENEOUS ODES 33 Note that although both exponential terms decay in time, their sum increases initially since �� ˙ (0) > 0. The maximum value of �� occurs at the time ���� when �� ˙ = 0, or ���� = ln (7/6) . The maximum ���� = ��(���� ) is then determined to be ���� = 108/49. Example 2: Solve �� ¨ − �� = 0 with ��(0) = ��0 , �� ˙ (0) = ��0 . Again our ansatz is �� = ������ , and we obtain the characteristic equation ��2 − 1 = 0, with solution ��± = ±1. Therefore, the general solution for �� is ��(��) = ��1 ���� + ��2 ��−�� , and the derivative satisfies �� ˙ (��) = ��1 ���� − ��2 ��−�� . Initial conditions are satisfied when ��1 + ��2 = ��0 , ��1 − ��2 = ��0 . Adding and subtracting these equations, we determine 1 1 ��1 = (��0 + ��0 ) , ��2 = (��0 − ��0 ) , 2 2 so that after rearranging terms ( �� ) ) ( �� �� + ��−�� �� − ��−�� ��(��) = ��0 + ��0 . 2 2 The terms in parentheses are the usual definitions of the hyperbolic cosine and sine functions; that is, ���� + ��−�� ���� − ��−�� , sinh �� = . 2 2 Our solution can therefore be rewritten as cosh �� = ��(��) = ��0 cosh �� + ��0 sinh ��. Note that the relationships between the trigonometric functions and the complex exponentials were given by cos �� = so that cosh �� = cos ����, sinh �� = −�� sin ����. Also note that the hyperbolic trigonometric functions satisfy the differential equations �� �� sinh �� = cosh ��, cosh �� = sinh ��, ���� ���� which though similar to the differential equations satisfied by the more commonly used trigonometric functions, is absent a minus sign. ������ + ��−���� , 2 sin �� = ������ − ��−���� , 2�� 34 CHAPTER 3. SECOND-ORDER ODES, CONSTANT COEFFICIENTS 3.4.2 Complex conjugate, distinct roots view tutorial We now consider a characteristic equation (3.11) with ��2 − 4���� < 0, so the roots occur as complex conjugate pairs. With �� = − �� , 2�� �� = 1 √ 4���� − ��2 , 2�� the two roots of the characteristic equation are �� + ���� and �� − ����. We have thus found the following two complex exponential solutions to the differential equation: ��1 (��) = ������ �������� , ��2 (��) = ������ ��−������ . Applying the principle of superposition, any linear combination of ��1 and ��2 is also a solution to the second-order ode. We can then form two different linear combinations that are real, given by ��1 (��) = ��1 + ��2 2 ) ( �������� + ��−������ ���� = �� 2 = ������ cos ����, and ��2 (��) = ��1 − ��2 2 �� ( ) �������� − ��−������ ���� = �� 2�� = ������ sin ����. Having found the two real solutions ��1 (��) and ��2 (��), we can then apply the principle of superposition a second time to determine the general solution ��(��): ��(��) = ������ (�� cos ���� + �� sin ����) . (3.12) It is best to memorize this result. The real part of the roots of the characteristic equation goes into the exponential function; the imaginary part goes into the argument of cosine and sine. Example 1: Solve �� ¨ + �� = 0 with ��(0) = ��0 and �� ˙ (0) = ��0 . view tutorial The characteristic equation is ��2 + 1 = 0, with roots ��± = ±��. The general solution of the ode is therefore ��(��) = �� cos �� + �� sin ��. 3.4. HOMOGENEOUS ODES The derivative is �� ˙ (��) = −�� sin �� + �� cos ��. Applying the initial conditions: ��(0) = �� = ��0 , so that the final solution is ��(��) = ��0 cos �� + ��0 sin ��. �� ˙ (0) = �� = ��0 ; 35 Recall that we wrote the analogous solution to the ode �� ¨ − �� = 0 as ��(��) = ��0 cosh �� + ��0 sinh ��. Example 2: Solve �� ¨ + �� ˙ + �� = 0 with ��(0) = 1 and �� ˙ (0) = 0. The characteristic equation is ��2 + �� + 1 = 0, with roots √ 3 1 . ��± = − ± �� 2 2 The general solution of the ode is therefore ( √ ) √ 3 3 �� −1 �� + �� sin �� . ��(��) = �� 2 �� cos 2 2 The derivative is 1 1 �� ˙ (��) = − ��− 2 �� 2 ( √ ) 3 3 �� cos �� + �� sin �� 2 2 ( √ √ √ ) 3 − 1 �� 3 3 + �� 2 −�� sin �� + �� cos �� . 2 2 2 √ Applying the initial conditions ��(0) = 1 and �� ˙ (0) = 0: �� = 1, √ −1 3 �� + �� = 0; 2 2 or �� = 1, Therefore, ��(��) = �� 1 −2 �� √ �� = √ 3 . 3 ( √ √ ) 3 3 3 cos �� + sin �� . 2 3 2 36 CHAPTER 3. SECOND-ORDER ODES, CONSTANT COEFFICIENTS 3.4.3 Repeated roots view tutorial Finally, we consider the characteristic equation, ����2 + ���� + �� = 0, with ��2 − 4���� = 0. The degenerate root is then given by �� = − �� , 2�� yielding only a single solution to the ode: ) ( ���� . ��1 (��) = exp − 2�� (3.13) To satisfy two initial conditions, a second independent solution must be found with nonzero Wronskian, and apparently this second solution is not of the form of our ansatz �� = exp (����). One method to determine this missing second solution is to try the ansatz ��(��) = �� (��)��1 (��), (3.14) where �� (��) is an unknown function that satisfies the differential equation obtained by substituting (3.14) into (3.9). This standard technique is called the reduction of order method and enables one to find a second solution of a homogeneous linear differential equation if one solution is known. If the original differential equation is of order ��, the differential equation for �� = �� (��) reduces to an order one lower, that is, �� − 1. Here, however, we will determine this missing second solution through a limiting process. We start with the solution obtained for complex roots of the characteristic equation, and then arrive at the solution obtained for degenerate roots by taking the limit �� → 0. Now, the general solution for complex roots was given by (3.12), and to properly limit this solution as �� → 0 requires first satisfying the specific initial conditions ��(0) = ��0 and �� ˙ (0) = ��0 . Solving for �� and �� , the general solution given by (3.12) becomes the specific solution ) ( ��0 − ����0 ��(��; ��) = ������ ��0 cos ���� + sin ���� . �� Here, we have written �� = ��(��; ��) to show explicitly that �� depends on ��. Taking the limit as �� → 0, and using lim��→0 ��−1 sin ���� = ��, we have ) ( lim ��(��; ��) = ������ ��0 + (��0 − ����0 )�� . ��→0 The second solution is observed to be a constant, ��0 − ����0 , times �� times the first solution, ������ . Our general solution to the ode (3.9) when ��2 − 4���� = 0 can therefore be written in the form ��(��) = (��1 + ��2 ��)������ , where �� is the repeated root of the characteristic equation. The main result to be remembered is that for the case of repeated roots, the second solution is �� times the first solution. 3.5. INHOMOGENEOUS ODES Example: Solve �� ¨ + 2�� ˙ + �� = 0 with ��(0) = 1 and �� ˙ (0) = 0. The characteristic equation is ��2 + 2�� + 1 = (�� + 1)2 = 0, 37 which has a repeated root given by �� = −1. Therefore, the general solution to the ode is ��(��) = ��1 ��−�� + ��2 ����−�� , with derivative �� ˙ (��) = −��1 ��−�� + ��2 ��−�� − ��2 ����−�� . Applying the initial conditions, we have ��1 = 1, −��1 + ��2 = 0, so that ��1 = ��2 = 1. Therefore, the solution is ��(��) = (1 + ��)��−�� . 3.5 Second-order linear inhomogeneous ode �� ¨ + ��(��)�� ˙ + �� (��)�� = �� (��), (3.15) We now consider the general second-order linear inhomogeneous ode (3.1): with initial conditions ��(��0 ) = ��0 and �� ˙ (��0 ) = ��0 . There is a three-step solution method when the inhomogeneous term �� (��) ̸= 0. (i) Find the general solution of the homogeneous equation �� ¨ + ��(��)�� ˙ + �� (��)�� = 0. Let us denote the homogeneous solution by ��ℎ (��) = ��1 ��1 (��) + ��2 ��2 (��), where ��1 and ��2 are linearly independent solutions of (3.16), and ��1 and ��2 are as yet undetermined constants. (ii) Find any particular solution ���� of the inhomogeneous equation (3.15). A particular solution is readily found when ��(��) and �� (��) are constants, and when �� (��) is a combination of polynomials, exponentials, sines and cosines. (iii) Write the general solution of (3.15) as the sum of the homogeneous and particular solutions, ��(��) = ��ℎ (��) + ���� (��), (3.17) (3.16) and apply the initial conditions to determine the constants ��1 and ��2 . Note that because of the linearity of (3.15), �� ¨ + ���� ˙ + ���� = �� ��2 (��ℎ + ���� ) + �� (��ℎ + ���� ) + �� (��ℎ + ���� ) ����2 ���� = (¨ ��ℎ + ���� ˙ ℎ + ����ℎ ) + (¨ ���� + ���� ˙ �� + ������ ) = 0 + �� = ��, 38 CHAPTER 3. SECOND-ORDER ODES, CONSTANT COEFFICIENTS so that (3.17) solves (3.15), and the two free constants in ��ℎ can be used to satisfy the initial conditions. We will consider here only the constant coefficient case. We now illustrate the solution method by an example. Example: Solve �� ¨ − 3�� ˙ − 4�� = 3��2�� with ��(0) = 1 and �� ˙ (0) = 0. view tutorial First, we solve the homogeneous equation. The characteristic equation is ��2 − 3�� − 4 = (�� − 4)(�� + 1) = 0, so that ��ℎ (��) = ��1 ��4�� + ��2 ��−�� . Second, we find a particular solution of the inhomogeneous equation. The form of the particular solution is chosen such that the exponential will cancel out of both sides of the ode. The ansatz we choose is ��(��) = ����2�� , (3.18) where �� is a yet undetermined coefficient. Upon substituting �� into the ode, differentiating using the chain rule, and canceling the exponential, we obtain 4�� − 6�� − 4�� = 3, from which we determine �� = −1/2. Obtaining a solution for �� independent of �� justifies the ansatz (3.18). Third, we write the general solution to the ode as the sum of the homogeneous and particular solutions, and determine ��1 and ��2 that satisfy the initial conditions. We have 1 ��(��) = ��1 ��4�� + ��2 ��−�� − ��2�� ; 2 and taking the derivative, �� ˙ (��) = 4��1 ��4�� − ��2 ��−�� − ��2�� . Applying the initial conditions, 1 = 1, 2 4��1 − ��2 − 1 = 0; ��1 + ��2 − or 3 , 2 4��1 − ��2 = 1. ��1 + ��2 = This system of linear equations can be solved for ��1 by adding the equations to obtain ��1 = 1/2, after which ��2 = 1 can be determined from the first equation. Therefore, the solution for ��(��) that satisfies both the ode and the initial 3.5. INHOMOGENEOUS ODES conditions is given by ��(��) = 1 4�� 1 2�� �� − �� + ��−�� 2 2 ) 1 4�� ( = �� 1 − ��−2�� + 2��−5�� , 2 39 where we have grouped the terms in the solution to better display the asymptotic behavior for large ��. We now find particular solutions for some relatively simple inhomogeneous terms using this method of undetermined coefficients. Example: Find a particular solution of �� ¨ − 3�� ˙ − 4�� = 2 sin ��. view tutorial We show two methods for finding a particular solution. The first more direct method tries the ansatz ��(��) = �� cos �� + �� sin ��, where the argument of cosine and sine must agree with the argument of sine in the inhomogeneous term. The cosine term is required because the derivative of sine is cosine. Upon substitution into the differential equation, we obtain (−�� cos �� − �� sin ��) − 3 (−�� sin �� + �� cos ��) − 4 (�� cos �� + �� sin ��) = 2 sin ��, or regrouping terms, − (5�� + 3�� ) cos �� + (3�� − 5�� ) sin �� = 2 sin ��. This equation is valid for all ��, and in particular for �� = 0 and ��/2, for which the sine and cosine functions vanish. For these two values of ��, we find 5�� + 3�� = 0, and solving for �� and �� , we obtain �� = 3 , 17 �� = − 5 . 17 3�� − 5�� = 2; The particular solution is therefore given by ���� = 1 (3 cos �� − 5 sin ��) . 17 The second solution method makes use of the relation ������ = cos �� + �� sin �� to convert the sine inhomogeneous term to an exponential function. We introduce the complex function �� (��) by letting �� (��) = ��(��) + ���� (��), and rewrite the differential equation in complex form. We can rewrite the equation in one of two ways. On the one hand, if we use sin �� = Re{−�������� }, then the differential equation is written as �� ¨ − 3�� ˙ − 4�� = −2�������� ; (3.19) 40 CHAPTER 3. SECOND-ORDER ODES, CONSTANT COEFFICIENTS and by equating the real and imaginary parts, this equation becomes the two real differential equations �� ¨ − 3�� ˙ − 4�� = 2 sin ��, �� ¨ − 3�� ˙ − 4�� = −2 cos ��. The solution we are looking for, then, is ���� (��) = Re{���� (��)}. On the other hand, if we write sin �� = Im{������ }, then the complex differential equation becomes �� ¨ − 3�� ˙ − 4�� = 2������ , (3.20) which becomes the two real differential equations �� ¨ − 3�� ˙ − 4�� = 2 cos ��, �� ¨ − 3�� ˙ − 4�� = 2 sin ��. Here, the solution we are looking for is ���� (��) = Im{���� (��)}. We will proceed here by solving (3.20). As we now have an exponential function as the inhomogeneous term, we can make the ansatz �� (��) = �������� , where we now expect �� to be a complex constant. Upon substitution into the ode (3.20) and using ��2 = −1: −�� − 3���� − 4�� = 2; or solving for �� : �� = −2 5 + 3�� −2(5 − 3��) = (5 + 3��)(5 − 3��) −10 + 6�� = 34 −5 + 3�� = . 17 Therefore, ���� = Im{���� } } { 1 (−5 + 3��)(cos �� + �� sin ��) = Im 17 1 = (3 cos �� − 5 sin ��). 17 Example: Find a particular solution of �� ¨ + �� ˙ − 2�� = ��2 . view tutorial The correct ansatz here is the polynomial ��(��) = ����2 + ���� + ��. Upon substitution into the ode, we have 2�� + 2���� + �� − 2����2 − 2���� − 2�� = ��2 , 3.6. FIRST-ORDER LINEAR INHOMOGENEOUS ODES REVISITED or −2����2 + 2(�� − �� )�� + (2�� + �� − 2�� )��0 = ��2 . Equating powers of ��, −2�� = 1, and solving, 1 �� = − , 2 1 �� = − , 2 3 �� = − . 4 2(�� − �� ) = 0, 2�� + �� − 2�� = 0; 41 The particular solution is therefore 1 1 3 ���� (��) = − ��2 − �� − . 2 2 4 3.6 First-order linear inhomogeneous odes revisited The first-order linear ode can be solved by use of an integrating factor. Here I show that odes having constant coefficients can be solved by our newly learned solution method. Example: Solve �� ˙ + 2�� = ��−�� with ��(0) = 3/4. Rather than using an integrating factor, we follow the three-step approach: (i) find the general homogeneous solution; (ii) find a particular solution; (iii) add them and satisfy initial conditions. Accordingly, we try the ansatz ��ℎ (��) = ������ for the homogeneous ode �� ˙ + 2�� = 0 and find �� + 2 = 0, or �� = −2. To find a particular solution, we try the ansatz ���� (��) = ����−�� , and upon substitution −�� + 2�� = 1, or �� = 1. Therefore, the general solution to the ode is ��(��) = ����−2�� + ��−�� . The single initial condition determines the unknown constant ��: ��(0) = so that �� = −1/4. Hence, 1 ��(��) = ��−�� − ��−2�� ( 4 ) 1 −�� = �� 1 − ��−�� . 4 3 = �� + 1, 4 42 CHAPTER 3. SECOND-ORDER ODES, CONSTANT COEFFICIENTS 3.7 Resonance view tutorial Resonance occurs when the frequency of the inhomogeneous term matches the frequency of the homogeneous solution. To illustrate resonance in its simplest embodiment, we consider the second-order linear inhomogeneous ode 2 �� ¨ + ��0 �� = �� cos ����, ��(0) = ��0 , �� ˙ (0) = ��0 . (3.21) Our main goal is to determine what happens to the solution in the limit �� → ��0 . The homogeneous equation has characteristic equation 2 ��2 + ��0 = 0, so that ��± = ±����0 . Therefore, ��ℎ (��) = ��1 cos ��0 �� + ��2 sin ��0 ��. (3.22) To find a particular solution, we note the absence of a first-derivative term, and simply try ��(��) = �� cos ����. Upon substitution into the ode, we obtain 2 −�� 2 �� + ��0 �� = ��, or �� = Therefore, ���� (��) = Our general solution is thus ��(��) = ��1 cos ��0 �� + ��2 sin ��0 �� + with derivative �� ˙ (��) = ��0 (��2 cos ��0 �� − ��1 sin ��0 ��) − Initial conditions are satisfied when ��0 = ��1 + �� 2 − �� 2 , ��0 �� �� 2 − �� 2 sin ����. ��0 �� 2 − �� 2 cos ����, ��0 2 ��0 �� 2 − �� 2 . ��0 �� cos ����. − �� 2 ��0 = ��2 ��0 , so that ��1 = ��0 − �� 2 − �� 2 , ��0 ��2 = ��0 . ��0 3.7. RESONANCE Therefore, the solution to the ode that satisfies the initial conditions is ) ( ��0 �� �� cos ��0 �� + cos ���� ��(��) = ��0 − 2 sin ��0 �� + 2 2 ��0 − �� ��0 ��0 − �� 2 ��0 �� (cos ���� − cos ��0 ��) = ��0 cos ��0 �� + , sin ��0 �� + 2 − �� 2 ��0 ��0 43 where we have grouped together terms proportional to the forcing amplitude �� . Resonance occurs in the limit �� → ��0 ; that is, the frequency of the inhomogeneous term (the external force) matches the frequency of the homogeneous solution (the free oscillation). By L’Hospital’s rule, the limit of the term proportional to �� is found by differentiating with respect to �� : lim −�� �� sin ���� �� (cos ���� − cos ��0 ��) = lim 2 2 �� →��0 ��0 − �� −2�� �� �� sin ��0 �� = . 2��0 �� →��0 (3.23) At resonance, the term proportional to the amplitude �� of the inhomogeneous term increases linearly with ��, resulting in larger-and-larger amplitudes of oscillation for ��(��). In general, if the inhomogeneous term in the differential equation is a solution of the corresponding homogeneous differential equation, then the correct ansatz for the particular solution is a constant times the inhomogeneous term times ��. To illustrate this same example further, we return to the original ode, now assumed to be exactly at resonance, 2 �� ¨ + ��0 �� = �� cos ��0 ��, and find a particular solution directly. The particular solution is the real part of the particular solution of 2 �� ¨ + ��0 �� = �� ������0 �� , and because the inhomogeneous term is a solution of the corresponding homogeneous equation, we take as our ansatz ���� = ����������0 �� . We have �� ˙�� = ��������0 �� (1 + ����0 ��) , and upon substitution into the ode ( ) 2 2 2 �� ¨�� + ��0 ���� = ��������0 �� 2����0 − ��0 �� + ��0 ����������0 �� = 2����0 ��������0 �� = �� ������0 �� . Therefore, �� = �� , 2����0 ( ) 2 �� ¨�� = ��������0 �� 2����0 − ��0 �� ; 44 CHAPTER 3. SECOND-ORDER ODES, CONSTANT COEFFICIENTS and ���� = Re{ �� �� ����0 �� �� } 2����0 �� �� sin ��0 �� , = 2��0 the same result as (3.23). Example: Find a particular solution of �� ¨ − 3�� ˙ − 4�� = 5��−�� . view tutorial If we naively try the ansatz �� = ����−�� , and substitute this into the inhomogeneous differential equation, we obtain �� + 3�� − 4�� = 5, or 0 = 5, which is clearly nonsense. Our ansatz therefore fails to find a solution. The cause of this failure is that the corresponding homogeneous equation has solution ��ℎ = ��1 ��4�� + ��2 ��−�� , so that the inhomogeneous term 5��−�� is one of the solutions of the homogeneous equation. To find a particular solution, we should therefore take as our ansatz �� = ������−�� , with first- and second-derivatives given by �� ˙ = ����−�� (1 − ��), �� ¨ = ����−�� (−2 + ��). Substitution into the differential equation yields ����−�� (−2 + ��) − 3����−�� (1 − ��) − 4������−�� = 5��−�� . The terms containing �� cancel out of this equation, resulting in −5�� = 5, or �� = −1. Therefore, the particular solution is ���� = −����−�� . 3.8 Damped resonance view tutorial A more realistic study of resonance assumes an additional damping term. The forced, damped harmonic oscillator equation may be written as ���� ¨ + �� �� ˙ + ���� = �� cos ����, (3.24) where �� > 0 is the oscillator’s mass, �� > 0 is the damping coefficient, �� > 0 is the spring constant, and �� is the amplitude of the external force. The homogeneous equation has characteristic equation ����2 + ���� + �� = 0, 3.8. DAMPED RESONANCE so that 45 �� 1 √ 2 ± �� − 4����. 2�� 2�� When �� 2 − 4���� < 0, the motion of the unforced oscillator is said to be underdamped; when �� 2 − 4���� > 0, overdamped; and when �� 2 − 4���� = 0, critically damped. For all three types of damping, the roots of the characteristic equation satisfy Re(��± ) < 0. Therefore, both linearly independent homogeneous solutions decay exponentially to zero, and the long-time asymptotic solution of (3.24) reduces to the (non-decaying) particular solution. Since the initial conditions are satisfied by the free constants multiplying the (decaying) homogeneous solutions, the long-time asymptotic solution is independent of the initial conditions. If we are only interested in the long-time asymptotic solution of (3.24), we can proceed directly to the determination of a particular solution. As before, we consider the complex ode ��± = − ���� ¨ + �� �� ˙ + ���� = �� �������� , with ���� = Re(���� ). With the ansatz ���� = ���������� , we have −���� 2 �� + �������� + ���� = ��, or �� = �� . (�� − ���� 2 ) + ������ √ To simplify, we define ��0 = ��/��, which corresponds to the natural frequency of the undamped oscillator, and define Γ = ����/�� and �� = ��/��. Therefore, �� = �� 2 − �� 2 ) + ��Γ (��0 ( ) ( 2 ) �� = (��0 − �� 2 ) − ��Γ . 2 2 2 2 (��0 − �� ) + Γ (3.25) To determine ���� , we utilize the polar form of a complex number. The complex ���� number �� = �� + ���� can √ be written in polar form as �� = ���� , where �� = �� cos ��, �� = �� sin ��, and �� = ��2 + �� 2 , tan �� = ��/��. We therefore write 2 (��0 − �� 2 ) − ��Γ = �������� , with �� = √ 2 − �� 2 )2 + Γ2 , (��0 tan �� = (�� 2 Γ 2) . − ��0 Using the polar form, �� in (3.25) becomes ( ) �� �� = √ 2 ������ , (��0 − �� 2 )2 + Γ2 and ���� = Re(���������� ) becomes ( ���� = ( = √ √ �� ) 2 − �� 2 )2 + Γ2 (��0 ( ) Re ����(����+��) (3.26) cos (���� + ��). �� 2 − �� 2 )2 + Γ2 (��0 ) 46 CHAPTER 3. SECOND-ORDER ODES, CONSTANT COEFFICIENTS 2 The particular solution given by (3.26), with ��0 = ��/��, Γ = ����/��, �� = ��/��, 2 2 and tan �� = ����/��(�� − ��0 ), is the long-time asymptotic solution of the forced, damped, harmonic oscillator equation (3.24). We conclude with a couple of observations about (3.26). First, if the forcing frequency �� is equal to the natural frequency ��0 of the undamped oscillator, then �� = −����/����0 , and ���� = (��/����0 ) sin ��0 ��. The oscillator position is observed to be ��/2 out of phase with the external force, or in other words, the velocity of the oscillator, not the position, is in phase with the force. Second, the value of the forcing frequency ���� that maximizes the amplitude of oscillation is the value of �� that minimizes the denominator of (3.26). To determine ���� we thus minimize the function �� (�� 2 ) with respect to �� 2 , where 2 �� (�� 2 ) = (��0 − �� 2 )2 + �� 2 �� 2 . ��2 Taking the derivative of �� with respect to �� 2 and setting this to zero to determine ���� yields �� 2 2 2 2(���� − ��0 ) + 2 = 0, �� or �� 2 2 2 . ���� = ��0 − 2��2 We can interpret this result by saying that damping lowers the “resonance” frequency of the undamped oscillator. Chapter 4 The Laplace transform Reference: Boyce and DiPrima, Chapter 6 The Laplace transform is most useful for solving linear, constant-coefficient ode’s when the inhomogeneous term or its derivative is discontinuous. Although ode’s with discontinuous inhomogeneous terms can also be solved by adopting already learned methods, we will see that the Laplace transform technique provides a simpler, more elegant solution. 4.1 Definitions and properties of the forward and inverse Laplace transforms view tutorial The main idea is to Laplace transform the constant-coefficient differential equation for ��(��) into a simpler algebraic equation for the Laplace-transformed function �� (��), solve this algebraic equation, and then transform �� (��) back into ��(��). The correct definition of the Laplace transform and the properties that this transform satisfies makes this solution method possible. An exponential ansatz is used in solving homogeneous constant-coefficient odes, and the exponential function correspondingly plays a key role in defining the Laplace transform. The Laplace transform of �� (��), denoted by �� (��) = ℒ{�� (��)}, is defined by the integral transform ∫ ∞ �� (��) = ��−���� �� (��)����. (4.1) 0 The improper integral given by (4.1) diverges if �� (��) grows faster than ������ for large ��. Accordingly, some restriction on the range of �� may be required to guarantee convergence of (4.1), and we will assume without further elaboration that these restrictions are always satisfied. The Laplace transform is a linear transformation. We have ∫ ∞ ( ) ℒ{��1 ��1 (��) + ��2 ��2 (��)} = ��−���� ��1 ��1 (��) + ��2 ��2 (��) ���� 0 ∫ ∞ ∫ ∞ = ��1 ��−���� ��1 (��)���� + ��2 ��−���� ��2 (��)���� 0 0 = ��1 ℒ{��1 (��)} + ��2 ℒ{��2 (��)}. 47 48 CHAPTER 4. THE LAPLACE TRANSFORM �� (��) = ℒ−1 {�� (��)} 1. ������ �� (��) 2. 1 3. ������ 4. ���� 5. ���� ������ 6. sin ���� 7. cos ���� 8. ������ sin ���� 9. ������ cos ���� 10. �� sin ���� 11. �� cos ���� 12. ���� (��) 13. ���� (��)�� (�� − ��) 14. �� (�� − ��) 15. �� ˙ (��) 16. �� ¨(��) �� (��) = ℒ{�� (��)} �� (�� − ��) 1 �� 1 �� − �� ��! ����+1 ��! (�� − ��)��+1 ��2 ��2 �� + ��2 �� + ��2 �� (�� − ��)2 + ��2 �� − �� (�� − ��)2 + ��2 2���� (��2 + ��2 )2 ��2 − ��2 (��2 + ��2 )2 ��−���� �� ��−���� �� (��) ��−���� ���� (��) − ��(0) ��2 �� (��) − ����(0) − �� ˙ (0) Table 4.1: Table of Laplace Transforms 4.1. DEFINITION AND PROPERTIES 49 There is also a one-to-one correspondence between functions and their Laplace transforms. A table of Laplace transforms can therefore be constructed and used to find both Laplace and inverse Laplace transforms of commonly occurring functions. Such a table is shown in Table 4.1 (and this table will be distributed with the exams). In Table 4.1, �� is a positive integer. Also, the cryptic entries for ���� (��) and �� (�� − ��) will be explained later in S4.3. The rows of Table 4.1 can be determined by a combination of direct integration and some tricks. We first compute directly the Laplace transform of ������ �� (��) (line 1): ∫ ∞ ℒ{������ �� (��)} = ��−���� ������ �� (��)���� 0 ∫ ∞ = ��−(��−��)�� �� (��)���� 0 = �� (�� − ��). We also compute directly the Laplace transform of 1 (line 2): ∫ ∞ ℒ{1} = ��−���� ���� 0 ]∞ 1 −���� = − �� �� 0 1 = . �� Now, the Laplace transform of ������ (line 3) may be found using these two results: ℒ{������ } = ℒ{������ · 1} 1 = . �� − �� (4.2) The transform of ���� (line 4) can be found by successive integration by parts. A more interesting method uses Taylor series expansions for ������ and 1/(�� − ��). We have { ∞ } ∑ (����)�� ���� ℒ{�� } = ℒ ��! ��=0 (4.3) ∞ ∑ ���� = ℒ{���� }. ��! ��=0 Also, with �� > ��, 1 1 = �� − �� ��(1 − �� �� ) ∞ ( )�� ∑ 1 �� = �� ��=0 �� = ∞ ∑ ���� . ����+1 ��=0 (4.4) 50 CHAPTER 4. THE LAPLACE TRANSFORM Using (4.2), and equating the coefficients of powers of �� in (4.3) and (4.4), results in line 4: ��! ℒ{���� } = ��+1 . �� The Laplace transform of ���� ������ (line 5) can be found from line 1 and line 4: ℒ{���� ������ } = ��! . (�� − ��)��+1 The Laplace transform of sin ���� (line 6) may be found from the Laplace transform of ������ (line 3) using �� = ����: { } ℒ{sin ����} = Im ℒ{�������� } { } 1 = Im �� − ���� } { �� + ���� = Im ��2 + ��2 �� = 2 . �� + ��2 Similarly, the Laplace transform of cos ���� (line 7) is { } ℒ{cos ����} = Re ℒ{�������� } �� = 2 . �� + ��2 The transform of ������ sin ���� (line 8) can be found from the transform of sin ���� (line 6) and line 1: �� ℒ{������ sin ����} = ; (�� − ��)2 + ��2 and similarly for the transform of ������ cos ����: ℒ{������ cos ����} = �� − �� . (�� − ��)2 + ��2 The Laplace transform of �� sin ���� (line 10) can be found from the Laplace transform of �������� (line 5 with �� = 1) using �� = ����: { } ℒ{�� sin ����} = Im ℒ{���������� } { } 1 = Im (�� − ����)2 { } (�� + ����)2 = Im (��2 + ��2 )2 2���� = 2 . (�� + ��2 )2 Similarly, the Laplace transform of �� cos ���� (line 11) is { } ℒ{�� cos ����} = Re ℒ{���������� } } { (�� + ����)2 = Re (��2 + ��2 )2 ��2 − ��2 = 2 . (�� + ��2 )2 4.2. SOLUTION OF INITIAL VALUE PROBLEMS 51 We now transform the inhomogeneous constant-coefficient, second-order, linear inhomogeneous ode for �� = ��(��), ���� ¨ + ���� ˙ + ���� = �� (��), making use of the linearity of the Laplace transform: ��ℒ{�� ¨} + ��ℒ{�� ˙ } + ��ℒ{��} = ℒ{�� }. To determine the Laplace transform of �� ˙ (��) (line 15) in terms of the Laplace transform of ��(��) and the initial conditions ��(0) and �� ˙ (0), we define �� (��) = ℒ{��(��)}, and integrate ∫ ∞ ��−���� ������ ˙ 0 by parts. We let �� = ��−���� ���� = −���� Therefore, ∫ 0 ∞ −���� ���� = ������ ˙ ���� �� = ��. ��−���� ������ ˙ = ����−���� ]∞ 0 ∫ + �� 0 ∞ ��−���� ������ = ���� (��) − ��(0), where assumed convergence of the Laplace transform requires ��→∞ lim ��(��)��−���� = 0. Similarly, the Laplace transform of �� ¨(��) (line 16) is determined by integrating ∫ ∞ ��−���� �� ¨���� 0 by parts and using the just derived result for the first derivative. We let �� = ��−���� ���� = −���� so that ∫ 0 ∞ −���� ���� = �� ¨���� ���� ∞ �� = ��, ˙ �� −���� �� ¨���� = + �� ��−���� ������ ˙ 0 ( ) = −�� ˙ (0) + �� ���� (��) − ��(0) = ��2 �� (��) − ����(0) − �� ˙ (0), ]∞ ���� ˙ −���� 0 ∫ where similarly we assume lim��→∞ �� ˙ (��)��−���� = 0. 4.2 Solution of initial value problems We begin with a simple homogeneous ode and show that the Laplace transform method yields an identical result to our previously learned method. We then apply the Laplace transform method to solve an inhomogeneous equation. 52 CHAPTER 4. THE LAPLACE TRANSFORM Example: Solve �� ¨ − �� ˙ − 2�� = 0 with ��(0) = 1 and �� ˙ (0) = 0 by two different methods. view tutorial The characteristic equation of the ode is determined from the ansatz �� = ������ and is ��2 − �� − 2 = (�� − 2)(�� + 1) = 0. The general solution of the ode is therefore ��(��) = ��1 ��2�� + ��2 ��−�� . To satisfy the initial conditions, we must have 1 = ��1 + ��2 and 0 = 2��1 − ��2 , 2 1 and ��2 = 3 . Therefore, the solution to the ode that satisfies requiring ��1 = 3 the initial conditions is given by ��(��) = 1 2�� 2 −�� �� + �� . 3 3 (4.5) We now solve this example using the Laplace transform. Taking the Laplace transform of both sides of the ode, using the linearity of the transform, and applying our result for the transform of the first and second derivatives, we find [��2 �� (��) − ����(0) − �� ˙ (0)] − [���� (��) − ��(0)] − [2�� (��)] = 0, or �� (��) = (�� − 1)��(0) + �� ˙ (0) . ��2 − �� − 2 Note that the denominator of the right-hand-side is just the quadratic from the characteristic equation of the homogeneous ode, and that this factor arises from the derivatives of the exponential term in the Laplace transform integral. Applying the initial conditions, we find �� (��) = �� − 1 . (�� − 2)(�� + 1) (4.6) We have thus determined the Laplace transformed solution �� (��) = ℒ{��(��)}. We now need to compute the inverse Laplace transform ��(��) = ℒ−1 {�� (��)}. However, direct inversion of (4.6) by searching Table 4.1 is not possible, but a partial fraction expansion may be useful. In particular, we write �� �� �� − 1 = + . (�� − 2)(�� + 1) �� − 2 �� + 1 (4.7) The cover-up method can be used to solve for �� and ��. We multiply both sides of (4.7) by �� − 2 and put �� = 2 to isolate ��: �� = �� − 1 �� + 1 1 = . 3 ] ��=2 4.2. SOLUTION OF INITIAL VALUE PROBLEMS 53 Similarly, we multiply both sides of (4.7) by �� + 1 and put �� = −1 to isolate ��: ] �� − 1 �� = �� − 2 ��=−1 2 = . 3 Therefore, �� (��) = 1 1 2 1 · + · , 3 �� − 2 3 �� + 1 and line 3 of Table 4.1 gives us the inverse transforms of each term separately to yield 1 2 ��(��) = ��2�� + ��−�� , 3 3 identical to (4.5). Example: Solve �� ¨ + �� = sin 2�� with ��(0) = 2 and �� ˙ (0) = 1 by Laplace transform methods. Taking the Laplace transform of both sides of the ode, we find ��2 �� (��) − ����(0) − �� ˙ (0) + �� (��) = ℒ{sin 2��} 2 , = 2 �� + 4 where the Laplace transform of sin 2�� made use of line 6 of Table 4.1. Substituting for ��(0) and �� ˙ (0) and solving for �� (��), we obtain �� (��) = 2�� + 1 2 + 2 . 2 �� + 1 (�� + 1)(��2 + 4) To determine the inverse Laplace transform from Table 4.1, we perform a partial fraction expansion of the second term: (��2 2 ���� + �� ���� + �� = 2 + . 2 + 1)(�� + 4) �� + 1 ��2 + 4 (4.8) By inspection, we can observe that �� = �� = 0 and that �� = −��. A quick calculation shows that 3�� = 2, or �� = 2/3. Therefore, �� (��) = 2�� + 1 2/3 2/3 + 2 − 2 2 �� + 1 �� + 1 (�� + 4) 2�� 5/3 2/3 = 2 + 2 − 2 . �� + 1 �� + 1 (�� + 4) From lines 6 and 7 of Table 4.1, we obtain the solution by taking inverse Laplace transforms of the three terms separately, where �� = 1 in the first two terms, and �� = 2 in the third term: ��(��) = 2 cos �� + 5 1 sin �� − sin 2��. 3 3 54 CHAPTER 4. THE LAPLACE TRANSFORM 4.3 Heaviside and Dirac delta functions The Laplace transform technique becomes truly useful when solving odes with discontinuous or impulsive inhomogeneous terms, these terms commonly modeled using Heaviside or Dirac delta functions. We will discuss these functions in turn, as well as their Laplace transforms. 4.3.1 Heaviside function view tutorial The Heaviside or unit step function, denoted here by ���� (��), is zero for �� < �� and is one for �� ≥ ��; that is, { 0, �� < ��; ���� (��) = (4.9) 1, �� ≥ ��. The precise value of ���� (��) at the single point �� = �� shouldn’t matter. The Heaviside function can be viewed as the step-up function. The stepdown function—one for �� < �� and zero for �� ≥ ��—is defined as { 1 − ���� (��) = 1, 0, �� < ��; �� ≥ ��. (4.10) The step-up, step-down function—zero for �� < ��, one for �� ≤ �� < ��, and zero for �� ≥ ��—is defined as ⎧ ⎨ 0, 1, ���� (��) − ���� (��) = ⎩ 0, �� < ��; �� ≤ �� < ��; �� ≥ ��. (4.11) The Laplace transform of the Heaviside function is determined by integration: ∫ ℒ{���� (��)} = ∫0 ∞ = = �� �� −���� ∞ ��−���� ���� (��)���� ��−���� ���� , �� and is given in line 12 of Table 4.1. The Heaviside function can be used to represent a translation of a function �� (��) a distance �� in the positive �� direction. We have { ���� (��)�� (�� − ��) = 0, f(t-c), �� < ��; �� ≥ ��. 4.3. HEAVISIDE AND DIRAC DELTA FUNCTIONS 55 x=f(t) x t Figure 4.1: A linearly increasing function which turns into a sinusoidal function. The Laplace transform is ∫ ℒ{���� (��)�� (�� − ��)} = 0 ∞ ��−���� ���� (��)�� (�� − ��)���� ∞ ∫ = ��−���� �� (�� − ��)���� ′ = ��−��(�� +��) �� (��′ )����′ 0 ∫ ∞ ′ −���� = �� ��−���� �� (��′ )����′ 0 ∫�� ∞ = ��−���� �� (��), where we have changed variables to ��′ = �� − ��. The translation of �� (��) a distance �� in the positive �� direction corresponds to the multiplication of �� (��) by the exponential ��−���� . This result is shown in line 13 of Table 4.1. Piecewise-defined inhomogeneous terms can be modeled using Heaviside functions. For example, consider the general case of a piecewise function defined on two intervals: { ��1 (��), if �� < ��* ; �� (��) = ��2 (��), if �� ≥ ��* . Using the Heaviside function ����* , the function �� (��) can be written in a single line as ( ) �� (��) = ��1 (��) + ��2 (��) − ��1 (��) ����* (��). This example can be generalized to piecewise functions defined on multiple intervals. As a concrete example, suppose the inhomogeneous term is represented by a linearly increasing function, which then turns into a sinusoidal function for 56 CHAPTER 4. THE LAPLACE TRANSFORM �� > ��* , as sketched in Fig. 4.1. Explicitly, { ����, ( ) if �� < ��* ; �� (��) = ����* + �� sin �� (�� − ��* ) , if �� ≥ ��* . We can rewrite �� (��) using the Heaviside function ����* (��): ( ) ( ) �� (��) = ���� + �� sin �� (�� − ��* ) − ��(�� − ��* ) · ����* (��). This specific form of �� (��) enables a relatively easy Laplace transform. We can write �� (��) = ���� + ℎ(�� − ��* )����* (��), where we have defined ℎ(��) = �� sin ���� − ����. Using line 13, the Laplace transform of �� (��) is �� (��) = ��ℒ{��} + ℒ{ℎ(�� − ��* )����* (��)} = ��ℒ{��} + ��−��* �� ℒ{ℎ(��)}, and where using lines 4 and 6, ℒ{��} = 1 , ��2 ℒ{ℎ(��)} = ���� �� − 2. ��2 + �� 2 �� 4.3.2 Dirac delta function view tutorial The Dirac delta function, denoted as �� (��), is defined by requiring that for any function �� (��), ∫ ∞ �� (��)�� (��)���� = �� (0). −∞ The usual view of the shifted Dirac delta function �� (�� − ��) is that it is zero everywhere except at �� = ��, where it is infinite, and the integral over the Dirac delta function is one. The Dirac delta function is technically not a function, but is what mathematicians call a distribution. Nevertheless, in most cases of practical interest, it can be treated like a function, where physical results are obtained following a final integration. There are many ways to represent the Dirac delta function as a limit of a well-defined function. For our purposes, the most useful representation makes use of the step-up, step-down function of (4.11): �� (�� − ��) = lim 1 (����−�� (��) − ����+�� (��)). 2�� ��→0 Before taking the limit, the well-defined step-up, step-down function is zero except over a small interval of width 2�� centered at �� = ��, over which it takes the large value 1/2��. The integral of this function is one, independent of the value of ��. 4.4. DISCONTINUOUS OR IMPULSIVE TERMS 57 The Laplace transform of the Dirac delta function is easily found by integration using the definition of the delta function: ∫ ∞ ℒ{�� (�� − ��)} = ��−���� �� (�� − ��)���� 0 = ��−���� . This result is shown in line 14 of Table 4.1. 4.4 Discontinuous or impulsive inhomogeneous terms We now solve some more challenging ode’s with discontinuous or impulsive inhomogeneous terms. Example: Solve 2¨ �� + �� ˙ + 2�� = ��5 (��) − ��20 (��), with ��(0) = �� ˙ (0) = 0 The inhomogeneous term here is a step-up, step-down function that is unity over the interval (5, 20) and zero elsewhere. Taking the Laplace transform of the ode using Table 4.1, ( ) ��−20�� ��−5�� − . 2 ��2 �� (��) − ����(0) − �� ˙ (0) + ���� (��) − ��(0) + 2�� (��) = �� �� Using the initial values and solving for �� (��), we find �� (��) = ��−5�� − ��−20�� . ��(2��2 + �� + 2) To determine the solution for ��(��) we now need to find the inverse Laplace transform. The exponential functions can be dealt with using line 13 of Table 4.1. We write �� (��) = (��−5�� − ��−20�� )�� (��), where �� (��) = Then using line 13, we have ��(��) = ��5 (��)ℎ(�� − 5) − ��20 (��)ℎ(�� − 20), (4.12) 1 . ��(2��2 + �� + 2) where ℎ(��) = ℒ−1 {�� (��)}. To determine ℎ(��) we need the partial fraction expansion of �� (��). Since the discriminant of 2��2 + �� + 2 is negative, we have �� ���� + �� 1 = + 2 , ��(2��2 + �� + 2) �� 2�� + �� + 2 yielding the equation 1 = ��(2��2 + �� + 2) + (���� + ��)��; 58 or after equating powers of ��, CHAPTER 4. THE LAPLACE TRANSFORM 2�� + �� = 0, �� + �� = 0, 2�� = 1, 1 , �� = −1, and �� = − 1 yielding �� = 2 2 . Therefore, �� (��) = �� + 1 1/2 2 − 2 �� 2�� + �� + 2 ) ( 1 �� + 2 1 1 . = − 2 �� ��2 + 1 2 �� + 1 Inspecting Table 4.1, the first term can be transformed using line 2, and the second term can be transformed using lines 8 and 9, provided we complete the square of the denominator and then massage the numerator. That is, first we complete the square: ( )2 1 1 15 ��2 + �� + 1 = �� + + ; 2 4 16 and next we write √ ( ) 15 1 √1 �� + 1 �� + 2 4 + 15 16 = ( )2 15 . 1 2 1 �� + 2 �� + 1 �� + 4 + 16 Therefore, the function �� (��) can be written as √ ⎛ ) ( ( ) 15 1 �� + 4 1 1 ⎝1 16 √ − �� (��) = − 1 2 1 2 2 �� (�� + 4 ) + 15 ( �� + ) + 15 16 4 ⎞ 15 16 ⎠. The first term is transformed using line 2, the second term using line 9 and the third term using line 8. We finally obtain ( ( )) √ √ 1 1 ℎ(��) = 1 − ��−��/4 cos ( 15��/4) + √ sin ( 15��/4) , (4.13) 2 15 which when combined with (4.12) yields the rather complicated solution for ��(��). We briefly comment that it is also possible to solve this example without using the Laplace transform. The key idea is that both �� and �� ˙ are continuous functions of ��. Clearly from the form of the inhomogeneous term and the initial conditions, ��(��) = 0 for 0 ≤ �� ≤ 5. We then solve the ode between 5 ≤ �� ≤ 20 with the inhomogeneous term equal to unity and initial conditions ��(5) = �� ˙ (5) = 0. This requires first finding the general homogeneous solution, next finding a particular solution, and then adding the homogeneous and particular solutions and solving for the two unknown constants. To simplify the algebra, note that the best ansatz to use to find the homogeneous solution is ��(��) = ����(��−5) , and not ��(��) = ������ . Finally, we solve the homogeneous ode for �� ≥ 20 using as boundary conditions the previously determined values ��(20) and �� ˙ (20), where we have made use of the continuity of �� and �� ˙ . Here, the best ansatz to use is ��(��) = ����(��−20) . The student may benefit by trying this as an exercise and attempting to obtain a final solution that agrees with the form given by (4.12) and (4.13). 4.4. DISCONTINUOUS OR IMPULSIVE TERMS Example: Solve 2¨ �� + �� ˙ + 2�� = �� (�� − 5) with ��(0) = �� ˙ (0) = 0 59 Here the inhomogeneous term is an impulse at time �� = 5. Taking the Laplace transform of the ode using Table 4.1, and applying the initial conditions, (2��2 + �� + 2)�� (��) = ��−5�� , so that �� (��) = = 1 −5�� �� 2 ( ( 1 1 ��2 + 2 �� + 1 ) ) 1 −5�� 1 �� 1 2 2 ) + 15 (�� + 4 16 √ ⎛ √ 15 1 16 −5�� ⎝ 16 = �� 1 2 2 15 (�� + 4 ) + ⎞ 15 16 ⎠. The inverse Laplace transform may now be computed using lines 8 and 13 of Table 4.1: (√ ) 2 ��(��) = √ ��5 (��)��−(��−5)/4 sin 15(�� − 5)/4 . (4.14) 15 It is interesting to solve this example without using a Laplace transform. Clearly, ��(��) = 0 up to the time of impulse at �� = 5. Furthermore, after the impulse the ode is homogeneous and can be solved with standard methods. The only difficulty is determining the initial conditions of the homogeneous ode at �� = 5+ . When the inhomogeneous term is proportional to a delta-function, the solution ��(��) is continuous across the delta-function singularity, but the derivative of the solution �� ˙ (��) is discontinuous. If we integrate the second-order ode across the singularity at �� = 5 and consider �� → 0, only the second derivative term of the left-hand-side survives, and ∫ 5+�� ∫ 5+�� 2 �� ¨���� = �� (�� − 5)���� 5−�� 5−�� = 1. And as �� → 0, we have �� ˙ (5+ ) − �� ˙ (5− ) = 1/2. Since �� ˙ (5− ) = 0, the appropriate initial conditions immediately after the impulse force are ��(5+ ) = 0 and �� ˙ (5+ ) = 1/2. This result can be confirmed using (4.14). 60 CHAPTER 4. THE LAPLACE TRANSFORM Chapter 5 Series solutions of second-order linear homogeneous differential equations Reference: Boyce and DiPrima, Chapter 5 We consider the second-order linear homogeneous differential equation for �� = �� (��): �� (��)�� ′′ + ��(��)�� ′ + ��(��)�� = 0, (5.1) where �� (��), ��(��) and ��(��) are polynomials or convergent power series (around �� = ��0 ), with no common polynomial factors (that could be divided out). The value �� = ��0 is called an ordinary point of (5.1) if �� (��0 ) ̸= 0, and is called a singular point if �� (��0 ) = 0. Singular points will later be further classified as regular singular points and irregular singular points. Our goal is to find two independent solutions of (5.1), valid in a neighborhood about �� = ��0 . 5.1 Ordinary points If ��0 is an ordinary point of (5.1), then it is possible to determine two power series solutions (i.e., Taylor series) for �� = �� (��) that converge in a neighborhood of �� = ��0 . We illustrate the method of solution by solving two examples. Example: Find the general solution of �� ′′ + �� = 0. view tutorial By now, you should know that the general solution is �� (��) = ��0 cos �� + ��1 sin ��, with ��0 and ��1 constants.
Introduction to Differential Equations. In high school, you studied algebraic equations like. The goal here was to solve the equation, which meant to find the value ..
In high school, you studied algebraic equations like The goal here was to solve the equation, which meant to find the value (or values) of the variable that makes the equation true. For example, x = 2 is the solution to the first equation because only when 2 is substituted for the variable x does the equation become an identity (both sides of the equation are identical when and only when x = 2). In general, each type of algebraic equation had its own particular method of solution; quadratic equations were solved by one method, equations involving absolute values by another, and so on. In each case, an equation was presented (or arose from a word problem), and a certain method was employed to arrive at a solution, a method appropriate for the particular equation at hand. These same general ideas carry over to differential equations, which are equations involving derivatives. There are different types of differential equations, and each type requires its own particular solution method. The simplest differential equations are those of the form y′ = ƒ( x). For example, consider the differential equation It says that the derivative of some function y is equal to 2 x. To solve the equation means to determine the unknown (the function y) which will turn the equation into an identity upon substitution. In this case all that is needed to solve the equation is an integration: Thus, the general solution of the differential equation y′ = 2 x is y = x 2 + c, where c is any arbitrary constant. Note that there are actually infinitely many particular solutions, such as y = x 2 + 1, y = x 2 − 7, or y = x 2 + π, since any constant c may be chosen. Geometrically, the differential equation y′ = 2 x says that at each point ( x, y) on some curve y = y( x), the slope is equal to 2 x. The solution obtained for the differential equation shows that this property is satisfied by any member of the family of curves y = x 2 + c (any only by such curves); see Figure 1. Since these curves were obtained by solving a differential equation—which either explicitly or implicitly involves taking an integral—they are sometimes referred to as integral curves of the differential equation (particularly when these solutions are graphed). If one particular solution or integral curve is desired, the differential equation is appended with one or more supplementary conditions. These additional conditions uniquely specify the value of the arbitrary constant or constants in the general solution. For example, consider the problem The initial condition “ y = 2 when x = 0” is usually abbreviated “ y(0) = 2,” which is read “ y at 0 equals 2.” The combination of a differential equation and an initial condition (also known as a constraint) is called an initial value problem (abbreviated IVP). For differential equations involving higher derivatives, two or more constraints may be present. If all constraints are given at the same value of the independent variable, then the term IVP still applies. If, however, the constraints are given at different values of the independent variable, the term boundary value problem (BVP) is used instead. For example, but To solve an IVP or BVP, first find the general solution of the differential equation and then determine the value(s) of the arbitrary constant(s) from the constraints. As previously noted, the general solution of this differential equation is the family y = x 2 + c. Since the constraint says that y must equal 2 when x is 0, so the solution of this IVP is y = x 2 + 2. Example 2: Consider the differential equation y″ = 2 y′ − 3 y = 0. Verify that y = c 1 e x + c 2 e −3 x (where c 1 and c 2 are arbitrary constants) is a solution. Given the every solution of this differential equation can be written in the form y = c 1 e x + c 2 e −3 x , solve the IVP To verify that y = c 1 e x + c 2 e −3 x is a solution of the differential equation, substitute. Since once c 1 e x + c 2 e −3 x is substituted for y, the left‐hand side of the differential equation becomes Now, to satisfy the conditions y(0) = 1 and y′(0) = 5, the constants c 1 and c 2 must be chosen so that and Solving these two equations yields c 1 = 2 and c 2 = − 1. Thus, the particular solution specified by the given IVP is y = 2 e x − e −3 x . The order of a differential equation is the order of the highest derivative that appears in the equation. For example, y′ = 2 x is a first‐order equation, y″ + 2 y′ − 3 y = 0 is a second‐order equation, and y‴ − 7 y′ + 6 y = 12 is a third‐order equation. Note that the general solution of the first‐order equation from Example 1 contained one arbitrary constant, and the general solution of the second‐order equation in Example 2 contained two arbitrary constants. This phenomenon is not coincidental. In most cases, the number of arbitrary constants in the general solution of a differential equation is the same as the order of the equation. Example 3: Solve the second‐order differential equation y″ = x + cos x. Integrating both sides of the equation will yield a differential equation for y′: Integrating once more will give y: where c 1 and c 2 and arbitrary constants. Note that there are two arbitrary constants in the general solution, which you should typically expect for a second‐order equation. Example 4: For the following IVP, find the solution valid for x > 0: The general solution of a third‐order differential equation typically contains three arbitrary constants, so an IVP involving a third‐order differential equation will necessarily have three constraint equations (as is the case here). As in Examples 1 and 3, the given differential equation is of the form where y ( n) denotes the nth derivative of the function y. These differential equations are the easiest to solve, since all they require are n successive integrations. Note how the first‐order differential equation in Example 1 was solved with one integration, and the second‐order equation in Example 3 was solved with two integrations. The third‐order differential equation given here will be solved with three successive integrations. Here's the first: The value of this first arbitrary constant ( c 1) can be found by applying the condition y″(1) = 73: Thus, y″ = 70 x 3/2 + x −2 + 6 x − 4. Now, perform the second integration, which will yield y′: The value of this arbitrary constant ( c 2) can be found by applying the constraint y′(1) = 37: Therefore, y′ = 28 x 5/2 − x −1 + 3 x 2 − 4 x + 11. Integrating once more will give the solution y: The value of this arbitrary constant ( c 3) can be found by applying the condition y(1) = 7: Thus, the solution is y = 8 x 7/2 − In x + x 3 − 2 x 2 + 11 x − 11. A few technical notes about this example: The given differential equation makes sense only for x > 0 (note the and 2/ x 3 terms). To respect this restriction, the problem states the domain of the equation and its solution [that is, the set of values of the variable(s) where the equation and solution are valid] as x > 0. Always be aware of the domain of the solution. Although the integral of x −1 is usually written In | x|, the absolute value sign is not needed here, since the domain of the solution is x > 0, and | x| = x for any x > 0. Constrast the methods used to evaluate the arbitrary constants in Examples 2 and 4. In Example 2, the constraints were applied all at once at the end. In Example 4, however, the constants were evaluated one at a time as the solution progressed. Both methods are valid, and each particular problem (and your preference) will suggest which to use. Example 5: Find the differential equation for the family of curves x 2 + y 2 = c 2 (in the xy plane), where c is an arbitrary constant. This problem is a reversal of sorts. Typically, you're given a differential equation and asked to find its family of solutions. Here, on the other hand, the general solution is given, and an expression for its defining differential equation is desired. Differentiating both sides of the equation (with respect to x) gives This differential equation can also be expressed in another form, one that will arise quite often. By “cross multiplying,” the differential equation directly above becomes which is then normally written with both differentials (the dx and the dy) together on one side: Either y′ = − x/ y or x dx + y dy = 0 would be an acceptable way of writing the differential equation that defines the given family (of circles) x 2 + y 2 = c 2. Example 6: Verify that the equation y = In ( x/y) is an implicit solution of the IVP First note that it is not always possible to express a solution in the form “ y = some function of x.” Sometimes when a differential equation is solved, the solution is most naturally expressed with y's (the dependent variable) on both sides of the equation, as in y = In( x/y). Such a solution is called an implicit solution, as opposed to an explicit solution, which has y all by itself on one side of the equation and a function of x only on the right (as in y = x 2 + 2, for example). Implicit solutions are perfectly acceptable (in some cases, necessary) as long as the equation actually defines y as a function of x (even if an explicit formula for this function is not or cannot be found). However, explicit solutions are preferable when available. Perhaps the simplest way to verify this implicit solution is to follow the procedure of Example 5: Find the differential equation for the solution y = In( x/y). To simplify the work, first rewrite In( x/y) as In x − In y: Therefore, the differential equation given in the statement of the problem is indeed correct. The initial condition is also satisfied, since 1 = In( e/1) implies y( e) = 1 satisfies y = In( x/y). Example 7: Discuss the solution to each of the differential equations The first differential equation has no solution, since non realvalued function y = y( x) can satisfy ( y′) 2 = − x 2 (because squares of real‐valued functions can't be negative). The second differential equation states that the sum of two squares is equal to 0, so both y′ and y must be identically 0. This equation does have a solution, but it is only the constant function y ≡ 0. Note that this differential equation illustrates an exception to the general rule stating that the number of arbitrary constants in the general solution of a differential equation is the same as the order of the equation. Although ( y′) 2 + y 2 is a first‐order equation, its general solution y ≡ 0 contains no arbitrary constants at all. One final note: Since there are two major categories of derivatives, ordinary derivatives like and partial derivatives such as there are two major categories of differential equations. Ordinary differential equations (ODEs) involve ordinary derivatives, while partial differential equations (PDEs), such as involve partial derivatives.
Introduction to differential forms. Donu Arapura. March 9, 2015. The calculus of differential forms give an alternative to vector calculus which is ultimately simpler ..
Introduction to Differential Equations
Introduction and First Definitions · Modeling via Differential Equations. First Order Differential Equations. Linear Equations · Separable Equations · Qualitative ..