Differential Equations (for MATH 123)

Similar documents
Section 11.1 What is a Differential Equation?

AMATH 351 Mar 15, 2013 FINAL REVIEW. Instructor: Jiri Najemnik

DIFFERENTIAL EQUATIONS

Introduction to First Order Equations Sections

Slope Fields: Graphing Solutions Without the Solutions

Second-Order Homogeneous Linear Equations with Constant Coefficients

Topic 5 Notes Jeremy Orloff. 5 Homogeneous, linear, constant coefficient differential equations

Ordinary Differential Equations (ODEs)

Springs: Part I Modeling the Action The Mass/Spring System

Basic Theory of Differential Equations

Differential Equations

Differential Equations

Math Applied Differential Equations

General Technical Remarks on PDE s and Boundary Conditions Kurt Bryan MA 436

Unforced Mechanical Vibrations

Math 122 Fall Handout 15: Review Problems for the Cumulative Final Exam

Linear algebra and differential equations (Math 54): Lecture 19

Math Applied Differential Equations

First-Order Differential Equations

3 Algebraic Methods. we can differentiate both sides implicitly to obtain a differential equation involving x and y:

MB4018 Differential equations

Thursday, August 4, 2011

Solving Differential Equations: First Steps

Work sheet / Things to know. Chapter 3

MA 102 Mathematics II Lecture Feb, 2015

MATH 319, WEEK 2: Initial Value Problems, Existence/Uniqueness, First-Order Linear DEs

Section 3.4. Second Order Nonhomogeneous. The corresponding homogeneous equation

Solutions to the Review Questions

MAT187H1F Lec0101 Burbulla

Solutions to Section 1.1

MATH 18.01, FALL PROBLEM SET #5 SOLUTIONS (PART II)

3. Solutions of first order linear ODEs

p(t)dt a p(τ)dτ , c R.

MITOCW MITRES18_005S10_DiffEqnsMotion_300k_512kb-mp4

A: Brief Review of Ordinary Differential Equations

Math 4B Notes. Written by Victoria Kala SH 6432u Office Hours: T 12:45 1:45pm Last updated 7/24/2016

Introduction to di erential equations

Exponential and logarithm functions

Section 3.4. Second Order Nonhomogeneous. The corresponding homogeneous equation. is called the reduced equation of (N).

M A : Ordinary Differential Equations

Math 308, Sections 301, 302, Summer 2008 Review before Test I 06/09/2008

Graphical Analysis and Errors MBL

Math 2a Prac Lectures on Differential Equations

Homework 2 Solutions Math 307 Summer 17

Math 23: Differential Equations (Winter 2017) Midterm Exam Solutions

2t t dt.. So the distance is (t2 +6) 3/2

Math 3313: Differential Equations Second-order ordinary differential equations

2.3: Modeling with Differential Equations

Differential equations

Separable First-Order Equations

Differential Equations

CHAPTER 2. Techniques for Solving. Second Order Linear. Homogeneous ODE s

Lecture 19: Solving linear ODEs + separable techniques for nonlinear ODE s

Solutions to Homework 1, Introduction to Differential Equations, 3450: , Dr. Montero, Spring y(x) = ce 2x + e x

Name: Problem Possible Actual Score TOTAL 180

Solutions to the Review Questions

MATH 1231 MATHEMATICS 1B Calculus Section 2: - ODEs.

Old Math 330 Exams. David M. McClendon. Department of Mathematics Ferris State University

First Order Differential Equations

Figure 1: Doing work on a block by pushing it across the floor.

1.4 Techniques of Integration

Predicting the future with Newton s Second Law

Homogeneous Linear Systems and Their General Solutions

Worksheet # 2: Higher Order Linear ODEs (SOLUTIONS)

