Differential Equations for Engineers
Lecture Notes for
Jeffrey R. Chasnov The Hong Kong University of Science and Technology Department of Mathematics Clear Water Bay, Kowloon Hong Kong
Copyright ○c 2019 by Jeffrey Robert Chasnov
This work is licensed under the Creative Commons Attribution 3.0 Hong Kong License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/hk/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. Preface View the promotional video on YouTube
These are my lecture notes for my online Coursera course, Differential Equations for Engineers.I have divided these notes into chapters called Lectures, with each Lecture corresponding to a video on Coursera. I have also uploaded all my Coursera videos to YouTube, and links are placed at the top of each Lecture. There are problems at the end of each lecture chapter and I have tried to choose problems that exemplify the main idea of the lecture. Students taking a formal university course in differential equations will usually be assigned many more additional problems, but here I follow the philosophy that less is more. I give enough problems for students to solidify their understanding of the material, but not too many problems that students feel overwhelmed and drop out. I do encourage students to attempt the given problems, but if they get stuck, full solutions can be found in the Appendix. There are also additional problems at the end of coherent sections that are given as practice quizzes on the Coursera platform. Again, students should attempt these quizzes on the platform, but if a student has trouble obtaining a correct answer, full solutions are also found in the Appendix. Students who take this course are expected to know single-variable differential and integral calcu- lus. Some knowledge of complex numbers, matrix algebra and vector calculus is required for parts of this course. Students missing this latter knowledge can find the necessary material in the Appendix.
Jeffrey R. Chasnov Hong Kong January 2019
iii
Contents
1 Introduction to differential equations1
Practice quiz: Classify differential equations3
I First-Order Differential Equations5
2 Euler method 9
3 Separable first-order equations 11
4 Separable first-order equation: example 13
Practice quiz: Separable first-order odes 15
5 Linear first-order equations 17
6 Linear first-order equation: example 19
Practice quiz: Linear first-order odes 21
7 Application: compound interest 23
8 Application: terminal velocity 25
9 Application: RC circuit 27
Practice quiz: Applications 31
II Homogeneous Linear Differential Equations 33
10 Euler method for higher-order odes 37
11 The principle of superposition 39
12 The Wronskian 41
13 Homogeneous second-order ode with constant coefficients 43
Practice quiz: Superposition, the Wronskian, and the characteristic equation 45
v vi CONTENTS
14 Case 1: Distinct real roots 47
15 Case 2: Complex-conjugate roots (Part A) 49
16 Case 2: Complex-conjugate roots (Part B) 51
17 Case 3: Repeated roots (Part A) 53
18 Case 3: Repeated roots (Part B) 55
Practice quiz: Homogeneous equations 57
III Inhomogeneous Linear Differential Equations 59
19 Inhomogeneous second-order ode 63
20 Inhomogeneous term: Exponential function 65
Practice quiz: Solving inhomogeneous equations 67
21 Inhomogeneous term: Sine or cosine (Part A) 69
22 Inhomogeneous term: Sine or cosine (Part B) 71
23 Inhomogeneous term: Polynomials 73
Practice quiz: Particular solutions 75
24 Resonance 77
25 Application: RLC circuit 79
26 Application: Mass on a spring 83
27 Application: Pendulum 85
28 Damped resonance 87
Practice quiz: Applications and resonance 89
IV The Laplace Transform and Series Solution Methods 91
29 Definition of the Laplace transform 95
30 Laplace transform of a constant-coefficient ode 97
31 Solution of an initial value problem 99
Practice quiz: The Laplace transform method 101
32 The Heaviside step function 103
33 The Dirac delta function 105 CONTENTS vii
34 Solution of a discontinuous inhomogeneous term 107
35 Solution of an impulsive inhomogeneous term 109
Practice quiz: Discontinuous and impulsive inhomogeneous terms 111
36 The series solution method 113
37 Series solution of the Airy’s equation (Part A) 117
38 Series solution of the Airy’s equation (Part B) 121
Practice quiz: Series solutions 123
V Systems of Differential Equations 125
39 Systems of linear first-order odes 129
40 Distinct real eigenvalues 131
41 Complex-conjugate eigenvalues 133
Practice quiz: Systems of differential equations 135
42 Phase portraits 137
43 Stable and unstable nodes 139
44 Saddle points 141
45 Spiral points 143
Practice quiz: Phase portraits 145
46 Coupled oscillators 147
47 Normal modes (eigenvalues) 149
48 Normal modes (eigenvectors) 151
Practice quiz: Normal modes 153
VI Partial Differential Equations 155
49 Fourier series 159
50 Fourier sine and cosine series 161
51 Fourier series: example 163
Practice quiz: Fourier series 165
52 The diffusion equation 167 viii CONTENTS
53 Solution of the diffusion equation (separation of variables) 169
54 Solution of the diffusion equation (eigenvalues) 171
Practice quiz: Separable partial differential equations 173
55 Solution of the diffusion equation (Fourier series) 175
56 Diffusion equation: example 177
Practice quiz: The diffusion equation 179
Appendix 180
A Complex numbers 183
B Nondimensionalization 185
C Matrices and determinants 187
D Eigenvalues and eigenvectors 189
E Partial derivatives 191
F Table of Laplace transforms 193
G Problem and practice quiz solutions 195 Lecture 1
Introduction to differential equations View this lecture on YouTube
A differential equation is an equation for a function containing derivatives of that function. For exam- ple, the differential equations for an RLC circuit, a pendulum, and a diffusing dye are given by
d2q dq 1 L + R + q = E cos ωt, (RLC circuit equation) dt2 dt C 0 d2θ dθ ml + cl + mg sin θ = F cos ωt, (pendulum equation) dt2 dt 0 ∂u ∂2u ∂2u ∂2u = D + + . (diffusion equation) ∂t ∂x2 ∂y2 ∂z2
These are second-order differential equations, categorized according to the highest order derivative. The RLC circuit equation (and pendulum equation) is an ordinary differential equation, or ode, and the diffusion equation is a partial differential equation, or pde. An ode is an equation for a function of a single variable and a pde for a function of more than one variable. A pde is theoretically equivalent to an infinite number of odes, and numerical solution of nonlinear pdes may require supercomputer resources. The RLC circuit and the diffusion equation are linear and the pendulum equation is nonlinear. In a linear differential equation, the unknown function and its derivatives appear as a linear polynomial. For instance, the general linear third-order ode, where y = y(x) and primes denote derivatives with respect to x, is given by 000 00 0 a3(x)y + a2(x)y + a1(x)y + a0(x)y = b(x), where the a and b coefficients can be any function of x. The pendulum equation is nonlinear because of the term sin θ, where θ = θ(t) is the unknown function. Making the small angle approximation, sin θ ≈ θ, the pendulum equation becomes linear. The simplest type of ode can be solved by integration. For example, a mass such as Newton’s apocryphal apple, falls downward with constant acceleration, and satisfies the differential equation
d2x = −g. dt2
With initial conditions specifying the initial height of the mass x0 and its initial velocity u0, the solution obtained by straightforward integration is given by the well-known high school physics equation
1 x(t) = x + u t − gt2. 0 0 2
1 2 LECTURE 1. INTRODUCTION TO DIFFERENTIAL EQUATIONS Practice quiz: Classify differential equations 1. By checking all that apply, classify the following differential equation: d3y d2y + y = 0 dx3 dx2 a) first order
b) second order
c) third order
d) ordinary
e) partial
f ) linear
g) nonlinear
2. By checking all that apply, classify the following differential equation:
1 d dψ ξ2 = e−ψ ξ2 dξ dξ a) first order
b) second order
c) ordinary
d) partial
e) linear
f ) nonlinear
3 4 LECTURE 1. INTRODUCTION TO DIFFERENTIAL EQUATIONS
3. By checking all that apply, classify the following differential equation:
∂u ∂u ∂2u + u = ν ∂t ∂x ∂x2 a) first order
b) second order
c) ordinary
d) partial
e) linear
f ) nonlinear
4. By checking all that apply, classify the following differential equation:
d2x dx a + b + cx = 0 dt2 dt a) first order
b) second order
c) ordinary
d) partial
e) linear
f ) nonlinear
5. By checking all that apply, classify the following differential equation:
∂2u ∂2u ∂2u ∂2u = c2 + + ∂t2 ∂x2 ∂y2 ∂z2 a) first order
b) second order
c) ordinary
d) partial
e) linear
f ) nonlinear Solutions to the Practice quiz Week I
First-Order Differential Equations
5
7
In this week’s lectures, we discuss first-order differential equations. We begin by explaining the Euler method, which is a simple numerical method for solving an ode. Not all first-order differential equations have an analytical solution, so it is useful to understand a basic numerical method. Then the analytical solution methods for separable and linear equations are explained. We follow the dis- cussion of each theory with some simple examples. Finally, three real-world applications of first-order equations and their solutions are presented: compound interest, terminal velocity of a falling mass, and the resistor-capacitor electrical circuit. 8 Lecture 2
Euler method View this lecture on YouTube
y = y +∆x f(x ,y ) 1 0 0 0
y 1
slope = f(x ,y ) 0 0 y 0
x x 0 1
dy/dx = f (x, y) with initial condition y(x0) = y0 is integrated to x = x1 using the Euler method.
Sometimes there is no analytical solution to a first-order differential equation and a numerical solution
must be sought. The first-order differential equation dy/dx = f (x, y) with initial condition y(x0) = y0 provides the slope f (x0, y0) of the tangent line to the solution curve y = y(x) at the point (x0, y0). With a small step size ∆x = x1 − x0, the initial condition (x0, y0) can be marched forward to (x1, y1) along the tangent line using Euler’s method (see figure):
y1 = y0 + ∆x f (x0, y0).
This solution (x1, y1) then becomes the new initial condition and is marched forward to (x2, y2) along a newly determined tangent line with slope given by f (x1, y1). For small enough ∆x, the numerical solution converges to the unique solution, when such a solution exists. There are better numerical methods than the Euler method, but the basic principle of marching the solution forward remains the same.
9 10 LECTURE 2. EULER METHOD
Problems for Lecture 2
1. The Euler method for solving the differential equation dy/dx = f (x, y) can be rewritten in the form
k1 = ∆x f (xn, yn), yn+1 = yn + k1, and is called a first-order Runge-Kutta method. More accurate second-order Runge-Kutta methods have the form
k1 = ∆x f (xn, yn), k2 = ∆x f (xn + α∆x, yn + βk1), yn+1 = yn + ak1 + bk2.
Some analysis (not shown here) on the second-order Runge-Kutta methods results in the constraints
a + b = 1, αb = βb = 1/2.
Write down the second-order Runge-Kutta methods corresponding to (i) a = b, and (ii) a = 0. These specific second-order Runge-Kutta methods are called the modified Euler method and the midpoint method, respectively. Solutions to the Problems Lecture 3
Separable first-order equations View this lecture on YouTube
A first-order ode is separable if it can be written in the form
dy g(y) = f (x), y(x ) = y , dx 0 0 where the function g(y) is independent of x and f (x) is independent of y. Integration from x0 to x results in Z x Z x g(y(x))y0(x) dx = f (x) dx. x0 x0 The integral on the left can be transformed by substituting u = y(x), du = y0(x)dx, and changing the
lower and upper limits of integration to y(x0) = y0 and y(x) = y. Therefore,
Z y Z x g(u) du = f (x) dx, y0 x0
which can often yield an analytical expression for y = y(x) if the integrals can be done and the resulting algebraic equation can be solved for y. A simpler procedure that yields the same result is to treat dy/dx as a fraction. Multiplying the differential equation by dx results directly in
g(y) dy = f (x) dx,
which is what we call a separated equation with a function of y times dy on one side, and a function of x times dx on the other side. This separated equation can then be integrated directly over y and x.
11 12 LECTURE 3. SEPARABLE FIRST-ORDER EQUATIONS
Problems for Lecture 3
1. Put the following equation in separated form. Do not integrate.
dy x2y − 4y a) = dx x + 4 dy b) = sec(y)ex−y(1 + x) dx dy xy c) = dx (x + 1)(y + 1) dθ d) + sin θ = 0 dt Solutions to the Problems Lecture 4
Separable first-order equation: example View this lecture on YouTube
Example: Solve y0 + y2 sin x = 0, y(0) = 1.
We first manipulate the differential equation to the form
dy = −y2 sin x dx
and then treat dy/dx as if it was a fraction to separate variables:
dy = − sin x dx. y2
We then integrate the right side from x equals 0 to x and the left side from y equals 1 to y. We obtain
Z y dy Z x = − sin x dx. 1 y2 0
Integrating, we have y x 1 − = cos x , y 1 0 or 1 1 − = cos x − 1. y Solving for y, we obtain the solution 1 y = . 2 − cos x
13 14 LECTURE 4. SEPARABLE FIRST-ORDER EQUATION: EXAMPLE
Problems for Lecture 4
1. Solve the following separable first-order equations. √ a) dy/dx = 4x y, with y(0) = 1.
b) dx/dt = x(1 − x), with x(0) = x0 and 0 ≤ x0 ≤ 1. Solutions to the Problems Practice quiz: Separable first-order odes √ 1. The solution of y0 = xy with initial value y(1) = 0 is given by 1 a) y(x) = (x1/2 − 1)2 9 1 b) y(x) = (x − 1)2 9 1 c) y(x) = (x3/2 − 1)2 9 1 d) y(x) = (x2 − 1)2 9 2. The solution of y2 − xy0 = 0 with initial value y(1) = 1 is given by 1 a) y(x) = 1 − ln x 1 b) y(x) = 1 − 2 ln x 1 c) y(x) = 1 + ln x 1 d) y(x) = 1 + 2 ln x 3. The solution of y0 + (sin x)y = 0 with initial value y(π/2) = 1 is given by
a) y(x) = esin x
b) y(x) = ecos x
c) y(x) = e1−sin x
d) y(x) = e1−cos x Solutions to the Practice quiz
15 16 LECTURE 4. SEPARABLE FIRST-ORDER EQUATION: EXAMPLE Lecture 5
Linear first-order equations View this lecture on YouTube
A linear first-order differential equation with initial condition can be written in standard form as
dy + p(x)y = g(x), y(x ) = y . (5.1) dx 0 0
All linear first-order differential equations can be integrated using an integrating factor µ. We multiply the differential equation by the yet unknown function µ = µ(x) to obtain
dy µ(x) + p(x)y = µ(x)g(x); dx and then require µ(x) to satisfy the differential equation
dy d µ(x) + p(x)y = [µ(x)y]. (5.2) dx dx
The unknown function µ(x) is called an integrating factor because the resulting differential equation, d [µ(x)y] = µ(x)g(x), can be directly integrated. Using y(x ) = y and choosing µ(x ) = 1, we have dx 0 0 0 Z x µ(x)y − y0 = µ(x)g(x) dx; or after solving for y = y(x), x0
1 Z x y(x) = y0 + µ(x)g(x) dx . (5.3) µ(x) x0
To determine µ(x), we expand (5.2) using the product rule to obtain to yield
dy dµ dy µ + pµy = y + µ ; dx dx dx and upon canceling terms, we obtain the differential equation
dµ = p(x)µ, µ(x ) = 1. dx 0
This equation is separable and can be easily integrated to obtain
Z x µ(x) = exp p(x) dx . (5.4) x0
Equations (5.3) and (5.4) together solve the first-order linear equation given by (5.1).
17 18 LECTURE 5. LINEAR FIRST-ORDER EQUATIONS
Problems for Lecture 5
1. Write the following linear equations in standard form. dy a) x + y = sin x; dx dy b) = x − y. dx 2. Consider the nonlinear differential equation dx/dt = x(1 − x). By defining z = 1/x, show that the resulting differential equation for z is linear. Solutions to the Problems Lecture 6
Linear first-order equation: example View this lecture on YouTube
dy Example: Solve + 2y = e−x, with y(0) = 3/4. dx
Note that this equation is not separable. With p(x) = 2 and g(x) = e−x, we have
Z x µ(x) = exp 2 dx 0 = e2x, and 3 Z x y(x) = e−2x + e2xe−x dx . 4 0 Performing the integration, we obtain
3 y(x) = e−2x + (ex − 1) , 4
which can be simplified to 1 y(x) = e−x 1 − e−x . 4
19 20 LECTURE 6. LINEAR FIRST-ORDER EQUATION: EXAMPLE
Problems for Lecture 6
1. Solve the following linear odes. dy a) = x − y, y(0) = −1; dx dy b) = 2x(1 − y), y(0) = 0. dx Solutions to the Problems Practice quiz: Linear first-order odes 1. The solution of (1 + x2)y0 + 2xy = 2x with initial value y(0) = 0 is given by x a) y(x) = 1 + x x b) y(x) = 1 + x2 x2 c) y(x) = 1 + x x2 d) y(x) = 1 + x2 2. The solution of x2y0 = 1 − 2xy with initial value y(1) = 2 is given by 1 + x a) y(x) = x 1 + x b) y(x) = x2 1 + x2 c) y(x) = x 1 + x2 d) y(x) = x2 3. The solution of y0 + λy = a with initial value y(0) = 0 and λ > 0 is given by
a) y(x) = a(1 − eλx)
b) y(x) = a(1 − e−λx) a c) y(x) = (1 − eλx) λ a d) y(x) = (1 − e−λx) λ Solutions to the Practice quiz
21 22 LECTURE 6. LINEAR FIRST-ORDER EQUATION: EXAMPLE Lecture 7
Application: compound interest View this lecture on YouTube
The compound interest equation arises in many different engineering problems, and we consider it here as it relates to an investment. Let S(t) be the value of the investment at time t, and let r be the annual interest rate compounded after every time interval ∆t. Let k be the annual deposit amount (a negative value indicates a withdrawal), and suppose that a fixed amount is deposited after every time interval ∆t. The value of the investment at the time t + ∆t is then given by
S(t + ∆t) = S(t) + (r∆t)S(t) + k∆t, (7.1) where at the end of the time interval ∆t, r∆tS(t) is the amount of interest credited and k∆t is the amount of money deposited. Rearranging the terms of (7.1) to exhibit what will soon become a derivative, we have
S(t + ∆t) − S(t) = rS(t) + k. ∆t
The equation for continuous compounding of interest and continuous deposits is obtained by taking the limit ∆t → 0. The resulting differential equation is
dS = rS + k, (7.2) dt
which can solved with the initial condition S(0) = S0, where S0 is the initial capital. The differential equation is linear and the standard form is dS/dt − rS = k, so that the integrating factor is given by
µ(t) = e−rt.
The solution is therefore
Z t rt −rt S(t) = e S0 + ke dt 0 k = S ert + ert 1 − e−rt , 0 r
where the first term on the right-hand side 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.
23 24 LECTURE 7. APPLICATION: COMPOUND INTEREST
Problems for Lecture 7
1. Suppose a 25 year-old plans to set aside a fixed amount each year until retirement at age 65. How much must he/she save each year to have $1,000,000 at retirement? Assume a 6% annual return on the saved money compounded continuously. Out of the $1,000,000, approximately how much was saved, and how much was earned on the investment?
2. A home buyer can afford to spend no more than $1500 per month on mortgage payments. Suppose that the annual interest rate is 4% and that the term of the mortgage is 30 years. Assume that interest is compounded continuously and that payments are also made continuously. Determine the maximum amount that this buyer can afford to borrow. Solutions to the Problems Lecture 8
Application: terminal velocity View this lecture on YouTube
Using Newton’s law, we model a mass m free falling under gravity but with air resistance. We as- sume that the force of air resistance is proportional to the speed of the mass and opposes the direction of motion. We define the x-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 −mg, with g = 9.8 m/s2 the usual gravitational acceleration. The force of air resistance is modeled by −kv, where v is the vertical velocity of the mass and k is a positive constant. When the mass is falling, v < 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 F = −mg − kv. With F = ma and a = dv/dt, we obtain the differential equation dv m = −mg − kv. (8.1) dt
The terminal velocity v∞ of the mass is defined as the asymptotic velocity after air resistance balances the gravitational force. When the mass is at terminal velocity, dv/dt = 0 so that
mg v = − . (8.2) ∞ k
The approach to the terminal velocity of a mass initially at rest is obtained by solving (8.1) with initial condition v(0) = 0. The equation is linear and the standard form is dv/dt + (k/m)v = −g, so that the integrating factor is µ(t) = ekt/m, and the solution to the differential equation is
Z t v(t) = e−kt/m ekt/m(−g) dt 0 mg = − 1 − e−kt/m . k
−kt/m Therefore, v = v∞ 1 − e , and v approaches v∞ as the exponential term decays to zero.
25 26 LECTURE 8. APPLICATION: TERMINAL VELOCITY
Problems for Lecture 8
1. A male skydiver of mass m = 100 kg with his parachute closed may attain a terminal speed of 200 km/hr. How long does it take him to attain one-half his terminal speed, and how long to attain 95%? Solutions to the Problems Lecture 9
Application: RC circuit
View this lecture on YouTube
i
(a)
R
(b) + C ߝ _
RC circuit diagram.
Consider a resister R and a capacitor C connected in series as shown in the figure. A battery connects to this circuit by a switch, stepping up the voltage by E. 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
VC = q/C, VR = iR, (9.1)
where C is the capacitance and R is the resistance. The charge q and the current i are related by
dq i = . (9.2) dt
Kirchhoff’s voltage law states that the emf E 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
VR + VC = E. (9.3)
Using (9.1) and (9.2), the voltage drop across the resister can be written in terms of the voltage drop across the capacitor as dV V = RC C , R dt
27 28 LECTURE 9. APPLICATION: RC CIRCUIT
and (9.3) can be rewritten to yield the linear first-order differential equation for VC given by
dV C + V /RC = E/RC, (9.4) dt C
with initial condition VC(0) = 0. The integrating factor for this equation is
µ(t) = et/RC,
and (9.4) integrates to Z t −t/RC t/RC VC(t) = e (E/RC)e dt, 0 with solution −t/RC VC(t) = E 1 − e .
The voltage starts at zero and rises exponentially to E, with characteristic time scale given by RC. When the switch is thrown to b, application of Kirchhoff’s voltage law results in
VR + VC = 0, with corresponding differential equation
dV C + V /RC = 0. dt C
Here, we assume that the capacitance is initially fully charged so that VC(0) = E. The solution, then, during the discharge phase is given by
−t/RC VC(t) = Ee .
The voltage starts at E and decays exponentially to zero, again with characteristic time scale given by RC. 29
Problems for Lecture 9
1. Determine the current in an RC circuit during charging and discharging. Solutions to the Problems 30 LECTURE 9. APPLICATION: RC CIRCUIT Practice quiz: Applications 1. Suppose a 25 year-old plans to set aside a fixed amount each year until retirement at age 65. Approximately, how much total must they have set aside to have $1,000,000 at retirement? Assume a 10% annual return on the saved money compounded continuously.
a) $75,000
b) $150,000
c) $ 225,000
d) $ 300,000
2. A male skydiver of mass 100 kg with his parachute closed may attain a terminal speed of 200 km/hr. How long does it take him to attain a speed of 150 km/hr?
a)1s
b)4s
c)8s
d) 15 s
3. An RC circuit consists of a resistor (3000 Ω) and a capacitor (0.001 F), where Ω is the ohm with units kg · m2 · s−3 · A−2, F is the Faraday with units s4 · A2 · m−2 · kg−1, and where kg is kilogram, m is meters, s is seconds, and A is amps. How long does it take for the capacitor to charge to 95% of the battery voltage?
a)1s
b)5s
c)9s
d) 14 s Solutions to the Practice quiz
31 32 LECTURE 9. APPLICATION: RC CIRCUIT Week II
Homogeneous Linear Differential Equations
33
35
This week’s lectures are on second-order differential equations. We begin by generalizing the Euler numerical method to a second-order equation, to show how numerical solutions can be obtained for equations that have no analytical solutions. We then develop two theoretical concepts used for linear equations: the principle of superposition, and the Wronskian. Armed with these concepts, we can then find analytical solutions to a homogeneous second-order ode with constant coefficients. We make use of an exponential ansatz, and convert the differential equation to a quadratic equation called the characteristic equation of the ode. The characteristic equation may have real or complex roots and we discuss the solutions for these different cases. 36 Lecture 10
Euler method for higher-order odes View this lecture on YouTube
In practice, most higher-order odes are solved numerically. For example, consider the general second- order ode given by x¨ = f (t, x, x˙).
Here, we adopt the widely used physics notation x˙ = dx/dt and x¨ = d2x/dt2. The dot notation is used to represent only time derivatives and can be applied to any dependent variable that is a function of time. To solve numerically, we convert the second-order ode to a pair of first-order odes. Define u = x˙, and write the first-order system as
x˙ = u, (10.1) u˙ = f (t, x, u). (10.2)
The first ode, (10.1), gives the slope of the tangent line to the curve x = x(t). The second ode, (10.2), gives the slope of the tangent line to the curve u = u(t). Beginning at the initial values (x, u) = (x0, u0) at the time t = t0, we move along the tangent lines to determine x1 = x(t0 + ∆t) and u1 = u(t0 + ∆t):
x1 = x0 + ∆tu0,
u1 = u0 + ∆t f (t0, x0, u0).
The values x1 and u1 at the time t1 = t0 + ∆t are then used as new initial values to march the solution forward to time t2 = t1 + ∆t. When a unique solution of the ode exists, the numerical solution converges to this unique solution as ∆t → 0.
37 38 LECTURE 10. EULER METHOD FOR HIGHER-ORDER ODES
Problems for Lecture 10
1. Write the second-order ode, θ¨ + θ˙/q + sin θ = f cos ωt, as a system of two first-order odes.
2. Write down the second-order Runge-Kutta modified Euler method (predictor-corrector method) for the following system of two first-order odes:
x˙ = f (t, x, y), y˙ = g(t, x, y).
Solutions to the Problems Lecture 11
The principle of superposition View this lecture on YouTube
Consider the homogeneous linear second-order ode given by
x¨ + p(t)x˙ + q(t)x = 0; and suppose that x = X1(t) and x = X2(t) are solutions. We consider a linear combination of X1 and X2 by letting x = c1X1(t) + c2X2(t),
with c1 and c2 constants. The principle of superposition states that x is also a solution to the homogeneous ode. To prove this, we compute