Euler's method for solving differential equations

 
 
Eulers method blog post.jpeg
 
 
 

Euler’s method approximates the solution to a differential equation

Euler’s Method helps you approximate solutions to differential equations.

You’ll always be given an equation and an initial condition, and you’ll use this information to carry out the Euler’s approximation in multiple steps.

Krista King Math.jpg

Hi! I'm krista.

I create online courses to help you rock your math class. Read more.

 

The better approximation you want, the more steps you have to take. The only formula you’ll need to remember is

y1=y0+[f(t0,y0)]Δty_1=y_0+[f(t_0,y_0)]\Delta t

In this formula, y1y_1 represents the first yy value you’ll need to calculate. y0y_0 and t0t_0 are the values you’re given in the initial condition, and Δt\Delta t is the distance between values of tt.

Note that the values of tt and yy given in the initial condition are denoted by t0t_0 and y0y_0. This does not necessarily mean that t=0t=0 or that y=0y=0. This only means that these values of tt and yy were given in the original problem.

Each subsequent approximation of yy is denoted by y1y_1, y2y_2, y3y_3, ... yny_n and each value of tt for which yy is estimated is denoted by t1t_1, t2t_2, t3t_3, ... tnt_n. The “step-size” or the distance between two successive values of tt at which yy is approximated is often denoted by hh or Δt\Delta{t}.

 
 

Making a table to approximate the solution in steps


 
Krista King Math Signup.png
 
Differential Equations course.png

Take the course

Want to learn more about Differential Equations? I have a step-by-step course for that. :)

 
 

 
 

Using Euler’s method with two steps to find the solution to the differential equation

Example

Use Euler’s Method and two steps, find y(1)y(1) if y=yty'=y-t and y(0)=2y(0)=2.

To find step size, divide the change in tt (from 00 to 11; y(0)y(0) to y(1)y(1)) by the number of steps, in our case, two.

102=12=0.5=Δt\frac{1-0}{2}=\frac12=0.5=\Delta t

Now we can start building our table. t0t_0 and y0y_0 both come from our initial condition, y(0)=2y(0)=2. To find t1t_1 and t2t_2, we add Δt\Delta t to the previous value for tt. We do that until we reach tn=1t_n=1, which is the value the problem originally asked for when it asked us to find y(1)y(1).

Euler's method table

We find y1y_1 and y2y_2 using the Euler’s Method equation mentioned at the beginning of this section. To calculate y1y_1, we plug in the values of t0t_0 and y0y_0. To calculate y2y_2, we plug in the values of t1t_1 and y1y_1, and so on. In other words, looking at the table above, use the values from the row above the value you’re trying to calculate.

y(1)=4.25y(1)=4.25


We’ll look at one more example of a problem worded slightly differently.

One thing you MUST remember whenever you’re using Euler’s Method, is to keep ALL of your decimal places until you get to the last value of yy, and you’ve found your final answer. Remember that Euler’s Method is about approximation, so if you start rounding off decimal places prior to the end of the problem, your approximation will get less and less accurate as you go. Therefore, if your calculator gives you twelve decimal places, write down every single one until you get your final answer. THEN, and ONLY then, can you round your answer.


Euler's method for Differential Equations.jpg

One thing you MUST remember whenever you’re using Euler’s Method, is to keep ALL of your decimal places until you get to the last value of Y.

Example

Use Euler’s Method with step size 0.50.5 to approximate the values y1y_1, y2y_2, y3y_3 and y4y_4 of y=y2ty'=y-2t when y(3)=0y(3)=0.

Since we’re given step-size directly, we already know that

Δt=0.5\Delta t=0.5

To start building our table, we first plug in t0t_0 and y0y_0 from our initial condition, y(3)=0y(3)=0. Since we’re calculating all the way to y4y_4, we start adding Δt=0.5\Delta t=0.5 to t0t_0 until we reach t4t_4.

euler's table with 5 steps

Once we’ve built out the first column, we start to calculate y1y_1 using the Euler’s Method equation mentioned at the beginning of this section. To calculate y1y_1, we’ll plug in the values of t0t_0 and y0y_0. To calculate y2y_2, we plug in the values of t1t_1 and y1y_1, and so on. In other words, looking at the table above, use the values from the row above the yy-value you’re trying to calculate. We continue this method until we’ve found all values of yy through y4y_4.

 
Krista King.png
 

Get access to the complete Differential Equations course