The following are generally referred to as the laws or rules of exponents. x a x b = x a+b (5.1) 1 x b a (5.2) (x a ) b = x ab (5.

Springs: Part II (Forced Vibrations)

The Starting Point: Basic Concepts and Terminology

Lecture 1, August 21, 2017

dx n a 1(x) dy

2nd-Order Linear Equations

1 Functions, Graphs and Limits

Resonance and response

3 Inequalities Absolute Values Inequalities and Intervals... 18

Ideas from Vector Calculus Kurt Bryan

MATH 1231 MATHEMATICS 1B Calculus Section 3A: - First order ODEs.

Handbook of Ordinary Differential Equations

MATH 353 LECTURE NOTES: WEEK 1 FIRST ORDER ODES

ENGI 3424 First Order ODEs Page 1-01

1. (10 points) Find the general solution to the following second-order differential equation:

Math 308 Exam I Practice Problems

Chapter 3: Second Order ODE 3.8 Elements of Particle Dy

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

Algebra Exam. Solutions and Grading Guide

Lecture 6: Differential Equations Describing Vibrations

Chapter 2 Second-Order Linear ODEs

6.4 Exponential Growth and Decay

LECTURE 4-1 INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS

Integrals. D. DeTurck. January 1, University of Pennsylvania. D. DeTurck Math A: Integrals 1 / 61

Introductory Differential Equations

Algebra & Trig Review

4. Complex Oscillations

Fourier transforms. c n e inπx. f (x) = Write same thing in an equivalent form, using n = 1, f (x) = l π

Ordinary Differential Equations (ODEs)

Final 09/14/2017. Notes and electronic aids are not allowed. You must be seated in your assigned row for your exam to be valid.

Math 256: Applied Differential Equations: Final Review

Short Solutions to Review Material for Test #2 MATH 3200

Linear Second-Order Differential Equations LINEAR SECOND-ORDER DIFFERENTIAL EQUATIONS

Second-Order Linear ODEs

Diff. Eq. App.( ) Midterm 1 Solutions

In economics, the amount of a good x demanded is a function of the price of that good. In other words,

Transcription:

Differential Equations (for MATH 123) Notes by Kent Merryfield February, 2009 - version 3 Table of Contents 1. Classifying Differential Equations Page 1 2. Exponential Growth and Decay Page 2 3. First Order Equations, Direction Fields, and Numerical Approximation Page 6 4. First Order Linear Differential Equations Page 8 5. First Order Separable Differential Equations Page 11 6. Second Order Differential Equations Page 14 7. Using Power Series in Differential Equations (exercises only) Page 17 1. Classifying Differential Equations Our first question: what is a differential equation? A differential equation is an equation in which the unnown to be solved for is an unnown function rather than an unnown number, and the equation involves at least one derivative of that unnown function. By that definition, this is a differential equation: dy = cos 3x, where y is the unnown function. dx Of course we would not invent a new name just for this problem, because we already have a name for it it is an antiderivative problem. But it counts, anyway. And we now the solution, because we now how to integrate: y = 1 sin 3x+C. Even though it is hardly typical, this already has some 3 of the features we will be dealing with. The first thing to note is that the solution is not a single function, but rather an infinite family of functions containing one of more unnown constants. (This constant or these constants can be determined if we have initial conditions more on that later.) The second thing to note is that being able to write the solution in closed form depends on our ability to do integrals in closed form, and we can t always have that. Had the equation been dy dx = ex2 we would not have been able to write down the solution in closed form (although the solution does exist, and we can write a power series for it.) We shouldn t expect to be able to solve all differential equations in closed form. We also note that the act of finding a solution to a differential equation is sometimes called integrating the differential equation. Here s an example of an equation with an initial condition: y = 3x 2 + 1; y(1) = 7. Then the general solution is y = x 3 + x + C. If we put in x = 1, we get 7 = 1 + 1 + C, so C = 5 and we write the specific solution to the initial value problem as y = x 3 + x + 5. So far, our examples aren t really differential equations because they have been antiderivative or integration problems. A more typical example would be this: for a constant, dy = y. There, the unnown function y appears both inside and outside the derivative, and we cannot simply do an integral with respect to and have it mean anything. Differential equations come in a number of types and classifications. And classification is important, because each classification may indicate a technique of solution that should be applied. The first distinction is between ordinary differential equations (ODE for short) and partial differential equations (PDE for short). In an ordinary differential equation (or system of ODEs) the unnown function (or functions) depend on a single independent variable. (Often but not always that independent variable is time.) The derivatives in an ODE are ordinary derivatives 1

with respect to that independent variable. In a partial differential equation, the unnown function depends on more than one independent variable and the equation contains derivatives partial derivatives with respect to those variables. We need the notion of a partial derivative, which is a Calculus III notion, even to express a partial differential equation. All of the differential equations we will consider in MATH 123 and indeed all of the differential equations we will consider in either MATH 370A or MATH 364A will be ordinary differential equations. PDE is its own, different, subject. The next classification is order. The order of a differential equation is the highest derivative that appears in the equation. All of the examples so far have been first order equations. For our first wee, we will study only first order ODEs; in the last wee we will loo at second order ODEs. One rule of thumb: the general solution of an ODE will have as many arbitrary constants as the order of the equation, and that s how many pieces of information we ll need in order to have initial conditions. For a first order equation, initial conditions will specify the value of the solution at one point; for second order equations, initial conditions will specify the value and the derivative at some point. Differential equations model the physical world. First order equations can come from any field we simply need to be able to write the rate of change of a quantity we are interested in terms of various influences. Second order equations tend to come from physics, often rooted in Newton s law F = ma, where a is acceleration, since acceleration is the second derivative of position. There are further classifications, the most important of which is linear versus nonlinear. For first order equations, we will also single out the classes of separable differential equations and autonomous differential equations. Within the class of linear equations, there are distinctions between constant coefficient versus variable coefficient, and homogeneous versus nonhomogeneous. (The only second order equations we will consider in our two short wees will be linear constant coefficient homogeneous equations.) 2. Exponential Growth and Decay Leaving aside antiderivative problems, the simplest, most natural and most important of all differential equations is the instance of a quantity which whose rate of change (usually with respect to time) is proportional to the quantity itself. A population of bacteria in a flas, of people in a city grows at a rate proportional to the population. Money lying in a savings account grows (by earning interest) at a rate proportional to itself. A quantity of a radioisotope, or of an unstable chemical, decays away at a rate proportional to the quantity that remains. All of these, and many similar phenomena, can be described by the differential equation dy = y for a constant. If it is a matter of decay, we usually eep positive and introduce a negative sign so that we write dy = y. This is the differential equation of exponential growth or exponential decay. I lie to call this differential equation #1 and if you now of no other differential equations, you should now this one. (In some of these cases, such as population or compound interest, the exact description is discrete, and the quantity increases or decreases by jumps at periodic intervals; in such cases the differential equation may be useful as a reasonable approximation.) A side note on units of measurement: y will be measured in whatever units are natural for y : numbers (for population), dollars, grams there are many possibilities. Then dy is measured in those units divided by a unit of time: grams per second, dollars per year, and so on. Then to mae the equation dy = y wor when t is time, the quantity must be measured in units of reciprocal 2

time: yr 1, sec 1, etc. Sometimes gets expressed as a percentage: the population of the city is growing at 1.5% per year, that ban account is earning 3.5% per year interest. The best way to deal with this is probably to say percent but write something lie =.035yr 1. Note also that we will have expressions of the form y 0 e t or y 0 e t. The rule of thumb about transcendental functions lie the exponential is that the value put into such a function must be a pure unitless number. Hence if we are taing the exponential of e t and t is measured in seconds, then must be measured in sec 1 in order for that to mae sense. Now that we have stated the equation, what is the solution? Note that if the quantity y is ever zero, then it can t grow or decay because it can t change. The model is of physical interest only when y > 0. So divide the equation y (t) = y(t) by y(t) to get y (t) y(t) = But now we note that that left hand side is the derivative of ln(y(t)). d ln(y(t)) = ln(y(t)) = t + C where C is an arbitrary constant. We have a standard initial condition, which is that we now how much was there at time zero: just call that y(0). If we put in t = 0, we get that ln(y(0)) = 0 + C, so that C = ln(y(0)). That gives us ln(y(t)) = t + ln(y(0)) which exponentiates to y(t) = y(0)e t. We ll basically do this solution once and for all, and remember the solution forever. Exponential Growth: If dy = y, then y(t) = y(0)et Exponential Decay: If dy = y, then y(t) = y(0)e t Example 1: Suppose you place $1250 in a savings account which earns interest at a rate of 3.5% per year, compounded continuously (that s what we have to say to mae this a differential equation.) How much will be in the account after 10 years? This is an exponential growth problem with =.035yr 1 and y(0) = $1250. The solution is y(t) = 1250e.035t so that if we let t = 10, then y(t) = 1250e.35 $1773.83. (Note that 10yr times.035yr 1 wors out to being a pure unitless number that we can tae the exponential of.) Example 2: A chemical compound decays away at a rate proportional to the amount present. A sample has 3.2 grams after.5 hours and 1.2 grams after 2 hours. How much was there when the sample was freshly prepared and how much will there be after 5 hours? Solution: We have exponential decay, so if y is the amount (in grams) of the chemical in the sample, we have y(t) = y(0)e t only we don t yet now what either y(0) or are. Tae the logarithm, writing the equation as ln y(t) = ln y(0) t. Note that this has the structure of a linear equation. When t =.5 we get ln 3.2 = ln y(0).5 and when t = 2 we get ln 1.2 = ln y(0) 2. 3

ln 3.2 ln 1.2 Subtract these two equations: ln 3.2 ln 1.2 =.5 + 2 so =.654hr 1. Put this 1.5 into ln 3.2 = ln y(0) (.654)(.5) to get ln y(0) ln 3.2 + (.654)(.5) 1.49. Tae e 1.49 to get that y(0) 4.44 grams. So that s the amount when freshly prepared: about 4.44 grams. The general equation is y(t) = 4.44e.654t. Putting t = 5 into that gives us that y(5) 0.17 grams. That s how much is left after five hours. One comment about all of this: we now that by the hierarchy of size, any exponential function eventually grows much faster than any power of t. If we allow an exponential growth model to continue for too long, the results can become silly. (Exercise 3 below intentionally embraces that silliness.) Physically, we realize that the underlying mathematical model cannot be valid forever but must have a different expression for the rate of growth once the size gets large enough. Half lives and doubling times: For something that is decaying exponentially (especially a radioisotope) the most common way to describe the rate of decay is to give the half life. For something that is growing exponentially, a reasonably common way to describe the rate of growth is to give the doubling time. The half-life is the time needed for y to reach half of its original amount; the doubling time is the time needed for y to reach twice its original amount. In both cases, it won t matter what the original amount is (as long as it s not zero), and the algebra is essentially the same in both cases. Suppose the quantity y is decaying exponentially at y = y(0)e t. The half life is that t such that y(t) = 1 y(0). Hence we solve the following equation for t : 2 y(0)e t = 1 2 y(0) e t = 1 2 ( ) 1 t = ln = ln 2 2 t half = ln 2 For exponential growth, the computation is similar, and has a similar result: t double = ln 2 The number ln 2 is pervasive in this, so it s worth nowing that ln 2.693. For quic estimation in your head, you can use.7 or 70%. If your money is earning 3.5% per year interest, it will double in about 20 years; increase the interest to 5% and the doubling time becomes 14 years. A population that is growing at 1% per year will double in about 70 years. A machine that loses 10% of its value per year will have its value cut in half in about 7 years. The half life of carbon 14 is about 5570 years; that means that the decay rate for 14 C is about =.693 5570 =.0001244yr 1. Decay towards a number other than zero: Sometimes there is an equilibrium or steady-state value y e for the quantity y and rather than tending towards zero, y tends toward y e at a rate proportional to the distance from that value. In other words, the equation is dy = (y y e). One way to approach this is to mae the substitution 4

u = y y e, which we can also write as y = u + y e. Since y e is constant, we have that du = dy and the differential equation becomes du = u. We now the solution of that: u(t) = u(0)e t. Reverse the substitution and we get that y(t) y e = (y(0) y e )e t or y(t) = y e + (y(0) y e )e t. And example of this is Newton s Law of Cooling: an object of temperature T placed in an environment of temperature T e cools towards that temperature according to the law T (t) = (T (t) T e ) which has solutions T (t) = T e + (T (0) T e )e t. Exercises: 1. A city has a population of 100,000 and is growing at 2.5% per year. What will its population be in 20 years? 2. The radioisotope 32 P has a half-life of about 14 days. Suppose you have a sample of 40 millicuries. (Don t worry about what a millicurie is it s some unit of measurement of how much we have of the isotope.) How much of the sample will be left after 60 days? 3. Assume: if P is the population of frogs in a certain pond, then dp = P for some > 0. When t = 0, P = 1,000 frogs and when t = 2 months, P = 1,250 frogs. Using this information, compute: (a) The number of frogs present after one year. (b) The number of frogs present after 15 years. (c) (This is the silly part.) Assume that the pond has a surface area of 5,000 square meters and assume that each frog occupies 100 cubic centimeters of volume. Express your answer to part b) as the height of the pile of frogs above the pond. 4. (Carbon-14 dating.) A sample of wood from a building at an archeological site has an amount of 14 C (as a proportion of its total carbon) that is about 11.4% of the 14 C that would be present in living wood. Assume a half life of 5570 years for 14 C. How many years ago was the wood for the building cut? 5. A cup of coffee is poured at a temperature of 180 F and set down on a table in a 70 F room. After 5 minutes, the temperature of the coffee is 140 F. For how long after the cup is poured will the temperature be at least 100 F? 5

