diff options
Diffstat (limited to '75/CH5/EX5.4/ex_4.sce')
-rwxr-xr-x | 75/CH5/EX5.4/ex_4.sce | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/75/CH5/EX5.4/ex_4.sce b/75/CH5/EX5.4/ex_4.sce index d14b592d2..d661f5067 100755 --- a/75/CH5/EX5.4/ex_4.sce +++ b/75/CH5/EX5.4/ex_4.sce @@ -1,4 +1,4 @@ - // PG (258) +// PG (258) deff('[y]=f(x)','y=exp(x)*cos(x)') x0=0; @@ -7,7 +7,7 @@ x=x0:xn; // True value -I = integrate('exp(x)*cos(x)','x',x0,x1) +I = integrate('exp(x)*cos(x)','x',x0,xn) // Using Simpson's rule @@ -35,4 +35,4 @@ x5=x0+5*h; x6=x0+6*h; x7=x0+7*h; x8=x0+8*h; - I3 = h*(f(x0)+4*f(x1)+2*f(x2)+4*f(x3)+2*f(x4)+4*f(x5)+2*f(x6)+4*f(x7)+f(x8))/3 + I3 = h*(f(x0)+4*f(x1)+2*f(x2)+4*f(x3)+2*f(x4)+4*f(x5)+2*f(x6)+4*f(x7)+f(x8))/3
\ No newline at end of file |