TAYLOR SERIES

TAYLOR SERIES

Consider the one dimensional initial value problem

y’ = f(x, y),   y(x0) = y0where
is a function of two variables x and and (x0 , y0) is a known point on the solution curve.

If the existence of all higher order partial derivatives is assumed for y at x = x0, then by Taylor series the value of y at any neibhouring point x+h can be written as

y(x0+h) = y(x0) + h y'(x0) + h2 /2 y”(x0) + h3/3! y”'(x0) +  .  .  .  .  .  .

where ‘ represents the derivative with respect to x.  Since at x0y0 is known,  y’ at xcan be found by computing f(x0,y0).  Similarly higher derivatives of y at x0 also can be computed by making use of the relation  y’  = f(x,y) 

      y”  = fx + fyy’
      y”’ = fxx + 2fxyy’ + fyy y’fyy”
and so on.   Then

y(x0+h) = y(x0) + h f + h ( fx + fyy’ ) / 2! + h3 ( fxx + 2fxyy’ + fyy y’fyy” ) / 3! + o(h4)

Hence the value of   at any neighboring point  x0+ 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 thepthderivative 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 [x0, xn] in a marching process.

ALGORITHM

Specify    x0, xn, y0, h
(x0, y0Initial point,
                                   xn point where the solution is required
h  the step length to be used in the marching process )
Repeat
compute f(xi, yi),  f'(xi, yi),  f”(xi, yi)  . . .
                compute y(xi+h) = y(xi) + h f(xi, yi) + h/2 f'(xi, yi) + h3/3! f”(xi, yi) + . . .
                   xi = x+ h
until xi = xn

Error in the approximation : The Taylor series method of order p has the property that the final global error is of order o(hp+1); hence p can be chosen as large as necessary to make the error is as small as desired.  If the order is fixed, it is theoretically possible to a priority determine the size of h so that the final global error will be as small as desired.  Since

Making use of finite differences, the p+1th derivative of y at x+q h can be approximated as
However, in practice one usually computes two sets of approximations using step sizes h and h/2 and compares the solutions
For p = 4E= c * h4 and the same with step size h/2,   E= c * (h/2)4, that is if the step size is halved the error is reduced by an order of 1/16.