3. First Order Equations, Direction Fields, and Numerical Approximation If we call the independent variable x (for now - we also often call it t) and the unnown function y = y(x), then a completely generic first order differential equation is y = f(x, y) for some function f(x, y) of two variables. A first order differential equation with an initial condition has the form y = f(x, y); y(x 0 ) = y 0. First order equations can be classified into a several different types depending on certain properties of f(x, y). Each classification we mention will suggest either a method of solution, certain properties of the solution, or both. Although there are many possible classifications, we will only mention the three most important ones in this course. 1. Linear: A first order equation is linear if f(x, y) depends linearly on y (and arbitrarily on x.) That is, a first order linear differential equation can be written as y = a(x)y + b(x). If a(x) is constant, we call it a constant coefficient linear differential equation. First order linear differential equations can be solved by the technique of integrating factors, which is the subject of section 4 of these notes. 2. Separable: A first order equation is separable if f(x, y) can be completely factored into a function of x times a function of y. That is, a first order separable differential equation can be written as y = h(x)g(y). Separable differential equations can be solved by the technique of separation of variables, which is the subject of section 5 of these notes. 3. Autonomous: A first order equation is autonomous if f(x, y) depends only on y and not x. That is, a first order autonomous differential equation can be written as y = g(y). Note that the set of autonomous equations is a subset of the set of separable equations, so the technique of separation of variables also applies here. Autonomous equations are very common in applications we have a system in which the rate of change of some variable depends on the state of the system but not on the cloc on the wall or any external influence. That s an autonomous system. The study of autonomous systems quicly concerns itself with equilibrium points and the stability of those equilibrium points. We don t have the time to go into that here. It is entirely possible for a differential equation to be both linear and separable; when it is, we will have our choice of methods. Or an equation may be linear but not separable, or separable but not linear, or neither separable nor linear. Some examples: Linear and separable both: y = xy (not autonomous.) Or y = 3y (exponential decay linear and autonomous.) Or y = 3(y 2) (law of cooling equation linear and autonomous.) Linear but not separable: y = 2y + x (constant coefficient.) Or y = xy + 1 (not constant coefficient.) Separable but not linear: y = y 2 (autonomous.) Or y = x y (not autonomous.) Neither linear nor separable: y = x y 2. Direction Fields: One way to visualize the differential equation y = f(x, y) is as a direction field. Draw an xy plane and at each point in the plane (or in some portion of that plane) draw a 6

