Question: problem with for loop

hi; I'm written program of composite midpoint in this general form: int(f(x),x=a..b)=2*h*(sum(f(x[2i]); h=(b-a)/(2m+2) the function is: f(x)=1/(2+x^4); a=0; b=1; and all the given inside the program and I wretten the program but i have problem , Iwant compare between the approximate vales and the exact value this is the program: (doing in maple9.5)>> > restart; > f:=x->1/(2+x^4): a:=0: b:=1: > EI:=int(f(x),x=a..b): > EI:=evalf(EI); > for k from 1 to 3 do > n:=2^k*10: > h:=(b-a)/(n+2): > m:=n/2: s:=0: end do; > for i from 1 by 2 to n do > x:=a+(i-1)*h: > s:=s+f(x): > I(k):=2*h*s: > end do; > for k from 1 to 3 do > E(k):=abs(I(k)- EI); > end do: > Print(I E ); EI := 0.4603941666 n := 20 1 h := -- 22 m := 10 s := 0 n := 40 1 h := -- 42 m := 20 s := 0 n := 80 1 h := -- 82 m := 40 s := 0 x := 0 1 s := - 2 Error, illegal use of an object as a name Error, missing operator or `;` how I can solve this problem??
Please Wait...