8.4
Section |
2 Background .1
Cosmology .11 Math |
Section 8.6 |

Section 5 **Euler's Method**

The preceding sections have dealt with approximate analytic methods of solution of **Cauchy's
Problem**. **Euler's Method**
is one of the numerical methods which present solutions in the form of tables of approximate values.

Consider the differential equation

(5.1)

for the initial condition

(5.2)

Having chosen a sufficiently small interval *h*, construct a system of equally spaced points
*x*_{i} = *x*_{0} + *ih*, *i* =0, 1, 2, . ..**Euler's
method** computes approximate values of *y*(x_{i}) ?
*y*_{i}, one after another, by means of the formula

(5.3)

The required integral curve *y = y*(*x*) which passes through the point *M*_{0}*
*is replaced by the polygonal line *M*_{0}*M*_{1}*M*_{2} ??? with the vertices
*M*_{i}(*x*_{i},*y*_{i}), *i* = 0, 1, 2, . . ..
Each segment *M*_{i}*M*_{i+1} of this line has the direction of the integral curve
of Equation (5.1) which passes through the point *M*_{i}.

If the right-hand side of Equation (5.1) satisfies in some rectangle *R*{|*x - x*_{0}|
? *a, *|*y - y*_{0}| ?
*b,*} the conditions

(5.4)/(5.5)

then one has the error estimate:

(5.6)

where *y*(*x*_{n}) is the value of the exact solution of the
equation at *x* = *x*_{0} and *y*_{n} is the approximate value obtained at the *n*-th
step.

Formula (5.5) has only theoretical significance. For practical purposes, it turns out at times to
be more convenient to use** two steps**, i.e., to repeat
the calculation with spacings *h*/2, when the error estimate at *h* has the more accurate value

(5.7)

where *y**_{n}* *is the value obtained with two steps of* *length*
h*/2.

**Euler's Method** is readily applied to **systems
of differential equations** as well as to **differential
equations of higher order**, which, however, must first be reduced to **systems
of first order differential equations** (cf. Example 2).

Consider the system of the two first order equations

(5.8)

for the initial conditions *y*(*x*_{0}) = *y*_{0} and *z*(*x*_{0})
= *z*_{0}. The approximate values *y*(*x*_{i}) ~ *y*_{i} and *z*(*x*_{i})
~* z*_{i} are computed successively using the formulae

(5.9)

**Example 1:** Use Euler's method with *h*
= 0.2 to construct for the interval [0, 1] a table of values of the solution of the equation

for the initial condition *y*(0) =1.

**Solution:** The results of the computations
are given in the following table:

The initial values *x*_{0} = 0, *y*_{0} = 1.0000 for *i* = 0
in the first row yield *f*(*x*_{0},*y*_{0}) = 1, and then *hf(x*_{0}*,y*_{0})
= 0.2. Next, (4.4) yields for *i = *0

Using these values, the second row yields *f(x*_{1}*,y*_{1}) =0.8667
and *hf(x*_{1}*,y*_{1})* = *0.1733. Thus

The computations for i = 2,3,4,5 are carried out in the same manner. In order to allow a
comparison, the last column of the table presents the values of the exact solution *y = *(2*x + *1)^{? }and
hence shows that the absolute error is 0.0917, i.e. the **relative
error** is 5% per cent.

**Example 2:** Compute
with *h* = 0.1 for the interval [1,1.5] by **Euler's method**
a table of approximate values of the solution of the equation

(4.11)

for the initial conditions *y*_{1}(1) = 0.77, *y*_{1}'(1) = -0.44.

**Solution:** With the aid of the substitutions *y*'
= *z*, *y*" = z' transform the second order equation into the system of first order equations

with the initial conditions *y*(1) = 0.77, *z*(1) = -0.44, so that *f*_{l}(*x*,*y*,*z*)
= *z*, *f*_{2}(*x*,*y*,*z*) = -*y *- *z*/*y*. The results of the
computations using (5.9) are given in the next table in which one additional digit has been retained:

Here, in the first row *i* = 0, *x*_{0} = 1.0, *y*_{0} = 0.77,
*z*_{0 }= -0.44, whence

Equations (5.9) now yield

Hence follow the entries in the second row *i* =1, *x*_{1} = 1.1, *y*_{1}
= 0.726, *z*_{1} = -0.473 with

and

The entries for *i*=2, 3, 4, 5 are obtained in the same manner.

**Exercises**

Use **Euler's Method** to
obtain approximate solutions of the following differential equations and systems of differential equations for the given initial
conditions on the interval [*a*,*b*] with the step length *h *=0.1 for the given parameters.