"); 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 3:
Find y(0.1) for y' = x - y2,  y(0) = 1 correct upto four decimal places.

Solution:        f(x, y) = x - y2

Case(i)y' = (x - y)/2,  y(0) = 1.0 with h = 1/2

Given
y[0.0] = 1.0
 
Euler Solution:      y(1) = y(0) + h*((x-y)/2)(1)
y[0.50] = 0.75
Modified Euler iterations:y(1) = y(0) + .5*h*(((x-y)/2)(0) + ((x-y)/2)(1)
y[0.50] = 0.75   y[0.50] = 0.84375   y[0.50] = 0.83203125   y[0.50] = 0.83349609375   y[0.50] = 0.83331298828125   y[0.50] = 0.8333358764648438   
 
Euler Solution:      y(2) = y(1) + h*((x-y)/2)(2)
y[1.00] = 0.7499997615814209
Modified Euler iterations:y(2) = y(1) + .5*h*(((x-y)/2)(1) + ((x-y)/2)(2)
y[1.00] = 0.7499997615814209   y[1.00] = 0.8229164183139801   y[1.00] = 0.8138018362224102   y[1.00] = 0.8149411589838564   y[1.00] = 0.8147987436386757   y[1.00] = 0.8148165455568233   
 
Euler Solution:      y(3) = y(2) + h*((x-y)/2)(3)
y[1.50] = 0.8611107402377911
Modified Euler iterations:y(3) = y(2) + .5*h*(((x-y)/2)(2) + ((x-y)/2)(3)
y[1.50] = 0.8611107402377911   y[1.50] = 0.9178236877476991   y[1.50] = 0.9107345693089606   y[1.50] = 0.9116207091138029   y[1.50] = 0.9115099416381975   y[1.50] = 0.9115237875726483   
 
Euler Solution:      y(4) = y(3) + h*((x-y)/2)(4)
y[2.00] = 1.0586415426231315
Modified Euler iterations:y(4) = y(3) + .5*h*(((x-y)/2)(3) + ((x-y)/2)(4)
y[2.00] = 1.0586415426231315   y[2.00] = 1.1027516068990952   y[2.00] = 1.0972378488645997   y[2.00] = 1.0979270686189118   y[2.00] = 1.0978409161496228   y[2.00] = 1.0978516852082838   
 
Euler Solution:      y(5) = y(4) + h*((x-y)/2)(5)
y[2.50] = 1.3233877543069634
Modified Euler iterations:y(5) = y(4) + .5*h*(((x-y)/2)(4) + ((x-y)/2)(5)
y[2.50] = 1.3233877543069634   y[2.50] = 1.357695577403087   y[2.50] = 1.3534070995160716   y[2.50] = 1.3539431592519484   y[2.50] = 1.3538761517849638   
 
Euler Solution:      y(6) = y(5) + h*((x-y)/2)(6)
y[3.00] = 1.6404133957887526
Modified Euler iterations:y(6) = y(5) + .5*h*(((x-y)/2)(5) + ((x-y)/2)(6)
y[3.00] = 1.6404133957887526   y[3.00] = 1.6670972872799508   y[3.00] = 1.663761800843551   y[3.00] = 1.664178736648101   y[3.00] = 1.6641266196725322   

Case(ii)y' = (x - y)/2,  y(0) = 1.0 with h = 1/4

Given
y[0.0] = 1.0
 
Euler Solution:      y(1) = y(0) + h*((x-y)/2)(1)
y[0.250] = 0.875
Modified Euler iterations:y(1) = y(0) + .5*h*(((x-y)/2)(0) + ((x-y)/2)(1)
y[0.250] = 0.875   y[0.250] = 0.8984375   y[0.250] = 0.89697265625   y[0.250] = 0.897064208984375   
 
Euler Solution:      y(2) = y(1) + h*((x-y)/2)(2)
y[0.500] = 0.816176176071167
Modified Euler iterations:y(2) = y(1) + .5*h*(((x-y)/2)(1) + ((x-y)/2)(2)
y[0.500] = 0.816176176071167   y[0.500] = 0.8368563205003738   y[0.500] = 0.8355638114735484   y[0.500] = 0.835644593287725   
 
Euler Solution:      y(3) = y(2) + h*((x-y)/2)(3)
y[0.750] = 0.7936846013712966
Modified Euler iterations:y(3) = y(2) + .5*h*(((x-y)/2)(2) + ((x-y)/2)(3)
y[0.750] = 0.7936846013712966   y[0.750] = 0.8119317853121117   y[0.750] = 0.8107913363158108   y[0.750] = 0.8108626143780796   
 
Euler Solution:      y(4) = y(3) + h*((x-y)/2)(4)
y[1.000] = 0.8032508895617894
Modified Euler iterations:y(4) = y(3) + .5*h*(((x-y)/2)(3) + ((x-y)/2)(4)
y[1.000] = 0.8032508895617894   y[1.000] = 0.8193513439328768   y[1.000] = 0.8183450655346838   y[1.000] = 0.8184079579345709   
 
Euler Solution:      y(5) = y(4) + h*((x-y)/2)(5)
y[1.250] = 0.8411035237646307
Modified Euler iterations:y(5) = y(4) + .5*h*(((x-y)/2)(4) + ((x-y)/2)(5)
y[1.250] = 0.8411035237646307   y[1.250] = 0.8553098052268149   y[1.250] = 0.8544219126354284   y[1.250] = 0.8544774059223901   
 
Euler Solution:      y(6) = y(5) + h*((x-y)/2)(6)
y[1.500] = 0.9039146953929605
Modified Euler iterations:y(6) = y(5) + .5*h*(((x-y)/2)(5) + ((x-y)/2)(6)
y[1.500] = 0.9039146953929605   y[1.500] = 0.9164496480303976   y[1.500] = 0.9156662134905579   y[1.500] = 0.9157151781492978   
 
Euler Solution:      y(7) = y(6) + h*((x-y)/2)(7)
y[1.750] = 0.9887481031258607
Modified Euler iterations:y(7) = y(6) + .5*h*(((x-y)/2)(6) + ((x-y)/2)(7)
y[1.750] = 0.9887481031258607   y[1.750] = 0.9998083540466274   y[1.750] = 0.9991170883640794   y[1.750] = 0.9991602924692387   
 
Euler Solution:      y(8) = y(7) + h*((x-y)/2)(8)
y[2.000] = 1.093012893186083
Modified Euler iterations:y(8) = y(7) + .5*h*(((x-y)/2)(7) + ((x-y)/2)(8)
y[2.000] = 1.093012893186083   y[2.000] = 1.1027719368752444   y[2.000] = 1.1021619966446718   y[2.000] = 1.1022001179090826   
 
Euler Solution:      y(9) = y(8) + h*((x-y)/2)(9)
y[2.250] = 1.2144230184137998
Modified Euler iterations:y(9) = y(8) + .5*h*(((x-y)/2)(8) + ((x-y)/2)(9)
y[2.250] = 1.2144230184137998   y[2.250] = 1.223033938221066   y[2.250] = 1.2224957557331118   y[2.250] = 1.222529392138609   
 
Euler Solution:      y(10) = y(9) + h*((x-y)/2)(10)
y[2.500] = 1.3509613786303571
Modified Euler iterations:y(10) = y(9) + .5*h*(((x-y)/2)(9) + ((x-y)/2)(10)
y[2.500] = 1.3509613786303571   y[2.500] = 1.3585592480824138   y[2.500] = 1.3580843812416603   y[2.500] = 1.3581140604192075   
 
Euler Solution:      y(11) = y(10) + h*((x-y)/2)(11)
y[2.750] = 1.5008481797867843
Modified Euler iterations:y(11) = y(10) + .5*h*(((x-y)/2)(10) + ((x-y)/2)(11)
y[2.750] = 1.5008481797867843   y[2.750] = 1.5075521813920236   y[2.750] = 1.5071331812916962   y[2.750] = 1.5071593687979665   
 
Euler Solution:      y(12) = y(11) + h*((x-y)/2)(12)
y[3.000] = 1.6625130155689716
Modified Euler iterations:y(12) = y(11) + .5*h*(((x-y)/2)(11) + ((x-y)/2)(12)
y[3.000] = 1.6625130155689716   y[3.000] = 1.6684283103508373   y[3.000] = 1.6680586044269707   y[3.000] = 1.6680817110472124   

Case(iii)y' = (x - y)/2,  y(0) = 1.0 with h = 1/8

Given
y[0.0] = 1.0
 
Euler Solution:      y(1) = y(0) + h*((x-y)/2)(1)
y[0.1250] = 0.9375
Modified Euler iterations:y(1) = y(0) + .5*h*(((x-y)/2)(0) + ((x-y)/2)(1)
y[0.1250] = 0.9375   y[0.1250] = 0.943359375   y[0.1250] = 0.94317626953125   
 
Euler Solution:      y(2) = y(1) + h*((x-y)/2)(2)
y[0.2500] = 0.8920456171035767
Modified Euler iterations:y(2) = y(1) + .5*h*(((x-y)/2)(1) + ((x-y)/2)(2)
y[0.2500] = 0.8920456171035767   y[0.2500] = 0.8975498788058758   y[0.2500] = 0.8973778706276789   
 
Euler Solution:      y(3) = y(2) + h*((x-y)/2)(3)
y[0.3750] = 0.8569217930155446
Modified Euler iterations:y(3) = y(2) + .5*h*(((x-y)/2)(2) + ((x-y)/2)(3)
y[0.3750] = 0.8569217930155446   y[0.3750] = 0.8620924634176603   y[0.3750] = 0.8619308799675942   
 
Euler Solution:      y(4) = y(3) + h*((x-y)/2)(4)
y[0.5000] = 0.8315024338597582
Modified Euler iterations:y(4) = y(3) + .5*h*(((x-y)/2)(3) + ((x-y)/2)(4)
y[0.5000] = 0.8315024338597582   y[0.5000] = 0.836359730596966   y[0.5000] = 0.8362079400739283   
 
Euler Solution:      y(5) = y(4) + h*((x-y)/2)(5)
y[0.6250] = 0.8151993908072874
Modified Euler iterations:y(5) = y(4) + .5*h*(((x-y)/2)(4) + ((x-y)/2)(5)
y[0.6250] = 0.8151993908072874   y[0.6250] = 0.8197623062048026   y[0.6250] = 0.8196197150986302   
 
Euler Solution:      y(6) = y(5) + h*((x-y)/2)(6)
y[0.7500] = 0.8074601603787794
Modified Euler iterations:y(6) = y(5) + .5*h*(((x-y)/2)(5) + ((x-y)/2)(6)
y[0.7500] = 0.8074601603787794   y[0.7500] = 0.8117465357129019   y[0.7500] = 0.8116125864837106   
 
Euler Solution:      y(7) = y(6) + h*((x-y)/2)(7)
y[0.8750] = 0.8077657241223026
Modified Euler iterations:y(7) = y(6) + .5*h*(((x-y)/2)(6) + ((x-y)/2)(7)
y[0.8750] = 0.8077657241223026   y[0.8750] = 0.8117923193808908   y[0.8750] = 0.8116664882790599   
 
Euler Solution:      y(8) = y(7) + h*((x-y)/2)(8)
y[1.0000] = 0.8156285192196802
Modified Euler iterations:y(8) = y(7) + .5*h*(((x-y)/2)(7) + ((x-y)/2)(8)
y[1.0000] = 0.8156285192196802   y[1.0000] = 0.8194110786347212   y[1.0000] = 0.8192928736530011   
 
Euler Solution:      y(9) = y(8) + h*((x-y)/2)(9)
y[1.1250] = 0.8305905320862623
Modified Euler iterations:y(9) = y(8) + .5*h*(((x-y)/2)(8) + ((x-y)/2)(9)
y[1.1250] = 0.8305905320862623   y[1.1250] = 0.8341438456947754   y[1.1250] = 0.8340328046445094   
 
Euler Solution:      y(10) = y(9) + h*((x-y)/2)(10)
y[1.2500] = 0.852221507509997
Modified Euler iterations:y(10) = y(9) + .5*h*(((x-y)/2)(9) + ((x-y)/2)(10)
y[1.2500] = 0.852221507509997   y[1.2500] = 0.8555594689839763   y[1.2500] = 0.8554551576879144   
 
Euler Solution:      y(11) = y(10) + h*((x-y)/2)(11)
y[1.3750] = 0.8801172663274216
Modified Euler iterations:y(11) = y(10) + .5*h*(((x-y)/2)(10) + ((x-y)/2)(11)
y[1.3750] = 0.8801172663274216   y[1.3750] = 0.883252927298937   y[1.3750] = 0.8831549378935771   
 
Euler Solution:      y(12) = y(11) + h*((x-y)/2)(12)
y[1.5000] = 0.9138981250585888
Modified Euler iterations:y(12) = y(11) + .5*h*(((x-y)/2)(11) + ((x-y)/2)(12)
y[1.5000] = 0.9138981250585888   y[1.5000] = 0.9168437461524608   y[1.5000] = 0.9167516954932773   
 
Euler Solution:      y(13) = y(12) + h*((x-y)/2)(13)
y[1.6250] = 0.9532074113216032
Modified Euler iterations:y(13) = y(12) + .5*h*(((x-y)/2)(12) + ((x-y)/2)(13)
y[1.6250] = 0.9532074113216032   y[1.6250] = 0.95597451009519   y[1.6250] = 0.9558880382585153   
 
Euler Solution:      y(14) = y(13) + h*((x-y)/2)(14)
y[1.7500] = 0.9977100692219482
Modified Euler iterations:y(14) = y(13) + .5*h*(((x-y)/2)(13) + ((x-y)/2)(14)
y[1.7500] = 0.9977100692219482   y[1.7500] = 1.000309465199494   y[1.7500] = 1.0002282340751956   
 
Euler Solution:      y(15) = y(14) + h*((x-y)/2)(15)
y[1.8750] = 1.0470913492635905
Modified Euler iterations:y(15) = y(14) + .5*h*(((x-y)/2)(14) + ((x-y)/2)(15)
y[1.8750] = 1.0470913492635905   y[1.8750] = 1.049533206241223   y[1.8750] = 1.049456898210672   
 
Euler Solution:      y(16) = y(15) + h*((x-y)/2)(16)
y[2.0000] = 1.1010555776593376
Modified Euler iterations:y(16) = y(15) + .5*h*(((x-y)/2)(15) + ((x-y)/2)(16)
y[2.0000] = 1.1010555776593376   y[2.0000] = 1.1033494434461277   y[2.0000] = 1.1032777601402906   
 
Euler Solution:      y(17) = y(16) + h*((x-y)/2)(17)
y[2.1250] = 1.1593250002283733
Modified Euler iterations:y(17) = y(16) + .5*h*(((x-y)/2)(16) + ((x-y)/2)(17)
y[2.1250] = 1.1593250002283733   y[2.1250] = 1.161479843978849   y[2.1250] = 1.1614125051116466   
 
Euler Solution:      y(18) = y(17) + h*((x-y)/2)(18)
y[2.2500] = 1.221638696360544
Modified Euler iterations:y(18) = y(17) + .5*h*(((x-y)/2)(17) + ((x-y)/2)(18)
y[2.2500] = 1.221638696360544   y[2.2500] = 1.2236629436446282   y[2.2500] = 1.2235996859170006   
 
Euler Solution:      y(19) = y(18) + h*((x-y)/2)(19)
y[2.3750] = 1.2877515588009272
Modified Euler iterations:y(19) = y(18) + .5*h*(((x-y)/2)(18) + ((x-y)/2)(19)
y[2.3750] = 1.2877515588009272   y[2.3750] = 1.289653124548429   y[2.3750] = 1.2895937006188196   
 
Euler Solution:      y(20) = y(19) + h*((x-y)/2)(20)
y[2.5000] = 1.357433335265581
Modified Euler iterations:y(20) = y(19) + .5*h*(((x-y)/2)(19) + ((x-y)/2)(20)
y[2.5000] = 1.357433335265581   y[2.5000] = 1.359219654714051   y[2.5000] = 1.3591638322312865   
 
Euler Solution:      y(21) = y(20) + h*((x-y)/2)(21)
y[2.6250] = 1.4304677281411309
Modified Euler iterations:y(21) = y(20) + .5*h*(((x-y)/2)(20) + ((x-y)/2)(21)
y[2.6250] = 1.4304677281411309   y[2.6250] = 1.4321457859080915   y[2.6250] = 1.432093346602874   
 
Euler Solution:      y(22) = y(21) + h*((x-y)/2)(22)
y[2.7500] = 1.5066515487479644
Modified Euler iterations:y(22) = y(21) + .5*h*(((x-y)/2)(21) + ((x-y)/2)(22)
y[2.7500] = 1.5066515487479644   y[2.7500] = 1.5082279061411892   y[2.7500] = 1.508178644972651   
 
Euler Solution:      y(23) = y(22) + h*((x-y)/2)(23)
y[2.8750] = 1.5857939228601574
Modified Euler iterations:y(23) = y(22) + .5*h*(((x-y)/2)(22) + ((x-y)/2)(23)
y[2.8750] = 1.5857939228601574   y[2.8750] = 1.5872747435327825   y[2.8750] = 1.5872284678867632   
 
Euler Solution:      y(24) = y(23) + h*((x-y)/2)(24)
y[3.0000] = 1.6677155443756573
Modified Euler iterations:y(24) = y(23) + .5*h*(((x-y)/2)(23) + ((x-y)/2)(24)
y[3.0000] = 1.6677155443756573   y[3.0000] = 1.66910661842644   y[3.0000] = 1.669063147362353