tic mar which is a small piece of a line of slope m = f(x, y). (In practice, we ll do that for a grid of sample points.) An initial condition is simply a point in that plane. A solution to the differential equation is a curve which is, at every point, tangent to the tic mar of the direction field. The single most important theorem in the theory of differential equations is the Existence- Uniqueness Theorem: provided f(x, y) satisfies certain conditions (it must be continuous, and it must not change too much for each change in y), the differential equation y = f(x, y) has for each initial condition (x 0, y 0 ) one and only one solution that passes through the initial condition and is valid on some interval around (x 0 ). What this means is that if you draw all of the solutions to y = f(x, y), these curves never touch and never cross, but there s one of these curves through every point at which the equation is good. We ll setch an example or two of a direction field in class, but it s tedious and it s hard to do well without some automatic help. Euler s Method: The idea that a solution to a differential equation is a curve tangent to the direction field gives us a first idea for approximating solutions. (After all, there are many, many differential equations that we won t be able to solve exactly in closed form.) From a given point in the plane, tae a short step in the direction of the direction field. Then evaluate the direction field at that new point, tae another short step in this new direction, and continue. If we mae this systematic, we have a method called Euler s Method for approximating the solutions to differential equations. We have an initial value problem y = f(x, y); y(x 0 ) = y 0. We pic a step size x = h. We re going to find a chain of approximations at the points x = x 0 + h. We ll use y to stand for our approximation of y(x ). The process is simple and intuitive. At each step, our most recent estimate of a point on the curve is (x, y ). We find our new x by moving one step of size h to the right: x +1 = x + h. We find our new y by following a line segment of slope f(x, y ) for that distance: y +1 = y + hf(x, y ). Let s illustrate this with an example. Our equation is y = xy 2 ; y(0) = 1. [This turns out to be a separable equation that can be solved exactly in section 5 below. Its solution is y = 2 x 2 + 2 so that in particular, y(2) = 1.] We would lie to estimate y(2). Start by letting h = 1. 3 x 0 = 0, y 0 = 1. Evaluate f(0, 1) = 0 1 2 = 0 to get y = 0. Then y 1 = 1 + 1 0 = 1. x 1 = 1, y 1 = 1. Evaluate f(1, 1) = 1 1 2 = 1 to get y = 1. Then y 2 = 1 + 1( 1) = 0. x 2 = 2, y 2 = 0. That got us an estimate of y(2) = 0, which we re not particularly happy with. Let s try this again with a smaller h, such as h =.5. x 0 = 0, y 0 = 1. Evaluate f(0, 1) = 0 1 2 = 0 to get y = 0. Then y 1 = 1 +.5 0 = 1. x 1 =.5, y 1 = 1. Evaluate f(.5, 1) =.5 1 2 =.5 to get y =.5. Then y 2 = 1 +.5(.5) =.75. x 2 = 1, y 2 =.75. Evaluate f(1,.75) =.5625 to get y =.5625. Then y 3 =.75 +.5(.5625).4688. x 3 = 1.5, y 3.4688. Evaluate f(1.5,.4688).3296 to get y.3296. Then y 4.4688 +.5(.3296).3040. x 4 = 2, y 4.3040. That got us an estimate of y(2).3040. That at least faintly resembles the exact value of 1 3. If we let h =.2, it taes us 10 steps to get the approximation y(2).3254. If we let h =.01, it taes us 200 steps to get the approximation y(2).3330. Clearly, we don t want to do 200 steps by punching these numbers into our calculator by hand on each step. I will give a demonstration in class of how to set this computation up on a spreadsheet. This isn t a very good method. If you applied it to an integration problem, it would be the 7

