Euler’s Method
What Is Euler’s Method?
In AP Calculus BC, you study differential equations in the form:
$$\frac{dy}{dx}=f(x,y)$$
Euler’s Method provides a numerical way to approximate the solution curve.
It gives approximate values of y at points along the curve by using the slope at each point.
The Idea Behind Euler’s Method
You start at an initial point:
$$(x_{0},y_{0})$$
The differential equation tells you the slope of the curve at any point:
$$\frac{dy}{dx}=f(x,y)$$
We use this slope to take a small step forward:
$$x_{1}=x_{0}+h$$
$$y_{1}\approxy_{0}+h\cdot f(x_{0},y_{0})$$
This approximates the next point on the curve.
Repeat over and over to generate a sequence of points.
Euler’s Method Formula
Let step size be h.
The rule is:
$$y_{n+1}=y_{n}+h\cdot f(x_{n},y_{n})$$
and
$$x_{n+1}=x_{n}+h$$
Why It Works
-
A derivative gives slope:$$\frac{dy}{dx}=slope$$
-
Slope × small change in x gives approximate change in y
$$\delta{y}=f(x_{n},y_{n})\cdot{h}$$
Euler’s Method is basically using many tiny line segments to trace the curve.
The smaller the step size , the more accurate the approximation.
Example Problem
Use Euler’s method with step size h=0.1 to approximate:
$$\frac{dy}{dx}=x+y , y(0)=1$$
Find y(0.1) and y(0.2).
Step 1: Start with initial conditions
$$x_{0}=0 , y_{0}=1$$
Step 2: Apply Euler’s Method Formula
$$y_{n+1}=y_{n}+h\cdot f(x_{n},y_{n})$$
First Step (to x=0.1):
$$x_{0}=0$$ and $$h(step size)=0.1 \longrightarrow x_{1}=0+0.1=0.1 , f(x_{0},y_{0})=0+1=1$$ then
$$y_{1}=y_{0}+x_{1}\cdot{f(x){0},y_{0})}=1+(0.1)(1)=1.1$$
and next step (to x=0.2):
Compute the slope at the new point:
$$x_{1}=0.1$$ and $$h(step size)=0.1 \longrightarrow x_{2}=0.1+0.1=0.2 , f(x_{1},y_{1})=0.1+1.1=1.2$$ then
$$y_{2}=y_{1}+x_{2}\cdot{f(x){1},y_{1})}=1.1+(0.2)(1.2)=1.22$$