Euler’s Method

Pollux Rey
5 min readDec 15, 2019

--

We may be used to finding solutions for first-order differential equations we encounter. Such methods being used are integrating factor method, variation of constants, and Laplace transform. But, when it is difficult to obtain, numerical methods come in handy. Today, we are going to learn about one of the easiest method to get approximate solutions to Initial Value Problems: Euler’s method.

Let us recall what Initial Value Problem is. This is an excerpt from the 4th edition of Differential Equations and Linear Algebra by Stephen W. Goode and Scott A. Annin.

An nth-order differential equation together with n auxiliary conditions of the form y(x_{0}) = y_{0}, y’(x_{0}) = y_{1}, …, y_{n-1}(x_{0}) = y_{n-1},
where y_{0}, y_{1}, …, y_{n-1} are constants, is called an initial-value problem.

So, for the first-order differential equations, only the initial value problem is of the form

To understand IVP a little bit better, let us solve the following problem.

The quick solution for it is as follows:

Euler’s Method

Let us derive Euler’s Method by graphical method.

Suppose that the exact solution for the IVP is known, say,

from

The graph for the solution is

The method works by using the tangent line to the curve at the initial condition y(x_{0})=y_{0}, for this case, y(0)=1/2. The equation of this tangent line at y(x_{0})=y_{0} is

where m is the slope of the curve at (x_{0}, y_{0}). Then, we substitute m with f(x_{0},y_{0}) since m=dy/dx and, as we said earlier, dy/dx=f(x,y). So,

Let’s add another point (x_{1},y_{1}) along the tangent line produced using the initial condition. Let’s pretend that we don’t know what the value of y_{1} is. To get it, we substitute x with x_{1} and y with y_{1} from the recent equation. We then get the following,

Let x_{1} - x_{0} = h and is called step size. So,

If we now wish to get an approximate solution to the IVP at x_{2}, we use the same idea but this time we use the the tangent line to the curve at (x_{1},y_{1}). Repeat until you get through your desired number of points. The following figure will help you visualize Euler’s method. The figure is from Goode’s textbook, as well.

Figure 1. Euler’s method for approximating the solution to the initial-value problem

This summary might help you in generating more solutions, this is from Alan Jeffrey’s book, Advance Engineering Mathematics:

The Euler algorithm
The approximate numerical solution of the initial value problem generated by the Euler method with step size h is obtained from the algorithm

where x_{n} = x_{0} + nh.

Example

For Problems 1–5, use Euler’s method with the specified step size to determine the solution to the given initial-value problem at the specified point.
1. y′ = 4y−1, y(0) = 1, h = 0.05, y(0.5).
2. y’ = (-2xy) / (1 + x²), y(0) = 1, h = 0.1, y(1).
3. y’ = x — y², y(0) = 2, h = 0.05, y(0.5).
4. y′ = −(x²)y, y(0) = 1, h = 0.2, y(1).
5. y′ = 2x(y²), y(0) = 0.5, h = 0.1, y(1).

The solution for these problems are

The plot of points and some of the solutions/curve to the FODEs can be found here.

How big must h be?

The range of the possible values of h depends on the FODE. This range must make the solution to the FODE stable. Also, take note that the larger the step size is, the more prone it is to errors.

Are there any other numerical methods for solving FODEs?

Yes. In fact, Euler’s method is the simplest among the other techniques, yet, inefficient. The other methods you can use are Heun’s Method and Fourth Order Runge-Kutta Method, whichgive you more accurate results. I will leave it up to you to study these.

References

Differential Equations and Linear Algebra by Stephen W. Goode and Scott A. Annin

Advance Engineering Mathematics by Alan Jeffrey

--

--