same as doing the integral by left-endpoint Riemann sums. But it does wor in the sense that the limit as h tends to zero is the exact solution it s just that the convergence is rather slow. As was the case for integrals, we can start with this basic idea and twea it for greater accuracy. Try Googling the words Runge-Kutta or looing them up on Wiipedia or Mathworld. The fourth-order Runge-Kutta method, if applied to an integration problem, would be Simpson s rule. Exercises: 1. Is the differential equation y = x y 2 linear, separable, both, or neither? 2. By using tic mars, setch the general appearance of the direction field generated by y = x y 2 and indicate what some possible solution curves might loo lie. 3. Use Euler s method to approximate the solution to y = x y 2 ; y(0) = 2 on the interval [0, 2]. Do this more than once, using different values of h. What is your best estimate for y(2)? (It is strongly recommended that you use a computer to do this - most liely, a spreadsheet.) 4. First Order Linear Differential Equations The standard technique for solving first order linear differential equations is the method of integrating factors. We will have to do two integrals to solve the one equation, but as long as we can do those integrals, this method will wor. The first step is to place the equation is a standard form in which every term with y or y in it is on the left hand side, every other term is on the right hand side, and the coefficient of y is 1. That is, y + p(x)y = q(x). The next step is to integrate the coefficient p(x) of y. (At this point, do not concern yourself with constants of integration.) We then tae the exponential of this and call it the integrating factor. That is, the integrating factor is m(x) = er p(x) dx. (Important note: if there is a negative sign in front of the coefficient of y, then that negative sign is part of p(x) and part of the integral to find m(x).) Multiply both sides of the equation (important: both sides) by m(x): m(x)y + p(x)m(x)y = q(x)m(x). At this point, the left hand side should be the derivative of a product: (m(x)y). (Tip: chec this by differentiating. The chec should use the product rule. This chec catches several inds of mistaes in identifying or integrating p(x) or simplifying m(x).) (m(x)y) = q(x)m(x) m(x)y = q(x)m(x) dx + C. If there is an initial condition, this is the time to put it in to solve for C. The last step will be to divide by m(x) to solve for y(x). Example 1: Find the general solution of dy = 3y + 2e 2t. 8

The first step is to write this in standard form as dy + 3y = 2e 2t. The integrating factor is er 3 = e 3t. Multiply by this to get 3t dy e + 3e3t y = 2e 2t e 3t = 2e t d ( e 3t y ) = 2e t e 3t y = 2e t = 2e t + C y = e 3t (2e t + C) y = 2e 2t + Ce 3t. Example 2: Solve dy 2y = t; y(0) = 4. This is already is standard form. The integrating factor is m(t) = e 2t. e 2t y 2e 2t y = te 2t e 2t y = (e 2t y) = te 2t te 2t = 1 2 te 2t 1 4 e 2t + C Set t = 0 and y = 4: e 0 4 = 0 1 4 e0 + C or 4 = 1 17 + C, so C =. The solution is given by 4 4 e 2t y = 1 2 te 2t 1 4 e 2t + 17 4, which we simplify to y = 1 2 t 1 4 + 17 4 e2t. Example 3: Solve xy + 2y = x 3 + 1; y(1) = 2. This isn t in standard form yet. We ll have to divide by x to get there. But when we do divide by x we note that x = 0 becomes a bad point for this equation. We can t give initial conditions at 0 and with the initial condition we do have, we can t carry the solution through zero we ll have a solution valid on (0, ). With that note, we ll proceed. y + 2 x y = x2 + 1 x The multiplying factor is m(x) = er 2 x dx = e 2 ln x = x 2. This simplification is important. Set x = 1 and y = 2 to get 2 = 1 5 + 1 2 x 2 y + 2xy = x 4 + x (x 2 y) = x 4 + x x 2 y = 1 5 x5 + 1 2 x2 + C + C or C = 13 10. x 2 y = 1 5 x5 + 1 2 x2 + 13 10 9

