Math 104 Differential Equations •The most important application of integrals is to the solution of differential equations. •From a mathematical point of view, a differential equation is an equation that describes a relationship among a function, its independent variable, and the derivative(s) of the function. For example: dy 2 3xy dx 2 d y dy 4 3y 1 2 dx dx ORDER = highest derivative: first order, second order... To solve a differential equation: …means to find a function y(x) that makes it true. 2 y 2 3x ye x solves dy 2 3xy dx 2 1 3 solves d y dy 4 3 y 1 2 dx dx In Applications Differential equations arise when we can relate the rate of change of some quantity back to the quantity itself. Example (#1) The acceleration of gravity is constant (near the surface of the earth). So, for falling objects: the rate of change of velocity is constant dv g dt Since velocity is the rate of change of position, we could write a second order equation: 2 d x g 2 dt Example (#2) Here's a better one -- with air resistance, the acceleration of a falling object is the acceleration of gravity minus the acceleration due to air resistance, which for some objects is proportional to the square of the velocity. For such an object we have the differential equation: rate of change of velocity is gravity minus something proportional to dv 2 g kv dt velocity squared d x dx g k or 2 dt dt 2 2 Example (#3) In a different field: Radioactive substances decompose at a rate proportional to the amount present. Suppose y(t) is the amount present at time t. rate of change of amount is proportional to the amount (and decreasing) dy k y dt Other problems that yield the same equation: In the presence of abundant resources (food and space), the organisms in a population will reproduce as fast as they can --- this means that the rate of increase of the population will be proportional to the population itself: dP kP dt ..and another The balance in an interest-paying bank account increases at a rate (called the interest rate) that is proportional to the current balance. So dB kB dt More realistic situations for the last couple of problems For populations: An ecosystem may have a maximum capacity to support a certain kind of organism (we're worried about this very thing for people on the planet!). In this case, the rate of change of population is proportional both to the number of organisms present and to the amount of excess capacity in the environment (overcrowding will cause the population growth to decrease). If the carrying capacity of the environment is the constant Pmax , then we get the equation: dP kPPmax P dt and for the Interest Problem... For annuities: Some accounts pay interest but at the same time the owner intends to withdraw money at a constant rate (think of a retired person who has saved and is now living on the savings). Question: If the interest rate is r , and the retiree wants to withdraw W dollars per year, which is the correct differential equation for the balance B in the account at time t? A) B) dB rB W dt dB rB W dt C) dB rB WB dt D) dB rB WB dt E) dB r B W dt Another application: According to Newton's law of cooling , the temperature of a hot or cold object will change at a rate proportional to the difference between the object's temperature and the ambient temperature. If the ambient temperature is kept constant at A, and the object's temperature is u(t), what is the differential equation for u(t) ? Solving Differential Equations Since the the process of solving of a differential equation recovers a function from knowing something about its derivative, it's not too surprising that we have to use integrals to solve differential equations. And since we’re using integrals, we should also expect to see some "arbitrary" constants in the solutions of differential equations. In general, there will be one constant in the solution of a first-order equation, two in a second-order one, etc... In practice... In practice, we can solve for the constants by having some information about the value of the unknown function (and/or the value of its derivative(s)) at some point. From an applications point of view, such initial conditions are clearly needed, since you can't determine the value of something just from information about how it is changing. You also need to know its value at some ("initial") time. Some examples will make this clear Let's go back to the very first example, dy 2 3xy dx This is an example of a separable first-order equation (the only kind we'll worry about today). If you view dy and dx as variables (so you can multiply both sides by dx), you can get all the x's on one side and all the y's on the other by algebraic manipulation. Here, you can write: dy 3x dx 2 y Equation of differentials... dy 3x dx 2 y This is an actual "equation of differentials". Then, simply integrate both sides: dy y 2 3x dx 1 3 2 2 x C y 1 3 2 2 x C y (You only need one constant of integration). This is called the "general solution" of the differential equation. We can determine C if we were given one point on the graph of the function y(x). For instance, if you were given that y(1)=2 , then you could substitute 2 for y and 1 for x and get: 12 32 C and so you would conclude that C = -2, so the solution of the initial-value problem: dy 3xy2 , dx 1 3 2 is 2 x 2 , y y (1) 2 or (better): 2 y 2 4 3x DiffEq Problem: If the function y = f (x) satisfies the initial-value problem dy 2 2 x yx , dx f (0) 5 then f (1) = A) e3 1 B) 3e 1 e C) 5 e D) 2 1 E) 5 e 4 F) 1 3 e G) 10 H) e “DiffEq Greatest Hits” A tank contains 1000 liters of brine (salty water) with 50 kg of dissolved salt. Pure water enters the tank at the rate of 25 liters per minute, The solution is kept thoroughly mixed and drains at an equal rate. How many kg of salt remain in the tank after 10 minutes? The setup…. The first step in most DiffEq problems is to identify the unknown function. Since we want to know the amount of salt at different times, use A(t) for the amount of salt (in kg) in the tank at time t (minutes). We are given that A(0)=50. The rate of change of A could come from salt being added to the tank (but there is none), or from salt flowing out of the tank (the solution flows out at 25 liters per minute, and there are A(t) kg in 1000 liters, so there are A(t)/40 kg in 25 liters. So, which of the following is the differential equation for this problem? A. A' = A/40 C. A' = 40 - A B. A' = A - 40 D. A' = - A/40 E. A' = - 40/A Answer this... Now, what is the answer to the problem? (i.e., what is A(10) if A’= -A/40 and A(0) = 50 ?) A. 0 B. 40 C. 50e D. 50e 1 4 14 1 40 E. 50e 1 10 F. 25e G. 50 ln(2) H. 25 Growth and decay: Connect What is the solution of the differential equation y ’ = ky ? How about the initial value problem y ’ = ky , y(0) = y0 ? As noted previously, this differential equation is useful for talking about radioactive decay, compound interest and unrestricted population growth. One more greatest hits problem: For obvious reasons, the dissecting room of a medical examiner is kept very cool, at a constant temperature of 5 degrees C. While doing an autopsy early one morning, the medical examiner himself is killed. At 10 am, the examiner's assistant discovers the body and finds its temperature to be 23 degrees C, and at noon the body's temperature is down to 18.5 degrees C. Assuming that the medical examiner had a normal temperature of 37 degrees C when he was alive, when was he murdered? A. 3 am E. 7 am B. 4 am F. 8 am C. 5 am G. 9 am D. 6 am Geometry of Differential Equations A differential equation of the form dy f ( x, y ) dx gives geometric information about the graph of y(x). It tells us: If the graph of y(x) goes through the point (x,y), then the slope of the graph at that point is equal to f(x,y). dy f ( x, y ) dx An example: We can draw a picture of this as follows. For the differential equation dy yx dx , we have: If the graph goes through (2,3), the slope must be 1 there. If the graph goes through (0,0), the slope must be 0 there. If the graph goes through (-1,-2), the slope must be -1 there. Put it on a graph... The slope of the arrow at any point is equal to y - x at that point. This kind of picture is called a "direction field" for the differential equation dy/dx = y - x . We can use this to solve the differential equation geometrically and recover the graph of the function. The idea is to start somewhere on the direction field and simply follow the arrows: The idea is to start This graphical technique is useful for getting qualitative information about solutions of differential equations, especially when they cannot be integrated. Here are a couple for you to try... y'=2(y- 2 y) y ' = 3 x sin(2y) Numerical methods Another way to gain insight into solutions of differential equations is to use numerical methods for their solution. The simplest numerical method is called Euler's method. Euler's method is easy to understand if you relate it to two things you already know: 1. The left endpoint (rectangle) method for estimating integrals, and 2. The fundamental theorem of calculus. Or, you can think of Euler's method in terms of differentials: yx x y( x) x y' ( x) Euler’s method You can algebraically manipulate most first-order equations, until they are in the form: y'(x) = f(x,y) Euler's method then combines the differential formula with the differential equation: yx x y( x) x f ( x, y) In Euler's method, we simply ignore the small errors and repeatedly use the resulting equation with a small value of x to construct a table of values for y(x) (that can then be graphed, for instance). An example... y ' = y - x, y(0) = 2 (this is the example we graphed before). We'll use x = 0.1 The choice of x is usually dictated by the problem or the situation. The smaller x is the more accurate the approximated solution will be, but of course you need to do more work to cover an interval of a given length. For the first step, we can use that x=0 and y=2, therefore y ' = 2. Euler's method then tells us that: y(x + x) = y(x) + f(x,y) x y(0.1) = 1 + (2 - 0) 0.1 = 1.2 Continue... For the second step, we have x = 0.1, y = 2.2, therefore y' = 2.1. Euler's method then gives: y(0.2) = 2.2 + 2.1(0.1) = 2.41 We continue in this manner and fill in the following table x y 0 2 0.1 2.2 0.2 2.41 0.3 2.631 0.4 2.8641 0.5 3.11051 0.6 3.371561 0.7 3.6487171 0.8 3.94358881 0.9 4.257947691 1 4.59374246 f (x,y ) = y - x 2 2.1 2.21 2.331 2.4641 2.61051 2.771561 2.9487171 3.14358881 3.357947691 3.59374246 Maple... Maple tells us that the exact solution of the equation y ' = y - x that has y(0) = 2 is y(x) = x + 1 + e x and so we have y(1) = 4.718281828. So the Euler method result is pretty close (within 10%). We could do better by decreasing x, but of course then we'd need more steps to reach x = 1. You'll get to try a couple of these on this week's homework.