Let y = f(x be the solution to the differential equation dy/dx = x y with the intial condition f(1=2. what is the approximation for f(2 if euler's method is used, starting at x=1, with a step size of 0.5

Respuesta :

Denote the ODE by

[tex]\dfrac{\mathrm dy}{\mathrm dx}=g(x,y)=xy[/tex]

For this equation, you'll be using the recurrence relation

[tex]\begin{cases}y_{n+1}=y_n+hg(x_n,y_n)\\x_{n+1}=x_n+h\\x_0=1\\y_0=2\\h=0.5\end{cases}[/tex]

You have

[tex]f(1.5)\approx y_1=y_0+0.5x_0y_0=2+0.5(1)(2)=3[/tex]
[tex]f(2)\approx y_2=y_1+0.5x_1y_1=3+0.5(1.5)(3)=5.25[/tex]