y = 1 5 x3 + 1 2 + 13 10x 2. The general solution to the differential equation is y = 1 5 x3 + 1 2 + C, which behaves badly as x2 x 0. Example 4: An object is dropped from a height in air. It experiences two forces: gravity and air resistance. Mae an assumption (a big assumption, not always justified) that air resistance is linearly proportional to the speed the object is falling, and opposed the object s motion. How far will it have fallen in a given time? Since the question was phrased as how far will it have fallen, we ll let the downward direction be the positive direction, and we will write the distance fallen as y. There are two forces acting on the body: gravity, which is a force mg, and air resistance, which is a force y where y is the velocity and is a positive constant. So we have F = mg y. We also have Newton s law of motion, which says that F = ma = my where a = y is the acceleration. That gives us my = mg y or y = g y. We also assume that we drop the object at time zero; at that m time the distance the object has fallen is zero and its velocity is zero. That gives us this problem: y + m y = g; y(0) = 0, y (0) = 0 The only problem is that that is a second order differential equation and we haven t taled about those yet. But note that y never appears in the equation (except in the initial condition). Let v = y, so that v = y. Then we have a first order linear equation for v: v + v = g; v(0) = 0 m The integrating factor is er m = e m t. Put in t = 0 and v = 0 to get that C = mg. e m t v + m e m t v = ge m t ( ) e m t v = ge m t e m t v = ge m t = mg e m t + C e m t v = mg ( ) e m t 1 v = mg (1 e t) m One thing to note about this solution is the phenomenon of terminal velocity. That is, lim v(t) = t mg, which is a constant. There is a fixed speed that the falling object tends to, and falls no faster than that. We can then integrate this to get y = mgt + m2 g ( ) 2 e m t 1. 10

Exercises: 1. Compute the following limits. (Suggestion: power series methods are probably best.) mg (a) lim (1 e t) m 0 mgt (b) lim 0 + m2 g ( ) 2 e m t 1 (c) Note where exactly in Example 4 above these limits come from. We re taing the limit as the coefficient of air resistance goes to zero, so the limit should be the case we get if we ignored air resistance altogether. Do your results in (a) and (b) mae physical sense? 2. Find the general solution: dy = 2y 2t. 3. Find the general solution: (cos x)y + (sin x)y = 1. 4. Solve: y + xy = x 3 ; y(0) = 0. 5. Solve: xy y = x 2 ln x; y(1) = 0. 6. This problem uses a differential equation to construct a model for a home mortgage. (The actual mathematics will be that of a finite difference equation, which in this case approximates the differential equation as in the Euler method only this time we re using the differential equation to approximate the difference equation.) Let y be the outstanding balance at any time. This amount increases because of interest at a rate ry, where r is the interest rate, but it decreases due to payments, which are made at a rate of dollars per year. That gives us a differential equation of y = ry. The initial condition is y(0) = P, the original principal amount of the loan. (a) Solve the differential equation y = ry ; y(0) = P. (b) Now suppose that the initial condition is P = $400,000 and the interest rate is r =.06 year 1. What must be (in dollars per year) in order for the loan to be paid off in exactly 30 years? (That is, so that y(30) = 0.) 5. First Order Separable Differential Equations How do we solve a separable equation? It maes sense to use the Leibniz notation for derivatives dy dx rather than y and to treat dy and dx as separate quantities. The plan is simple: algebraically manipulate the equation until one side has only one variable (y and dy) and the other side has only the other variable (x and dx). (If you can t do that, then the equation wasn t separable.) Integrate, placing one constant of integration (on either side it doesn t matter which.) The result will be an implicit equation for the solution. If possible, you may be able to solve it for y in terms of x (or t) but that won t always be possible. Example 1: Find the general solution for dy = y2. 11

This is an autonomous equation, and autonomous equations are always separable. We divide by y 2 and multiply by, then we integrate: dy y 2 = dy y 2 = 1 y = t + C y = 1 C t There are several points we need to mae about this solution. One is that we completely missed a solution. The function y = 0 is a solution of the differential equation. We missed it because we divided by y 2. So mae a note when you divide by something to chec whether that might be a solution. Another thing to note is that none of these solutions (except the identically zero solution) are defined on the whole line. They all blow up (they have vertical asymptotes), but the location of the vertical asymptote is determined by C and we don t now C until we have an initial condition. Example 2: Solve y = x ; y(3) = 4. y Put this into Leibniz notation and proceed: dy dx = x y y dy = x dx y dy = x dx Now insert x = 3, y = 4 to find that 2C = 25. 1 2 y2 = 1 2 x2 + C y 2 + x 2 = 2C y 2 + x 2 = 25 y = 25 x 2 Note the last step. The implicit equation we got was the equation of a circle, but the solution to the differential equation must be a function, so it could only be the upper or lower semicircle. We piced the lower semicircle because that was where the initial condition was. Note also that the solution is only valid on the interval 5 < x < 5. (It s not valid when y = 0 because the original differential equation maes no sense there.) Example 3 Logistic Growth: Suppose that y is a population. If it is small enough, a first approximation of its growth would be that it grows at a rate proportional to itself exponential growth, y = y. But as we ve seen, this can result in absurdities if continued long enough. A slightly more sophisticated model supposed 12

the growth is proportional to the product of the amount present and the distance from some ideal carrying capacity M. We have this: ( y = y 1 y ). M This is called the logistic growth model. It is an autonomous (hence separable) but not linear differential equation. In solving it, we will need to employ the technique of partial fractions. dy = y(m y) M M dy = y(m y) M The partial fractions calculation is that y(m y) = A y + B M y = 1 y + 1 M y. ( 1 y + 1 ) dy = M y ln y ln(m y) = t + C y M y = Cet (In the last step we used that the exponential of the arbitrary constant C is the arbitrary constant C.) We can then solve this for y to get y = MCet 1 + Ce t = M 1 + 1 C e t. Exercises: 1. Find the general solution: yy = x 2. Find the general solution: dy = 3. Solve: dy ( π ) dx = y2 + 1; y = 1. 2 te t y 1 + y 2. 4. If x is the concentration of a chemical compound that forms from a reaction of species A and B which have initial concentrations a and b, then dx = (a x)(b x). Let the initial condition be that x(0) = 0. (a) Assume that a > b. Solve the differential equation. (b) Still assuming that a > b, show that lim t x(t) = b. (c) Assume that a = b. Solve the differential equation. (d) Still assuming a = b, show that lim t x(t) = a, but relatively slowly (not exponentially.) 13

