# What is Euler method?

Thus far, we have solved separable differential equations. If we were given a separable differential equation and an initial condition, we could find the solution. However, there are some differential equations where this technique will not work. There are other techniques for solving differential equations, but again they too sometimes fail. This is where Euler's Method is used. Euler's Method provides us with an approximation for the solution of a differential equation. The idea behind Euler's Method is to use the concept of local linearity to join multiple small line segments so that they make up an approximation of the actual curve, as seen below.
 Example: The blue line shows the actual graph of a function. The green curve is an approximation using Euler's method. It is the collection of line segments as a result of Euler's Method. Each time Euler method is used another point is created and thus another line segment.
Note: -Generally, the approximation gets less accurate the further you are away from the initial value.

-Better accuracy is achieved when the points in the approximation are closer together.
AP Tip - Your approximation is going to be above the actual curve if the function is concave down and below the actual curve if the function is concave up .

## What are the three things needed in order to use Euler's method?

• Initial point- You must be given a starting point (x0,y0)
• $\Delta x$- You must be given the change in x or step size. You are either given the step size directly or given information to find it. For example, if you have to go from x=2 to x=2.6 using three equal step sizes. You know the step size is .2
*Remember- the smaller your $\Delta x$the better your approximation
• The differential equation – You have to know the slope of each individual line segment so that you can find $\Delta y$

## How to Use Euler's Method

Whenever you are given a problem that requires Euler's Method, create the chart below :
 $$(x,y)$$ $\Delta x \text{ or }dx$ $$\frac{dy}{dx}$$ $$dx (\frac{dy}{dx})=dy$$ $$(x+dx, y +dy)$$

## General Steps

### Step 1

The first 3 columns initial point, dx , and $(\frac{dy}{dx})$ are given to you in the problem. Just fill in that information

### Step 2

The $\Delta x$or dx remains the same for each iteration of Euler's method so you can actually fill the entire column with the same number.

### Step 3

Multiply column 2 $\Delta x$and column 3 $(\frac{dy}{dx})$to get column 4 (dy ) in the first row.

### Step 4

Add the dx to the initial x value (column 1 and 2), and add dy to the initial y value (column 1 and 4) to fill in the last column

### Step 5

Re-write the point in the last column in the first column of the second row and repeat steps 2 through 5 until you reach the desired x value.

# So how do we use this method to solve a specific problem?

Let's begin with a problem that we can do solve both separable differential equation and Euler's method. Normally, we would only resort to using Euler's method when the technique of separable differential equation is not an option or we are asked specifically to use Euler's method. For the first example, we will us both methods so that we can compare our answers..

## Example 1

Using separable equations technique
Given $\frac{dy}{dx} = 2(x-1)$and the point (1,0) is a point on the curve, find an equation in the form y = f(x) and use it to evaluate f(3).
\begin{align} & \int \frac{dx}{dy} = \int 2(x-1) \\ & y = (x-1)^2 + c \\ \end{align}
 using the point (1,0) $0 = (1 - 1)^2 + C \text{ so C = 0}$ Making the equation $y = (x-1)^2$ Using x = 3 $y = (3-1)^2 =4$ so when x = 3 , y = 4

## Example 1

Using Euler's Method
Given $\frac{dy}{dx}$= 2(x-1) and the point (1,0) is a point on the curve, find an equation in the form y = f(x) and use it to evaluate f(3).
If we are going from x =1 to x =3 using 5 steps that means the $\Delta x = \frac{3-1}{4} =\frac{2}{4} = .5$
 $(x,y)$ $\Delta x \text{ or }dx$ $\frac{dy}{dx}$ $dx (\frac{dy}{dx})=dy$ $(x+dx, y +dy)$ (1,0) .5 0 .5 .5 .5
Steps 3 and 4
 $(x,y)$ $\Delta x \text{ or }dx$ $\frac{dy}{dx}$ $dx (\frac{dy}{dx})=dy$ $(x+dx, y +dy)$ (1,0) .5 0 0 (1+.5,0+0) .5 .5 .5
Step 5
 $(x,y)$ $\Delta x \text{ or }dx$ $\frac{dy}{dx}$ $dx (\frac{dy}{dx})=dy$ $(x+dx, y +dy)$ (1,0) .5 0 0 (1+.5,0+0) (1.5,0) .5 .5 .5
Repeat
 $(x,y)$ $\Delta x \text{ or }dx$ $\frac{dy}{dx}$ $dx (\frac{dy}{dx})=dy$ $(x+dx, y +dy)$ (1,0) .5 0 0 (1.5,0+0) (1.5,0) .5 1 .5 (2, .5) (2, .5) .5 .5
Repeat Again
 $(x,y)$ $\Delta x \text{ or }dx$ $$\frac{dy}{dx}$$ $$dx (\frac{dy}{dx})=dy$$ $$(x+dx, y +dy)$$ (1,0) .5 0 0 (1.5,0) (1.5,0) .5 1 .5 (2 , .5) (2, .5) .5 2 2* .51 (2+.5, 1+.5) (2.5,1.5) (2.5,1.5) .5 3 3 *.5 1.5 (2.5+.5,1.5+1.5) (3,3)
 The Red Curve - shows the actual solution from the differential equation. y = (x -1)2 and f(3) = 4 The Line Segments below the curve show the solution from Euler's Method. Line 1 connects (1,0) and (1.5,0) Line 2 connects (1.5,0) and (2,.5) Line 3 connects (2,.5) and (2.5,1.5) Line 4 connects (2.5,1.5) and (3,3) Here f(3) = 3 Again since the curve is concave up, our solution from Euler's method is less than the actual function. (Mouse over/click to enlarge image)

Also, we can see the further we get form the initial point (1,0), the less accurate our approximation is. The lines with the arrow indicate the difference.
 How to Use the TI-89
 Mode- Graph should be differential equation Select y=, you will see: t0 = (place initial x value here) y1' = (differential equation goes here) yi1 = ( initial y value goes here) Note: When using the differential equation mode make sure you use  y1 for y and t for x. Now, while in the "y=" screen press the diamond and Change solution method to "Euler" and Fields to "SLPFLD" Now select "window and change the step to the desired step size. Adjust the rest of the new window accordingly. (Disregard the last 3 options) The graph will now show the slope field and Euler Approximation. To check your solution, hit F3 and enter the desired x-value , the lower right corner will display the corresponding y-value.