Population Growth Suppose a population increases in direct proportion to the number already present in the population. This type of information gives rise to a differential equation: dp k p, dt where p(t) is the function that gives the population at any time t and k is a constant. We solve this type of problem and obtain the function p(t) by the technique of separation of variables. By separating the variables so that all the p and dp terms are on one side of the equation and all the dt terms on the other, you can rearrange this equation to become 1 dp k dt . p Integrating both sides of the equation, you should get ln p = kt + c, which is more commonly expressed in exponential form as p = Cek t , an equation whose form might be familiar to you from either biology or chemistry (where the same kind of equation governs radioactive decay). One can solve for C if one knows the initial population. Solving for k usually requires information about the size of the population at two different times. We can now evaluate the function p(t) at any subsequent time t. 1. What happens to p(t) if the value of k is negative? Because the solution to the equation involves the exponential function, this condition is sometimes called exponential growth. You might recall from chemistry that the decay of radioactive elements is also called exponential decay. Example One can reasonably assume that bacteria grow exponentially as long as they are small in number compared to the amount of nutrients in the culture medium. If Mrs. Kagi inoculates a new flask with 1000 cells and they double in number every 15 minutes, how many bacteria will there be after just one normal school day? (Hint: the phrase “grow exponentially” means that the change in population at any time is proportional to the population already present. In other words, dp/dt = k p.) Terminology: A general solution is one where we can’t solve for the constant C (or sometimes even k). A specific solution lets us find both the constants involved in the solution of the problem. Write general solutions for the following differential equations. Solve for a specific solution when you have enough information to do so. 2. dy 3 y 1 , y(0) = 1 dt 3. y’[x] = x, y(0) = e 4. y’’[x] = - y’[x], y(1) = 1 5. dI G*I dt Approximate Solutions OK, so to be nice, we started with equations that have exact solutions. However, there are also many differential equations that cannot be solved in closed form by simple techniques, however. One of these for which the separation of variables technique that dy 3y t you used above does not work is the following: dt . While there are other techniques besides separation of variables to solve differential equations, there are always some equations (often ones that are very useful in science and engineering) that cannot be solved exactly. Nonetheless, an approximate solution is often quite useful. That provides the motivation for the development of accurate methods of approximating solutions of differential equations. Slope fields One of the easiest (and least accurate) ways to find approximate solutions to differential equations is to graph the slope field of the equation. This simply involves calculating the slope of the curve that will end up solving the equation and drawing little arrows to represent the value of the slope at various points in the area of interest. This is usually fairly easy, because any differential equation that’s written y’(x) = f(x,y) has already given you an explicit formula for the slope at any given point (x,y)! Slope fields are inherently a sketch of all possible general solutions because the slope of the curve at a point is independent of its vertical or horizontal displacement compared to the origin. 6. Why? A specific solution can be found graphically by sketching in a curve that passes through whatever specific point is obtainable from the initial conditions. Here are some examples of what slope fields look like: In these examples, the value of dy/dx at each point (x,y) is shown as the slope of a short line segment at each point. Look at these two examples to verify this. In order to make your own slope fields, click here to launch a cool applet to generate slope fields for you. You can type in almost any equation you want, and the applet will plot its slope field for you. Clicking on a point somewhere in the graphing window will plot a specific solution y = f(x) that goes through the point you clicked. The TI-89 will plot slope fields if you put it into ‘differential equations’ mode. Use the applet to find slope fields for the following differential equations: 7. 8. 9. dy x2 y2 dx dy e x cos x dx dy x 2 xy dx Use the applet to find specific solutions of each of the above that satisfy the following initial conditions: 10. y[1] = 2 11. y[1] = 1 12. y[0] = 1 Use the curves you generated in the three examples above to estimate y 1 2 for each of the differential equations. As is often the case on the AP, you’ll need to be able to generate simple slope fields yourself without a calculator just to make sure you understand how the whole thing work. Just for practice, 13. Create the slope field of the equation y’[x] =2 x . You’ll either need graph paper or a copy of the grid below. At each grid point, draw a little line segment, where the direction the segment shape of each arrow is determined by giving it a slope equal to twice its x-coordinate. To see if you’ve done it right, go use the applet again and check. 14. Plot the slope field corresponding to the field y’[x] = 0.5 y Again, check your answer with the applet. Euler’s Method While the applet gives us pretty good accuracy if we can locate the point we want on the graphing window accurately, you’re not going to be able to use the applet on the AP. Also, with a non-graphical method we don’t have to worry about where to click the mouse! So, in either of these cases, we have to turn to numerical approximation methods. To see what we might need to develop, let’s start with a specific example that we can solve explicitly. That way, we can check the accuracy of our approximation against an “exact” answer. Let’s start with an easy differential equation that you can solve either by inspection or separation of variables: Example: Given the following differential equation y’ = y, with y(0) = 1, find approximate y(1). 15. Go back to the applet and create the appropriate slope field. Select the appropriate initial condition and read off y(1) from the curve the applet plots for you. You may have to change scales to get the range you need to find the answer for x = 1. If you’re intellectually curious, you may want to know how the applet finds its answers. It does so using Euler’s method, which is the way that you would also approximate a numerical solution to the problem if you didn’t have Mathematica and if the problem were hard enough that you couldn’t solve it by hand. The basic idea is to approximate the solution we need by stepping off one unit at a time away from the starting time and using the slope at each point to calculate an approximate value for the curve at the next step. (This is essentially what the applet does to plot the solid points on the curve it generates for you.) Although we don’t know at any point other than the initial one what y is exactly, we do know that we can approximate it by the following relationship, where y1 is the value of the function at a point a distance x away from the original point and f’ (x0 ) is the slope of the solution curve at (x0 , y0 ): y1 f '( x0 ) x y0 , 16. Draw a diagram showing why this is so. The original insight for this method came from Euler, so the method now bears his name. Having now found an approximate value for y1 , we can now use it to find an approximate value for y2 . 17. Why do we not just want to use our initial conditions f’(x0 ) and y0 for the new approximation? Notice that as we step our way across the domain of interest, we are approximating the solution curve to the differential equation. A couple of things to notice: we’ll agree to keep a constant interval x between all our points. This is often called the step size and is sometimes given the variable name h. we can use the differential equation y’ = f(x,y) to find the slope at the next point that we need. Here’s how we start then… For the example problem, y’ = y , x0 0, we’ll use a step size of 0.5. So, for this problem: f(x,y) = y and h = 0.5. y( x1 ) y1 y0 hf ( x0 , y0 ) y0 hy0 1 0.5(1) 1.5 y( x2 ) y2 y1 hf ( x1 , y1 ) y1 hy1 1.5 0.5(1.5) 2.25 y0 1 . And So, for these conditions y(1)=2.25, which is at least in the same neighborhood as the exact answer, e (which is about 2.718). We can make the approximation better (at the cost of using more steps) by using a smaller step size. 18. Go back and repeat this process with a step size of 0.25. 19. What improvement in accuracy does halving the step size give you? 20. (C) Use Euler’s method to approximate the particular/specific solution of the differential equation y’ = x – y passing through (0,1) using a step size of h = 0.1. Do ten iterations of the process in order to find y(1). There’s a table for you to fill in that will help guide your solution: When you fill in the table, use ListPlot[ ] to plot your solution and then display that plot along with a graph of the exact solution (given below the table) on the same set of axes. 0 0 1 n xn yn 1 0.1 0.9 2 0.2 3 0.3 4 0.4 5 0.5 6 0.6 7 0.7 8 0.8 9 0.9 10 1.0 Exact solution: y( x) x 1 2e x 21. (C) Use Euler’s method to approximate y(1) for the values of x given in the following table if y ' x y , and y(0) = 2. x y(1) 0.50 0.25 0.10 Just for comparison purposes, the value of y(1) accurate to three decimal places 4.213. 22. Go back to the applet now and do this problem there. Change the step size in the applet itself to correspond with the three you’ve just done so you can visualize the effect that the step size can have on the accuracy of the approximation. Again, while the applet makes visualization easy, it may not give enough accuracy for this problem. And regrettably, you have to be able to do this kind of calculation without the applet for the purposes of the AP. It’s somewhat of a pain because it’s repetitive, but it shouldn’t be that hard. 23. Use Euler’s method to approximate a solution to the following differential equations at x = 1, using an initial value of y(0) = 1 and a step size of h = 0.1: a. y ' x 2 y b. y ' ye x c. y ' cos x sin y