Differential Equations and Linear AlgebraLecture NotesSimon J.A. MalhamDepartment of Mathematics, Heriot-Watt University
ContentsChapter 1. Linear second order ODEs1.1. Newton’s second law1.2. Springs and Hooke’s Law1.3. General ODEs and their classification1.4. Exercises5561012Chapter 2. Homogeneous linear ODEs2.1. The Principle of Superposition2.2. Linear second order constant coefficient homogeneous ODEs2.3. Practical example: damped springs2.4. Exercises1515152022Chapter 3. Non-homogeneous linear ODEs3.1. Example applications3.2. Linear operators3.3. Solving non-homogeneous linear ODEs3.4. Method of undetermined coefficients3.5. Initial and boundary value problems3.6. Degenerate inhomogeneities3.7. Resonance3.8. Equidimensional equations3.9. ExercisesSummary: solving linear constant coefficient second order IVPs2323242526283033373840Chapter 4. Laplace transforms4.1. Introduction4.2. Properties of Laplace transforms4.3. Solving linear constant coefficients ODEs via Laplace transforms4.4. Impulses and Dirac’s delta function4.5. ExercisesTable of Laplace transforms41414344465052Chapter 5. Linear algebraic equations5.1. Physical and engineering applications5.2. Systems of linear algebraic equations5.3. Gaussian elimination5.4. Solution of general rectangular systems53535457633
4CONTENTS18.104.22.168.22.214.171.124.126.96.36.199.5.11.Matrix EquationsLinear independenceRank of a matrixFundamental theorem for linear systemsGauss-Jordan methodMatrix Inversion via EROsExercises63666869707173Chapter 6. Linear algebraic eigenvalue problems6.1. Eigenvalues and eigenvectors6.2. Diagonalization6.3. Exercises75758283Chapter 7. Systems of differential equations7.1. Linear second order systems7.2. Linear second order scalar ODEs7.3. Higher order linear ODEs7.4. Solution to linear constant coefficient ODE systems7.5. Solution to general linear ODE systems7.6. Exercises85858890909292Bibliography95
CHAPTER 1Linear second order ODEs1.1. Newton’s second lawWe shall begin by stating Newton’s fundamental kinematic law relatingthe force, mass and acceleration of an object whose position is y(t) at timet.Newton’s second law states that the force F applied to an object isd2 yequal to its mass m times its acceleration 2 , i.e.dtd2 yF m 2.dt1.1.1. Example. Find the position/height y(t), at time t, of a bodyfalling freely under gravity (take the convention, that we measure positivedisplacements upwards).1.1.2. Solution. The equation of motion of a body falling freely undergravity, is, by Newton’s second law,d2 y g .dt2(1.1)We can solve equation (1.1) by integrating with respect to t, which yieldsan expression for the velocity of the body,dy gt v0 ,dt5
61. LINEAR SECOND ORDER ODES(equilibrium position)y 0positive displacement, y(t)Figure 1.1. Mass m slides freely on the horizontal surface,and is attached to a spring, which is fixed to a vertical wallat the other end. We take the convention that positive displacements are measured to the right.where v0 is the constant of integration which here also happens to be theinitial velocity. Integrating again with respect to t gives1y(t) gt2 v0 t y0 ,2where y0 is the second constant of integration which also happens to be theinitial height of the body.Equation (1.1) is an example of a second order differential equation(because the highest derivative that appears in the equation is secondorder): the solutions of the equation are a family of functions withtwo parameters (in this case v0 and y0 ); choosing values for the two parameters, corresponds tochoosing a particular function of the family.1.2. Springs and Hooke’s LawConsider a mass m Kg on the end of a spring, as in Figure 1.1. Withthe initial condition that the mass is pulled to one side and then released,what do you expect to happen?
1.2. SPRINGS AND HOOKE’S LAW7Hooke’s law implies that, provided y is not so large as to deform thespring, then the restoring force isFspring ky ,where the constant k 0 depends on the properties of the spring,for example its stiffness.1.2.1. Equation of motion. Combining Hooke’s law and Newton’s second law impliesd2 y kydt2kd2 y y(assuming m 6 0) 2dtmpd2 y (setting ω k/m) ω 2 y .(1.2)dt2Can we guess a solution of (1.2), i.e. a function that satisfies the relation(1.2)? We are essentially asking ourselves: what function, when you differentiate it twice, gives you minus ω 2 times the original function you startedwith?mThe general solution to the linear ordinairy differential equationd2 y ω2 y 0 ,dt2isy(t) C1 sin ωt C2 cos ωt ,(1.3)where C1 and C2 are arbitrary constants. This is an oscillatorysolution with frequency of oscillation ω. The period of the oscillationsis2πT .ωpRecall that we set ω k/m and this parameter represents the frequency of oscillations of the mass. How does the general solution change asyou vary m and k? Does this match your physical intuition?What do these solutions really look like? We can re-express the solution (1.3) as follows. Consider the C1 , C2 plane as shown in Figure 1.2.HenceC1 A cos φ ,C2 A sin φ .
81. LINEAR SECOND ORDER ODES(C1,C2 )AC2φC1Figure 1.2. Relation between (C1 , C2 ) and (A, φ).Substituting these expressions for C1 and C2 into (1.3) we gety(t) A cos φ sin ωt A sin φ cos ωt A(cos φ sin ωt sin φ cos ωt) A sin(ωt φ) .The general solution (1.3) can also be expressed in the formy(t) A sin(ωt φ) ,(1.4)whereqA C12 C22 0 is the amplitude of oscillation,φ arctan(C2 /C1 ) is the phase angle, with π φ π.1.2.2. Example (initial value problem). Solve the differential equationfor the spring,d2 yk y,2dtmif the mass were displaced by a distance y0 and then released. This is anexample of an initial value problem, where the initial position and the initialvelocity are used to determine the solution.1.2.3. Solution. We have already seen that the position of the mass attime t is given byy(t) C1 sin ωt C2 cos ωt ,(1.5)
1.2. SPRINGS AND HOOKE’S LAW9pwith ω k/m, for some constants C1 and C2 . The initial position is y0 ,i.e. y(0) y0 . Substituting this information into (1.5), we see that y(0) C1 sin(ω · 0) C2 cos(ω · 0)y0 C1 · 0 C2 · 1y0 C2 .The initial velocity is zero, i.e. y ′ (0) 0. Differentiating (1.5) and substituting this information into the resulting expression for y ′ (t) implies y ′ (0) C1 ω cos(ω · 0) C2 ω sin(ω · 0)0 C1 ω · 1 C2 ω · 00 C1 .Therefore the solution is y(t) y0 cos ωt. Of course this is an oscillatorysolution with frequency of oscillation ω, and in this case, the amplitude ofoscillation y0 .1.2.4. Damped oscillations. Consider a more realistic spring which hasfriction.In general, the frictional force or drag is proportional to the velocityof the mass, i.e.dy,Ffriction Cdtwhere C is a constant known as the drag or friction coefficient. Thefrictional force acts in a direction opposite to that of the motion andso C 0.Newton’s Second Law implies (adding the restoring and frictional forcestogether)md2 y Fspring Ffriction ,dt2i.e.d2 ydy ky C .2dtdtHence the damped oscillations of a spring are described by the differentialequationdyd2 y ky 0.(1.6)m 2 Cdtdtm
101. LINEAR SECOND ORDER ODES1.2.5. Remark. We infer the general principles: for elastic solids, stressis proportional to strain (how far you are pulling neighbouring particlesapart), whereas for fluids, stress is proportional to the rate of strain (howfast you are pulling neighbouring particles apart). Such fluids are said to beNewtonian fluids, and everyday examples include water and simple oils etc.There are also many non-Newtonian fluids. Some of these retain some solidlike elasticity properties. Examples include solutes of long-chain proteinmolecules such as saliva.1.3. General ODEs and their classification1.3.1. Basic definitions. The basic notions of differential equations andtheir solutions can be outlined as follows.Differential Equation (DE). An equation relating two or more variables in terms of derivatives or differentials.Solution of a Differential Equation. Any functional relation, notinvolving derivatives or integrals of “unknown” functions, which satisfies the differential equation.General Solution. A description of all the functional relations thatsatisfy the differential equation.Ordinary Differential Equation (ODE). A differential equation relating only two variables. A general nth order ODE is often representedby dn ydy(1.7)F t, y, , . . . , n 0 ,dtdtwhere F is some given (known) function.In equation (1.7), we usually call t the independent variable, and yis the dependent variable.1.3.2. Example. Newton’s second law implies that, if y(t) is the position, at time t, of a particle of mass m acted upon by a force f , then dyd2 y f t, y,,dt2dtwhere the given force f may be a function of t, y and the velocitydydt .
1.3. GENERAL ODES AND THEIR CLASSIFICATION111.3.3. Classification of ODEs. ODEs are classified according to order,linearity and homogeneity.Order. The order of a differential equation is the order of the highestderivative present in the equation.Linear or nonlinear. A second order ODE is said to be linear if itcan be written in the formdyd2 y c(t)y f (t) ,(1.8)a(t) 2 b(t)dtdtwhere the coefficients a(t), b(t) & c(t) can, in general, be functionsof t. An equation that is not linear is said to be nonlinear. Notethat linear ODEs are characterised by two properties:(1) The dependent variable and all its derivatives are of firstdegree, i.e. the power of each term involving y is 1.(2) Each coefficient depends on the independent variable t only.Homogeneous or non-homogeneous. The linear differential equation (1.8) is said to be homogeneous if f (t) 0, otherwise, if f (t) 6 0,the differential equation is said to be non-homogeneous. More generally, an equation is said to be homogeneous if ky(t) is a solutionwhenever y(t) is also a solution, for any constant k, i.e. the equationis invariant under the transformation y(t) ky(t).1.3.4. Example. The differential equation 3d2 ydy 4y et , 5dt2dtis second order because the highest derivative is second order, and nonlinearbecause the second term on the left-hand side is cubic in y ′ .1.3.5. Example (higher order linear ODEs). We can generalize ourcharacterization of a linear second order ODE to higher order linear ODEs.We recognize that a linear third order ODE must have the forma3 (t)d2 ydyd3 y a0 (t)y f (t) , a(t) a1 (t)232dtdtdtfor a given set of coefficient functions a3 (t), a2 (t), a1 (t) and a0 (t), and agiven inhomogeneity f (t). A linear fourth order ODE must have the forma4 (t)d3 yd2 ydyd4 y a(t) a(t) a1 (t) a0 (t)y f (t) ,32432dtdtdtdt
121. LINEAR SECOND ORDER ODESwhile a general nth order linear ODE must have the forman (t)dn ydn 1 yd2 ydy a(t) ··· a(t) a1 (t) a0 (t)y f (t) .n 12nn 12dtdtdtdt1.3.6. Example (scalar higher order ODE as a system of first orderODEs). Any nth order ODE (linear or nonlinear) can always we written asa system of n first order ODEs. For example, if for the ODE dydn y(1.9)F t, y, , . . . , n 0 ,dtdtwe identify new variables for the derivative terms of each order, then (1.9)is equivalent to the system of n first order ODEs in n variablesdy y1 ,dtdy1 y2 ,dt.dyn 2 yn 1 ,dt dyn 1F t, y, y1 , y2 , . . . , yn 1 , 0.dt1.4. Exercises1.1. The following differential equations represent oscillating springs.(1) y ′′ 4y 0,y(0) 5,(2) 4y ′′ y 0,y(0) 10,(3) y ′′ 6y 0,y(0) 4,(4) 6y ′′ y 0,y(0) 20,y ′ (0) 0,y ′ (0) 0,y ′ (0) 0,y ′ (0) 0.Which differential equation represents(a): the spring oscillating most quickly (with the shortest period)?(b): the spring oscillating with the largest amplitude?(c): the spring oscillating most slowly (with the longest period)?(d): the spring oscillating with the largest maximum velocity?
1.4. EXERCISES131.2. (Pendulum.) A mass is suspended from the end of a light rodof length, l, the other end of which is attached to a fixed pivot so thatthe rod can swing freely in a vertical plane. Let θ(t) be the displacementangle (in radians) at time, t, of the rod to the vertical. Note that thearclength, y(t), of the mass is given by y ℓθ. Using Newton’s second lawand the tangential component (to its natural motion) of the weight of thependulum, the differential equation governing the motion of the mass is (gis the acceleration due to gravity)gθ′′ sin θ 0 .ℓExplain why, if we assume the pendulum bob only performs small oscillationsabout the equilibrium vertical position, i.e. so that θ(t) 1, then theequation governing the motion of the mass is, to a good approximation,gθ′′ θ 0 .ℓSuppose the pendulum bob is pulled to one side and released. Solve thisinitial value problem explicitly and explain how you might have predictedthe nature of the solution. How does the solution behave for different valuesof ℓ? Does this match your physical intuition?
CHAPTER 2Homogeneous linear ODEs2.1. The Principle of SuperpositionPrinciple of Superposition for linear homogeneous differential equations. Consider the linear, second order, homogeneous, ordinary differential equationd2 ydy b(t) c(t)y 0 ,2dtdtwhere a(t), b(t) and c(t) are known functions.a(t)(2.1)(1) If y1 (t) and y2 (t) satisfy (2.1), then for any two constantsC1 and C2 ,y(t) C1 y1 (t) C2 y2 (t)(2.2)is a solution also.(2) If y1 (t) is not a constant multiple of y2 (t), then the generalsolution of (2.1) takes the form (2.2).2.2. Linear second order constant coefficient homogeneous ODEs2.2.1. Exponential solutions. We restrict ourselves here to the casewhen the coefficients a, b and c in (2.1) are constants, i.e.d2 ydy b cy 0 ,2dtdtLet us try to find a solution to (2.3) of the formay eλt .15(2.3)(2.4)
162. HOMOGENEOUS LINEAR ODESThe reason for choosing the exponential function is that we know that solutions to linear first order constant coefficient ODEs always have this formfor a specific value of λ that depends on the coefficients