"); 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:
Find y(0.5) if y is the solution of IVP   y' = -2x-y,   y(0) = -1 using Euler's method with step length 0.1. Also find the error in the approximation.

Solution:         f(x, y) = -2x - y,
y1 = y0 + h f(x0, y0) = -1 + 0.1* (-2*0 - (-1)) = -0.8999
y2 = y1 + h f(x1, y1) = -0.8999 + 0.1* (-2*0 - (-0.8999)) = -0.8299
y3 = y2 + h f(x2, y2) = -0.8299 + 0.1* (-2*0 - (-0.8299)) = -0.7869
y4 = y3 + h f(x3, y3) = -0.7869 + 0.1* (-2*0 - (-0.7869)) = -0.7683
y5 = y4 + h f(x4, y4) = -0.7683 + 0.1* (-2*0 - (-0.7683)) = -0.7715

Truncation error in the approximation = ( h2/2 )  f''(x),    where 0 < x <0.5
                                        = 0.005 f''(x)