diff options
Diffstat (limited to '50/CH5/EX5.11/ex_5_11.sce')
-rwxr-xr-x | 50/CH5/EX5.11/ex_5_11.sce | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/50/CH5/EX5.11/ex_5_11.sce b/50/CH5/EX5.11/ex_5_11.sce new file mode 100755 index 000000000..3f861a3ea --- /dev/null +++ b/50/CH5/EX5.11/ex_5_11.sce @@ -0,0 +1,18 @@ +// example : 5.11
+// solve the definite integral by 1) trapezoidal rule, 2)simpsons rule
+// exact value of the integral is ln 2= 0.693147,
+
+deff('[y]=F(x)','y=1/(1+x)')
+
+//1)trapezoidal rule,
+
+a=0;
+b=1;
+I =trapezoidal(0,1,F)
+disp(error =.75-.693147)
+
+// simpson's rule
+
+I=simpson(a,b,F)
+
+disp(error =.694444-.693147)
\ No newline at end of file |