Taylor's Series method
Consider the one dimensional initial value problem
y' = f(x, y), y(x_{0})
= y_{0}
where
f is a function of two variables x
and y and (x_{0} , y_{0}) is a known point
on the solution curve.
If the existence of all higher order partial derivatives
is assumed for y at x = x_{0}, then by Taylor series
the value of y at any neibhouring point x+h can be written
as
y(x_{0}+h) = y(x_{0}) + h y'(x_{0})
+ h^{2} /2 y''(x_{0}) + h^{3}/3! y'''(x_{0})
+ . . . . . .
where ' represents the derivative
with respect to x. Since at x_{0}, y_{0}
is known, y' at x_{0 }can
be found by computing f(x_{0},y_{0}). Similarly
higher derivatives of y at x_{0} also can be computed
by making use of the relation y' = f(x,y)
y'' =
f_{x} + f_{y}y'
y''' = f_{xx}
+ 2f_{xy}y' + f_{yy} y'^{2 }+ f_{y}y''
and so on. Then
y(x_{0}+h) = y(x_{0}) + h f
+ h^{2 } ( f_{x} + f_{y}y'
)
/ 2! + h^{3} ( f_{xx} + 2f_{xy}y'
+ f_{yy} y'^{2 }+ f_{y}y''
)
/ 3! + o(h^{4})
Hence the value of y at any
neighboring point x_{0}+ h can be obtained by
summing the above infinite series. However, in
any practical computation, the summation has to be terminated after some
finite number of terms. If the series has been terminated after the
p^{th}derivative
term then the approximated formula is called the Taylor series approximation
to y of order p and the error is of order p+1.
The same can be repeated to obtain
y at other points of x
in the interval [x_{0}, x_{n}] in a marching process.
Algorithm
Specify x_{0}, x_{n},
y_{0}, h
( (x_{0}, y_{0}) Initial point,
x_{n} point where the solution
is required
h the step length to be used in the marching process )
Repeat
compute f(x_{i},
y_{i}), f'(x_{i}, y_{i}), f''(x_{i},
y_{i}) . . .
compute y(x_{i}+h)
= y(x_{i}) + h f(x_{i}, y_{i}) + h^{2 }/2
f'(x_{i}, y_{i}) + h^{3}/3! f''(x_{i},
y_{i}) + . . .
x_{i} = x_{i
}+
h
until x_{i} = x_{n} 
Error in the approximation : The Taylor series method of order
p
has the property that the final global error is of order o(h^{p+1});
hence
p
can be chosen as large as necessary to make the error is as small as desired.
If the order p is fixed, it is theoretically possible to a priori
determine the size of h so that the final global error will be as
small as desired. Since
E_{p} = 
1 
h^{p+1 }y^{p+1}(x+qh) 
0 < q < 1 
(p+1)! 
Making use of finite differences, the p+1^{th} derivative
of y at x+qh can be approximated
as
E_{p} =

h^{p} (y^{p}(x+qh)
 y^{p}(x))

(p+1)!

However, in practice one usually computes two sets of approximations
using step sizes h and h/2 and compares the solutions
For p = 4, E_{4 }= c * h^{4} and the
same with step size h/2, E_{4 }= c * (h/2)^{4},
that is if the step size is halved the error is reduced by an order of
1/16.
Worked
out problems
Example 1 
Solve the initial value problem y' = 2xy^{2}, y(0)
= 1 for y at x = 1 with step length 0.2 using Taylor series method of order
four. 
Solution 
Example 2 
Using Taylor series method of order four solve the initial value
problem y' = (x  y)/2, on [0, 3] with y(0) = 1. Compare solutions
for h = 1, 1/2, 1/4 and 1/8. 
Solution 
Example 3 
Using Taylor series method, find y(0.1) for y' = x  y^{2}
, y(0) = 1 correct upto four decimal places. 
Solution 
Example 4 
Find y at x = 1.1 and 1.2 by solving y' = x^{2} + y^{2}
, y(1) = 2.3 
Solution 