Solveeit Logo

Question

Question: Use Euler's method to solve the equation $\frac{dy}{dx}=1+xy$ with $y(0) = 1$ and tabulate the solut...

Use Euler's method to solve the equation dydx=1+xy\frac{dy}{dx}=1+xy with y(0)=1y(0) = 1 and tabulate the solution for x=0x = 0 to x=0.4x = 0.4. Take h=0.1h = 0.1 and correct the solution upto fourth decimal place.

Answer

The tabulated solution using Euler's method is:

xxyy
0.01.0000
0.11.1000
0.21.2110
0.31.3352
0.41.4753
Explanation

Solution

The given differential equation is dydx=f(x,y)=1+xy\frac{dy}{dx} = f(x, y) = 1 + xy, with the initial condition y(0)=1y(0) = 1. The step size is h=0.1h = 0.1. We use Euler's method formula: yn+1=yn+hf(xn,yn)y_{n+1} = y_n + h f(x_n, y_n). We start with (x0,y0)=(0,1)(x_0, y_0) = (0, 1) and iterate to find yy values for x=0.1,0.2,0.3,0.4x = 0.1, 0.2, 0.3, 0.4.

  1. For n=0n=0: x0=0x_0 = 0, y0=1.0000y_0 = 1.0000 f(x0,y0)=1+(0)(1)=1.0000f(x_0, y_0) = 1 + (0)(1) = 1.0000 y1=y0+hf(x0,y0)=1.0000+0.1×1.0000=1.1000y_1 = y_0 + h f(x_0, y_0) = 1.0000 + 0.1 \times 1.0000 = 1.1000 x1=x0+h=0.1x_1 = x_0 + h = 0.1

  2. For n=1n=1: x1=0.1x_1 = 0.1, y1=1.1000y_1 = 1.1000 f(x1,y1)=1+(0.1)(1.1000)=1+0.1100=1.1100f(x_1, y_1) = 1 + (0.1)(1.1000) = 1 + 0.1100 = 1.1100 y2=y1+hf(x1,y1)=1.1000+0.1×1.1100=1.1000+0.1110=1.2110y_2 = y_1 + h f(x_1, y_1) = 1.1000 + 0.1 \times 1.1100 = 1.1000 + 0.1110 = 1.2110 x2=x1+h=0.2x_2 = x_1 + h = 0.2

  3. For n=2n=2: x2=0.2x_2 = 0.2, y2=1.2110y_2 = 1.2110 f(x2,y2)=1+(0.2)(1.2110)=1+0.2422=1.2422f(x_2, y_2) = 1 + (0.2)(1.2110) = 1 + 0.2422 = 1.2422 y3=y2+hf(x2,y2)=1.2110+0.1×1.2422=1.2110+0.12422=1.33522y_3 = y_2 + h f(x_2, y_2) = 1.2110 + 0.1 \times 1.2422 = 1.2110 + 0.12422 = 1.33522 Rounding to four decimal places: y31.3352y_3 \approx 1.3352 x3=x2+h=0.3x_3 = x_2 + h = 0.3

  4. For n=3n=3: x3=0.3x_3 = 0.3, y3=1.3352y_3 = 1.3352 f(x3,y3)=1+(0.3)(1.3352)=1+0.40056=1.40056f(x_3, y_3) = 1 + (0.3)(1.3352) = 1 + 0.40056 = 1.40056 y4=y3+hf(x3,y3)=1.3352+0.1×1.40056=1.3352+0.140056=1.475256y_4 = y_3 + h f(x_3, y_3) = 1.3352 + 0.1 \times 1.40056 = 1.3352 + 0.140056 = 1.475256 Rounding to four decimal places: y41.4753y_4 \approx 1.4753 x4=x3+h=0.4x_4 = x_3 + h = 0.4