5. Alcohol in the Bloodstream: If Y is the concentration of alcohol in a person s blood, then the rate at which it is removed by the liver obeys the following differential equation (assuming no further drining): dy = V maxy K M + Y where K M and V max are constants which may vary from person to person. (a) There are two extreme situations for which an approximation may be in order: first, what if Y >> K M? Then the differential equation may be approximated as: dy = V max What are the solutions of this approximate equation? Draw a rough setch of the family of solutions. (b) Second, what if Y << K M? Then the differential equation may be approximated as: [ ] dy = Vmax Y What are the solutions of this approximate equation? Draw a rough setch of the family of solutions. (c) Solve the full original equation (it is separable). Your answer cannot be solved explicitly in closed form for Y in terms of t but (as a hint for later) notice that you can solve for t in terms of Y. (d) Suppose that for a particular person, we now that K M = 0.02 (units) and that V max = 0.025 (units)/hour. This person gets drun: the initial condition is Y (0) = 0.13 (units). Mae an approximate prediction, based on whichever of a) or b) is applicable, as to how long it will tae for this person s blood alcohol to drop to the legal 0.08 (units). K M (e) Find the exact solution of this initial value problem. (f) Use the exact solution to answer these two questions: how long will it tae for the concentration to reach 0.08 (units)? How long will it tae for the concentration to reach 0.005 (unit)? [The unit is % by volume not a standard scientific unit. Don t unnecessarily confuse yourself by trying to thin of is as % its just some unit.] Carefully drawn graphs might be useful. 6. Second Order Differential Equations The general subject of second order ordinary differential equations is large, which is why we have entire courses devoted to differential equations. We will devote ourselves to one very narrow special case: second order linear constant coefficient homogeneous differential equations, which are equations of the form ay + by + cy = 0, where a, b, and c are constants and a 0. (By default, we will usually assume that the independent variable is t, for time.) 14

To get a hint about how to proceed, let s consider a linear constant coefficient homogeneous first order equation: ay + by = 0. This equation is both linear and separable, so we have our choice about methods of solution. Either way, we get that y = Ce (b/a)t. That is, we get y = Ce rt where r is a solution of ar + b = 0. That s our first hint we will loo for exponential solutions. The second thing to deal with is a consequence of linearity: the notion of a superposition of solutions. Suppose that we have two functions y 1 (t) and y 2 (t) that are both solutions of ay + by + cy = 0. That is, we have ay 1 + by 1 + cy 1 = 0 and ay 2 + by 2 + cy 2 = 0. Then we claim that y = c 1 y 1 +c 2 y 2, for arbitrary constants c 1 and c 2 is also a solution of the same differential equation. In detail: ay + by + cy = a(c 1 y 1 + c 2 y 2) + b(c 1 y 1 + c 2 y 2) + c(c 1 y 1 + c 2 y 2 ) = = c 1 (ay 1 + by 1 + cy 1 ) + c 2 (ay 2 + by 2 + cy 2 ) = c 1 0 + c 2 0 = 0. So if we find several solutions, we can put together new solutions this way (it s called maing linear combinations of the solutions). The final question: how do we now when we ve got everything? The answer there comes from initial conditions. Initial conditions for a second order differential equation are the values of y and y at the same location. (Physically, that s an initial position and an initial velocity.) If our proposed general solution allows us to solve for all possible initial conditions, then we have everything. In practice, this means that the general solution of a second order linear homogeneous differential equation will always be of the form y = c 1 y 1 + c 2 y 2 where y 1 and y 2 are essentially different solutions. (The actual name for essentially different is linearly independent.) So that brings us to our method, which will be a structured guess. We guess that the equation ay + by + cy = 0 has solutions of the form y = e rt. Since this gives y = re rt and y = r 2 e rt, this leaves us with the equation ar 2 e rt + bre rt + ce rt = 0. Since e rt 0, we can safely divide by it, leaving the the equation ar 2 + br + c = 0, which is a quadratic equation for the unnown r. Let s wor an example to see what to do next: Example 1: Solve y + 5y + 6 = 0; y(0) = 1, y (0) = 1. We guess y = e rt, which leads to the equation r 2 + 5r + 6 = 0, which has roots r = 2 and r = 3. That means that y = e 2t and y = e 3t are both solutions, and so is any linear combination of the two. The general solution is y = c 1 e 2t + c 2 e 3t. Now we must deal with the initial conditions. Setting t = 0 gives us the equation c 1 + c 2 = 1. Then we tae the derivative: y = 2c 1 e 2t 3c 2 e 3t. Setting t = 0 in that gives us the equation 2c 1 3c 2 = 1. These two equations in two unnowns can be solved together to yield c 1 = 2, c 2 = 1. Hence, the solution is y = 2e 2t e 3t. What could go wrong or at least go differently than this? There s a quadratic equation there. What happens if that equation has either complex roots or a double root? Let s start with the issue of complex roots. Example 2 Simple Harmonic Motion: Find the general solution for y + 9y = 0. As before, we guess that y = e rt. This gives us the quadratic equation r 2 +9 = 0, which has roots r = ±3i. So what are we supposed to do? Write the solution as y = c 1 e 3it + c 2 e 3it? That would be correct, but it s not very satisfying. The differential equation came from a physical model a mass on a spring, perhaps and to interpret it appropriately, we should have real-valued solutions. With that in mind, we note that 1 2 e3it + 1 2 e 3it = cos 3t is a solution and 1 2i e3it 1 2i e 3it = sin 3t 15

