 Welcome to the GVSU Calculus Screencasts. In this edition, we're going to talk about Euler's method. Differential equations are typically really complicated to solve, so approximation techniques are quite useful. Euler's method is an American method for approximating solutions to first-order differential equations. And the method is based on the Calculus I concept of local linearization. Now in this screencast, we'll apply Euler's method to approximate the solution to an example of a first-order differential equation. So consider the example of the initial value problem. dy dt is t squared plus y with the initial condition that y1 is 2. Now we can't easily find the solution to this differential equation. So what we're going to do instead is approximate the solution by using local linearity or tangent lines. So let's assume that we have a function y, which is a function of t, that's a solution to this initial value problem. Now let's refresh our memories about local linearization. Pause the video for a moment and use the differential equation to find the slope of the tangent line to our solution y at the initial point 1, 2. Then find the linearization, we'll call it l sub 1 of t to y at the point 1, 2, and use that linearization to approximate y of 1.1. Then resume the video when you're ready. We'll use the differential equation at the point 1, 2, substituting in 1 for t and 2 for y to find the slope of our solution y at the point 1, 2. The slope is dy dt at the point 1, 2, and that's 1 squared plus 2 or 3. We can then find the linearization to our solution at the point 1, 2 using the point slope form, taking the old y value, which is 2 at t equals 1, adding the slope times the change in t which in this case is t minus 1. Remember the linearization is a good approximation to our function as long as we stay close to the base point. So we can approximate y of 1.1 with l sub 1 of 1.1 just by substituting in 1.1 for t and we see that l sub 1 of 1.1 is 2.3 so that's an approximation to our solution at 1.1. And we can begin to construct an approximate graph of our solution by drawing our linearizations. Here's the graph of our linearization l sub 1 on the interval from 1 to 1.1. We can apply this process again, this time using our calculated value of y at 1.1. So even though the point 1.1, 2.3 probably doesn't lie on the graph of our solution, it's close to being on the graph of our solution so we're going to assume that that point lies on the graph of our solution. Then we repeat the process again. So pause the video and use the differential equation this time to find the slope of the tangent line to y at the point 1.1, 2.3. Then find the linearization, we'll call it l sub 2 to y at the point 1.1, 2.3 and use that linearization to approximate y at 1.2 and resume the video when you're ready. Just like last time, to find the slope of our solution at the point 1.1, 2.3 we evaluate our derivative given by the differential equation using 1.1 for t and 2.3 for y. So dy dt at 1.1, 2.3 is 3.51. That makes the linearization l sub 2 of t to our solution at the point 1.1, 2.3 l sub 2 of t is 2.3, the old y value, plus 3.51 the slope times t minus 1.1, the change in t. Then we use this linearization. Again, linearization will be a good approximation to y as long as we stay close to our base point 1.1 in this case. So y of 1.2 is approximately l sub 2 of 1.2 just evaluate l sub 2 when t is 1.2 and we get 2.651. We can extend this estimate that we saw earlier to the graph of our solution by now drawing in this linearization l sub 2 on the interval 1.1 to 1.2 and attach it to that linearization l sub 1. Euler's method is an iterative process. That means we keep repeating the same thing over and over again. So let's do it one more time to approximate the value of y at t equals 1.3 using our calculated value of y at 1.2. Again, the point 1.2, 2.651 probably doesn't lie in the graph of our solution but let's assume that it does because it's pretty close. So pause the video one more time use the differential equation this time to find the slope of the tangent line to y at 1.2, 2.651 then find the linearization we'll call that one l sub 3 now to y at this point 1.2, 2.651 and then use l sub 3 to approximate y at 1.3 As before, we find the slope of y at the point 1.2, 2.651 by substituting into our differential equation 1.2 for t, 2.651 for y to get the slope at this point 1.2, 2.651 to be 4.091 That makes the linearization l sub 3 again using the point slope formula l sub 3 of t is the old y value 2.651 plus the slope we just calculated times the change in t So we can approximate y at 1.3 with l sub 3 at 1.3 and you can see that that comes out to be 3.0601 Let's append this l sub 3 this local linearization to the previous local linearizations that we drew and we can see that these tangent lines that we're drawing really do kind of follow the slope field giving us a good idea of what the graph of the solution y looks like Again, Euler's method is an iterative process so we use these successive linearizations to create a sequence of approximations to our solution y so that we can actually write down a formula for doing our approximations We're going to want some notation We're going to create a sequence of approximations so let's start by letting t sub 0, y sub 0 be our initial condition 1, 2 So t sub 0 is 1, y sub 0 is 2 Then our first approximation we're going to call t sub 1, y sub 1 So in our example, t sub 1 is 1.1 and y sub 1 is 2.3 Our second approximation then we'll label t sub 2, y sub 2 So in our example, t sub 2 is 1.2 and y sub 2 is 2.651 And we can keep doing this as many times as we like and we're going to label the nth approximation as t sub n, y sub n Now note that in our example each time we want to find the next t value we just added 0.1 to the previous t value So in our example, t sub n plus 1 is found by taking t sub n, the previous t value and adding 0.1 to it So t sub n plus 1 is t sub n plus 0.1 for each n To find the next y value from the previous y value we added the slope of y at the previous point times the change in t which turned out to be 0.1 to the previous y value Well that's a little wordy and I think it's easier to see in our notation than y sub n plus 1 The next y value is y sub n the previous y value times the slope at the previous point times 0.1 and that 0.1 was how much we changed the t value from point to point and we can call this change in t our step size and we'll denote it as delta t So then we can rewrite our formula for the y sub n plus 1 as y sub n plus 1 is y sub n plus the slope dy dt at the previous point t sub n y sub n times delta t Now these values, dy dt at t sub n y sub n times delta t the slope times the change in t tells us how much the y value changes from point to point So we can label this as delta y and when we put this all together we get this nice little formula this is Euler's method where y sub n plus 1 is y sub n plus delta y where delta y is the slope dy dt at the previous point t sub n y sub n times delta t and this is an iterative process, an algorithm that we can apply over and over and over again to make as many calculations as many approximations to our solution as we like and we can record all the information that we've already accumulated nicely in a little table we're going to let the left hand column represent i and i is the number of approximation we're on then we'll have t sub i y sub i dy dt at t sub i y sub i and then delta y in the next columns and when we start with i equals 0 this is our initial condition and we had t sub 0 to be 1 and y sub 0 to be 2 and then we used the differential equation to find dy dt at t sub 0 y sub 0 we found that to be 3 and then the delta y that was equal to the dy dt at t sub 0 y sub 0 times delta t remember our delta t was just 0.1 so we take the 3 times the 0.1 to get us 0.3 and then to get the new y value our y sub 1 we add the old y value 2 to the delta y to get 2.3 now we use the same process to find y sub 2 our second approximation this time using the information in the i equals 1 row now remember t sub 1 is found by taking t sub 0 and adding delta t to it and our delta t is 0.1 so t sub 1 is 1.1 we just calculated y sub 1 in the previous slide then we find dy dt at t sub 1 y sub 1 using the differential equation and then our delta y is found by taking dy dt at t sub 1 y sub 1 times delta t and delta t is 0.1 so our delta y becomes 0.351 and then to find y sub 2 we simply add delta y to our y sub 1 to get 2.651 and we can apply this process over and over again ultimately building a whole sequence of approximations y sub i as you can see in this table and we can get a good approximation to the graph of our solution y by just connecting all the linearizations together here's a picture of the first 5 linearizations and if we keep going we can extend these calculations these approximations out as far as we want so here we have a picture of the first 25 linearizations connected together and the blue points show the approximations t sub i y sub i as i goes from 0 through 25 and you can see that this red graph then is a pretty good approximation to our solution graph and we'll pretty well follow the slope field that we've drawn so in summary Euler's method is a method used for approximating solutions to differential equations we start with a differential equation of the form dy dt is f of ty with some initial condition t sub 0 y sub 0 so then we choose a step size that's something that we pick to run this process and then once we have that step size we can approximate the points of the solution by t sub n plus 1 is t sub n plus delta t and then y sub n plus 1 is y sub n plus delta y where we get delta y by taking the slope at t sub n y sub n and multiplying by delta t well that concludes our screencast on Euler's method and please make a special note of this it's pronounced Euler we hope you come back and see us again soon