Answer:
At h=0.1, the calculated value of y(1.2) equals 15.920, and for h=0.05, y(1.2) amounts to 16.523.
Step-by-step explanation:
Given,
with y(1)=9.
This means when x=1, y=9 initially.
To determine the value of y= f(x,y) at
when h=0.1 and h=0.05, we will implement a C program using Euler's method resulting in, for h=0.1:
#include<stdio.h>
float fun(float x, float y)
{
float f;
f=2x+3y+1;
return f;
}
main()
{
float a,b,x,y,h,t,k;
printf("\ Enter x0,y0,h,xn:");
scanf("% f % f % f % f ", & a, &b, &h, &t);
x=a;
y=b;
printf("\n x\t y\n");
while (x<=t)
{
k=h*fun(x,y);
x=x+h;
y=y+k;
printf("%0.3f\%0.3f\n",x,y);
}
}
Using initial values x0=1, y0=9, h=0.1, and xn=1.2, we reach results, y(1.2)=15.920.
Subsequently, using values x0=1, y0=9, with h=0.05, and xn=1.2 yields y(1.2)=16.523.