Use Euler's method with step size 0.2 to estimate y(1), where y(x) is the solution of the initial-value problem below. Give your answer correct to 4 decimal places.

y' = 1 - xy
y(0) = 0

y(1) = ____ ?

... help, this is what i've done but got the wrong answer..

h = 0.2
x0 = 0
y0 = 0
F(x,y) = 1-xy

y1 = y0 + hF(x0,y0)
= 0 + 0.2(1-(0)(0)) = 0.2

y2 = y1 + hF(x1,y1)
= 0.2 + 0.2(1-(0.2)(0.2)) = 0.392

y3 = y2 + hF(x2,y2)
= 0.392 + 0.2(1-(0.4)(0.392)) = 0.5606

y4 = y3 + hF(x3,y3)
= 0.5606 + 0.2(1-(0.6)(0.5606)) = 0.6934

y5 = y4 + hF(x4,y4)
= 0.6934 + 0.2(1-(0.8)(0.6934)) = 0.7824

y6 = y5 + hF(x5,y5)
= 0.7824 + 0.2(1-(1.0)(0.7824)) = 0.8259

...my answer was 0.8259, which was wrong. please show me what i'm doing wrong? thanks!

y5 is the estimate for y(1), not y6:

y5 = 1528174/1953125 = 0.782425088

The exact answer involves the error function of imaginary argument and is to 30 significant figures:

0.724778459007076331818227967606

1 answer

You haven't done anything wrong in your work, you have to remember that as you are solving for your y's (y1, y2, y3... etc.) you are also solving for the corresponding x-values (x1, x2, x3... etc.) therefore when your x-value (x5) =1 your corresponding y-value (y5)= .7824