- #1

- 301

- 0

## Homework Statement

Use the Runge-Kutta method to find approximate values of the solution of the initial-value problem y'+(x^2)y=sin xy, y(1)=pi; h=0.2 at the points x

_{i}=x

_{0}+ih, where x

_{0}is the point where the initial condition is imposed and I=1, 2.

## Homework Equations

yn+1=yn+hf(xn+1/2h, yn+(1/2)hf(xn, yn))

f(x, y)=sin xy-(x^2)y

h=0.2, x0=1, y0=pi.

## The Attempt at a Solution

y1=pi+0.2f(1+0.1, pi+0.1f(1, pi))

=pi+0.2f(1.1, 2.83291)

=2.4669

y2=2.4669+0.2f(1.3, 2.4669+0.1f(1.2, 2.4669))

=2.4669+0.2f(1.3, 2.11683)

=1.76101

But the answer is:

y1=2.475605264, y2=1.825992433.

I got y1=2.4669 and y2=1.76101.

Which is the correct answer? Mine or the book's answer? If I'm wrong, please correct me.