"); hg.document.close(); } function ptip(){ hg=window.open('','','toolbar=no,width=400,height=100,top=0,left=0'); hg.document.open(); hg.document.writeln(""); hg.document.writeln("Positive definite"); hg.document.close(); } function sclose(){ hg.window.close(); }  
Example 1:
Solve the initial value problem y' = -2xy2,  y(0) = 1 for y at x = 1 with step lengh .2 using Taylor series method of order four.

Solution:
Given y' = f(x,y) = -2xy2 Þ y''   = -2y2 - 4xyy'
                                            y''' = -8yy' - 4xy'2 - 4xyy'' 
                                           yiv  = -12y'2 - 12yy'' - 12xy'y'' - 4xyy'''
                                           yv   = -48y'y'' - 16yy''' -12xy''2 - 16xy'y''' - 4xyyiv

The forth order Taylor's formula is

y(xi+h) = y(xi) + h y'(xi, yi) + h y''(xi, yi)/2! + h3 y'''(xi, yi)/3! + h4 yiv(xi, yi)/4! + . . .

given at x=0, y=1 and with h = .2 we have

y'   = -2(0)(1)2 = 0.0
y''  = -2(1)2 - 4(0)(1)(0) = -2
y''' = -8(1)(0) - 4(0)(0)2 - 4(0)(1)(-2) = 0.0
yiv  = -12(0)2 - 12(1)(-2) - 12(0)(0)(-2) - 4(0)(1)(0) = 24

y(0.2) = 1 + .2 (0) + .22 (-2)/2! + 0 + .24 (24)/4!  = .9615

now at x = .2 we have y = .9615

y' = -0.3699,  y'' = -1.5648,  y''' =  3.9397 and  yiv  =  11.9953

then y(0.4) = 1 + .2 (-.3699) + .22 (-1.5648)/2! + .23(3.9397)/3! + .24 (11.9953)/4!  =  0.8624
       y(0.6) = 1 + .2 (-.5950) + .22 (-0.6665)/2! + .23 (4.4579)/3! + .24 (-5.4051)/4!   =  0.7356
       y(0.8) = 1 + .2 (-.6494) + .22 (-0.0642)/2! + .23 (2.6963)/3! + .24 (-10.0879)/4! =  0.6100
       y(1.0) = 1 + .2 (-.5953) + .22 (-0.4178)/2! + .23 (0.9553)/3! + .24 (-6.7878)/4!   =  0.5001

now at x = 1.0 we have y = .5001
y' = -0.5001,  y'' = 0.5004,  y''' =  -.000525 and  yiv  =  -3.0005

Error in the approximation

E4 = h4 (y4(1.0) - y4(0.8))/ 5! = h4 (-3.0005-11.9953)/ 5! = -1.9994e-004

Analytical solution y(x) = 1/(1+x2) at x = 1, y = .5

Alternate method:

By Taylor series method
y(x0 + x - x0) = y0 + (x-x0)y'(x0) + (x-x0)2y''(x0)/2! + (x-x0)3y'''(x0)/3! + (x-x0)4yiv(x0)/4! + . . . 
Since x0 = y' = y''' = 0,  y = 1, y'' = -2 and yiv = 24 at x = 0, 
y( x ) = 1. -  x2 + x + . . .