Euler’s Method

Differential Equations 3 – Euler’s Method

Since not all differential equation initial values problems (IVP) can be solved, it is often necessary to approximate the solution. There are several ways of doing this. The one that AP students are required to know is Euler’s Method.

The idea behind Euler’s Method is to first write the equation of the line tangent to the solution at the initial condition point. To find the approximate value of the solution near the initial condition, then take short steps from the initial point to the point with the x-value you need.

Since you have the initial point and the differential equation will give you the slope, it is easy to write the equation of the tangent line. You then approximate the point on the solution by using the point on this line a short distance (called the step-size or \Delta x) from the initial point. The first step is exactly the local linear approximation idea.

Next, you write the equation of another line through the approximated point using the differential equation to give you the slope at the approximated point (i.e. not the point on the curve which you do not know). This gives you a second (approximate) point.

Then you repeat the process (called iteration) until you get to the x-value you need.

The equations look like this:

x_{n}={{x}_{n-1}}+\Delta x

{{y}_{n}}={{y}_{n-1}}+{f}'({{x}_{n-1}},{{y}_{n-1}})\Delta x

The first equation says that the x-values increase by the same amount each time. \Delta x may be negative if the required value is at an x-value to the left of the initial point.

The second equation gives the y-value of a point on the line through the previous point where the slope, {f}'({{x}_{n-1}},{{y}_{n-1}}), is found by substituting the coordinates of the previous point into the differential equation. It has the form of the equation of a line.

Example: Let f be the solution of the differential equation \displaystyle \frac{dy}{dx}=3x-2y with the initial point (1, 3). Approximate the value of f(2) using Euler’s method with two steps of equal size.

Solution: At the initial point \displaystyle \frac{dy}{dx}=3(1)-2(3)=-3. Then

{{x}_{1}}=1.5 and {{y}_{1}}=2+(3(1)-2(3))(0.5)=0.5

Now using the point (1.5, 0.5) where \displaystyle \frac{dy}{dx}=3(1.5)-2(0.5)=3.5

{{x}_{2}}=2 and {{y}_{2}}=0.5+(3.5)(0.5)=2.25

Therefore, \left( 2 \right)\approx 2.25. The exact value is 2.5545. A better approximation could be found using smaller steps.

Some textbooks and some teachers make tables to organize this procedure. This is fine, but not necessary on the AP exams. Showing the computations as above will earn the credit. It is easy to remember: you are just writing the equation of a line.

There are calculator programs available on-line that will compute successive iterations of Euler’s method and others that will compute and graph the values so you can examine the approximate solution graph. Of course in real situations computers using this or more advanced techniques can produce approximate numerical solutions to initial value problems.

Here is a graphical look at what Euler’s Method does. Consider this easy IVP: \displaystyle \frac{dy}{dx}={{e}^{x}} with the initial condition y\left( 0 \right)=1. The screen is two units wide extending from x = 0 to x = 2.  The calculator graph below shows three graphs. The top graph is the particular solution y={{e}^{x}}. (I said it was easy.) The lower graph shows an approximate solution with the rather large step size of \Delta x=1 with the two points connected; look closely and you will see the two segments. The middle graph has a step size of \Delta x=0.25. There are 8 segments, but they appear to be a smooth curve approximating the solution. Notice it is closer to the actual solution graph. An even smaller step size would show an even smoother graph closer to the particular solution.Euler

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.