Euler's Method Euler's Method

Introduction

Euler's method approximates solution functions for differential equations.

It is done by taking small steps along the function, using its slope at each step to draw the next one.

This is the formula:

y(x + \Delta x) = y(x) + \Delta x \cdot \frac{dy}{dx}(x, y(x))
In other words:
Take
(x,y)

Add the step value to
x

Add the product of the step and the slope to
y
.


Here is an example of Euler's method:
Each line is a step along the function.
Each step's slope is the slope of the function at its starting point.


Click the graph to see the slope field.


Here is an example using
\frac{dy}{dx}=x+y
with a solution function starting at
y(0)=1
and a step size of
h=0.1
:
\begin{align*} y(0) &= 1 \\ \text{} \\ y(x + \Delta x) &= y(x) + \Delta x \cdot \frac{dy}{dx}(x, y(x)) \\ \text{} \\ y(0 + 0.1) &= y(0) + 0.1 \cdot \frac{dy}{dx}(0, y(0)) \\ \text{} \\ y(0.1) &= 1 + 0.1 \cdot \frac{dy}{dx}(0, 1) \\ \text{} \\ y(0.1) &= 1 + 0.1 \cdot (0 + 1) \\ \text{} \\ y(0.1) &= 1.1 \\ \text{} \\ \end{align*}
This continues along the equation
\begin{align*} y(0.1) &= 1.00 + 0.1 \cdot \frac{dy}{dx}(0.0, 1.00) = 1.10 \\ \text{} \\ y(0.2) &= 1.10 + 0.1 \cdot \frac{dy}{dx}(0.1, 1.10) = 1.22 \\ \text{} \\ y(0.3) &= 1.22 + 0.1 \cdot \frac{dy}{dx}(0.2, 1.22) = 1.36 \\ \text{} \\ y(0.4) &= 1.36 + 0.1 \cdot \frac{dy}{dx}(0.3, 1.36) = 1.53 \\ \text{} \\ y(0.5) &= 1.53 + 0.1 \cdot \frac{dy}{dx}(0.4, 1.53) = 1.72 \\ \text{} \\ y(0.6) &= 1.72 + 0.1 \cdot \frac{dy}{dx}(0.5, 1.72) = 1.94 \\ \text{} \\ y(0.7) &= 1.94 + 0.1 \cdot \frac{dy}{dx}(0.6, 1.94) = 2.20 \\ \text{} \\ y(0.8) &= 2.20 + 0.1 \cdot \frac{dy}{dx}(0.7, 2.20) = 2.48 \\ \text{} \\ y(0.9) &= 2.48 + 0.1 \cdot \frac{dy}{dx}(0.8, 2.48) = 2.82 \\ \text{} \\ y(1.0) &= 2.82 + 0.1 \cdot \frac{dy}{dx}(0.9, 2.82) = 3.19 \\ \text{} \\ \end{align*}
Below is a graph of our euler method approximations of the solution function.

Click the graph to see the solution function.