Welcome to a lesson
on the improved Euler's method
for approximating the solution
to an initial value problem.
Consider dy, dx equals f of x,y
with y of x sub zero equals y sub zero
and a step size of h.
There's a way to improve Euler's method
by doing an extra step.
Instead of using the slope
at X sub n minus one,
Y sub n minus one
to determine Y sub n,
we compute these slopes
at X sub n minus one,
Y sun n minus one
and X sub n, Y sub n.
And then we use the average of the slopes
to determine Y sub n.
Note that we need
to use the original Euler's formula
to determine Y sub n,
the Y coordinate of the second point
which have indicated using Y sub n star.
I'm using a Y sub n star here
to not confuse this with Y sub n
using the improved Euler's method formula.
Looking at our notes below,
x sub n is equal
to x sub n minus one, plus h,
and then y sub n using the improved Euler's method
is equal to y sub n minus one, plus h,
times the average of the slopes
at X sub n minus one,
Y sub n minus one
and X sub n, Y sub n star.
And again, to determine Y sub n star,
we need to use divisional Euler's method formula
which is Y sub n star
equals Y sub n minus one, plus h,
times f of X sub n minus one,
Y sub n minus one.
Let's take a look at an example.
We are given dy, dx equals x plus y
with y of zero equals one.
Notice in this case,
f of x,y is equal to x, plus y.
Rest they use the improved Euler's method
with h equals one fourth or 0.25
to approximate y of one.
To begin, since y of zero equals one,
we know x sub zero equals zero
and y sub zero equals one.
And now, let's work on determining x sub one
and y sub one.
X sub one is equal to x sub zero, plus h,
which is zero, plus 0.25,
x sub one equals 0.25.
And now, using the improved Euler's method formula
for y sub n,
y sub one is equal
to y sub zero, plus h,
which is 0.25,
times the average of the slopes
at the points x sub zero, y sub zero
and x sub one, Y sub one star.
Before we go any further,
we need to determine Y sub one star
using the original Euler's method formula
for Y sub n,
which, again, below is identified
as Y sub n star.
Y sub one star is equal
to y sub zero, plus h,
times f of x sub zero, y sub zero.
And we have all these values:
Y sub one star equals one, plus 0.25,
times f of zero, one.
And since f of x, y
is equal to x, plus y,
notice f of zero, one is just one.
Simplifying, we have Y sub one star equals 1.25.
And now, we can find y sub one
using the improved Euler's method formula.
Looking at this one closely,
notice y sub zero is one,
h is 0.25,
x sub zero is zero,
y sub zero is one,
x sub one is 0.25,
and Y sub one star is 1.25.
From here, to find these function values,
again, we sum x and y,
f of zero, one is one,
f of 0.25, 1.25 is 1.5.
Simplifying, we have y sub one equals 1.3125.
And now, we can work on determining x sub two
and y sub two.
X sub two is equal to x sub one, plus h,
giving us x sub two equals 0.50
or just 0.5.
Using the improved Euler's method formula
for y sub two,
we have y sub two equals y sub one, plus 0.25,
times the average of the slopes
at the points x sub one, y sub one
and x sub two, Y sub two star.
And now, we determine Y sub two star.
Y sub two star is equal
to y sub one, plus h,
times f of x sub one, y sub one
where we know y sub one is 1.3125,
h is 0.25,
x sub one is 0.25,
and Y sub one, again, is 1.3125.
I've shown the function value below.
Simplifying, we have Y sub two star equals 1.7031.
And now, we can determine y sub two
using the improved Euler's method formula.
You may want to pause the video
and check all these values.
But again, y sub one is 1.3125,
h is 0.25,
x sub one is 0.25,
y sub one, again, is 1.3125,
x sub two is 0.5,
and Y sub two star is 1.7031.
Determining the function values and simplifying,
we have y sub two equals 1.7832.
Now that we have x sub two
and y sub two,
we can determine x sub three
and y sub three.
X sub three is equal
to x sub two, plus h,
x sub three equals at 0.75.
Using the improved Euler's method formula
for y sub three,
y sub three equals y sub two, plus 0.25,
times the average of the slopes
at the points x sub two, y sub two
and x sub three, Y sub three star.
Before we can go any further,
we need to determine Y sub three star.
Y sub three star equals y sub two, plus h,
times f of x sub two, y sub two.
Subbing in all the known values and simplifying,
we have Y sub three star equals 2.3540.
And now, we can determine y sub three
using the improved Euler's method formula.
Subbing in all the values,
determining the function values and simplifying,
we have y sub three equals 2.4566.
Notice x of four is going to equal one.
And since we're trying to approximate y of one,
we only have one more iteration
to make our approximation of y of one.
X sub four is equal
to x sub three, plus h,
which gives us x sub four equals one.
Using the improved Euler's method formula
for y sub four,
Y sub four equals y sub three, plus 0.25,
times the average of the slopes
at x sub three, y sub three
and x sub four, Y sub four star.
The next step is to determine Y sub four star.
Y sub four star equals y sub three, plus h,
times f of x sub three, y sub three.
Again, subbing in all the values,
determining the function value
and then simplifying,
we have Y sub four star equals 3.2583.
And now, we can determine Y sub four
using the improved Euler's method formula.
Subbing in the values,
determining the function values
and then simplifying,
we have y sub four equals 3.3897.
This is our approximation for y of one.
Before we go, let's compare this approximation
to the actual function value of y of one.
Again, our approximation for y of one is 3.3897.
The actual particular solution
to the initial value problem
is y of x equals 2e to the x,
minus x, minus one,
giving us y of one equals 2e minus two,
which is approximately 3.4366.
Notice how approximation is very close
to the actual function value.
If we take a look at the graph on the right,
the blue graph is the graph
of the particular solution
and the red graph would be the approximation
of the solution using the improved Euler's method.
I hope you found this helpful.