is a solution. That means that another way to write solutions will be as y = c 1 cos 3t + c 2 sin 3t. Is that enough? It s enough if we can solve for all possible initial conditions, and we can. Hence we write the general solution as c 1 cos 3t + c 1 sin 3t. General principle: If we get solutions of the form e rt where r = a±bi, write the general solution as y = c 1 e at cos bt + c 2 e at sin bt. Example 3: An object of mass m hangs from a spring. The spring exerts a force a Hooe s Law force equal to times the distance the spring has been stretched, in a direction opposing the stretch. The other force acting on the object is the gravitational force mg. These forces will be in equilibrium if the string stretches by an amount x 0 where x 0 = mg. Now let y be the distance the mass is above or below that equilibrium point (that is, we mae the equilibrium point the zero point on the scale). The spring exerts an upward force of (x 0 y) and gravity exerts a downward force of mg, so the net force is (x 0 y) mg = (x 0 mg) y = y. If we ignore all other forces, such as friction or air resistance, then Newton s law of motion F = ma gives us the equation my + y = 0. This is a second order linear constant coefficient homogeneous differential equation. Guess y = e rt, getting the equation mr 2 + = 0 so r 2 = m or r = ± i. As in the general principle above, ( ) ( ) m we write the solution as y = c 1 cos m t + c 2 sin m t. Example 4: Solve y + 2y + 10 = 0; y(0) = 1, y (0) = 2. The guess y = e rt yields r 2 + 2r + 10 = 0 which we solve to get r = 1 ± 3i. In accordance with the general principle, we write y = c 1 e t cos 3t + c 2 e t sin 3t. Evaluating at zero gives us 1 = c 1 + 0, so c 1 = 1. Now tae the derivative, using the product rule: y = c 1 ( e t cos 3t 3e 3t sin 3t) + c 2 ( e t sin 3t + 3e t cos 3t) y (0) = c 1 + 3c 2 = 2. Hence 1 + 3c 2 = 2 or c 2 = 1. The solution is y = e t (cos 3t + sin 3t) Example 5: Solve y + 6y + 9 = 0; y(0) = 0, y (0) = 4. The guess y = e rt yields r 2 + 6r + 9 = 0 which we solve to get r = 3, which is a double root. This is the other thing that could go wrong - getting a double root. y = c 1 e 3t is a solution, but we can t solve for all possible initial conditions with that; in particular, we can t solve for the initial conditions of this problem. And writing e 3t twice doesn t help at all. We need another different solution. There are several ways to discover what we need; at least one method will be mentioned in class. Here, I ll just give the result. it If you get a double root of the exponent equation, your general solution is y = c 1 e rt + c 2 te rt. So in this case, the general solution is y = e 3t (c 1 + c 2 t). Put t = 0 into that: 0 = 1(c 1 + 0) so c 1 = 0 and the solution can be written as y = c 2 te 3t. Tae the derivative of that: y = c 2 (e 3t 3te 3t ). Put t = 0 to get 4 = c 2 (1 0) so c 2 = 4. The solution is y = 4te 3t. A number of different physical situations lead to the model of a damped oscillation and the differential equation ay + by + cy = 0, where a, b, and c are all positive. The middle term, by, is interpreted as a resistance, friction, or damping force. If that term were not there and we had ay + cy = 0, then we would have an undamped oscillation, which is a simple harmonic motion. We can express that using sines and cosines. If b > 0 but b is small enough that ar 2 + br + c = 0 has complex roots, then we have an underdamped oscillation and we can write solutions in the form 16

y = e r 0t (c 1 cos ωt + c 2 sin ωt). If ar 2 + br + c = 0 has a double root, then we have a critically damped oscillation and we can write solutions in the form y = e r 0t (c 1 + c 2 t). If ar 2 + br + c = 0 had two distinct real roots, we have an overdamped oscillation and we can write solutions in the form y = c 1 e r 1t + c 2 e r 2t. Whether a system is overdamped, underdamped, or critically damped can be determined in a common sense fashion by looing at the discriminant b 2 4ac of the quadratic equation. Exercises: 1. Find the general solution: y 6y + 8y = 0. 2. Find the general solution: y + 8y + 41y = 0. 3. Find the general solution: y + 2y + y = 0. 4. Solve: 2y + 5y + 3y = 0; y(0) = 3, y (0) = 4. 5. Solve: y + 3y = 0; y(0) = 1, y (0) = 3. 6. Solve: y + 12y + 36y = 0; y(1) = 0, y (1) = 1. 7. A spring with a 4 g mass hanging from it has a natural length of 1.0 m and a force of 24.3 N stretches it to a length of 1.3 m. (a) Find its equilibrium position. (Use g = 9.8m/s 2.) (b) If the spring is compressed to a length of 0.8 m and then released with zero velocity, find the position of the mass as a function of time. 7. Using Power Series in Differential Equations: In each of the following problems, assume that the differential equation has a solution in the form of a power series y(x) = a 0 +a 1 x+a 2 x 2 +a 1 x 3 +. Substitute this series into the differential equation to get a sequence of equations to solve for the coefficients and thus determine a power series for the solution. Exercises: 1. y = 2y; y(0) = 1. 2. y + xy = 0; y(0) = 1. 3. y + xy = 1; y(0) = 0. 4. y + y = 0; y(0) = 1, y (0) = 0. 5. y + y = 0; y(0) = 0, y (0) = 1. 17