summaryrefslogtreecommitdiff
path: root/50/CH5/EX5.12/ex_5_12.sce
diff options
context:
space:
mode:
Diffstat (limited to '50/CH5/EX5.12/ex_5_12.sce')
-rwxr-xr-x50/CH5/EX5.12/ex_5_12.sce17
1 files changed, 17 insertions, 0 deletions
diff --git a/50/CH5/EX5.12/ex_5_12.sce b/50/CH5/EX5.12/ex_5_12.sce
new file mode 100755
index 000000000..2e08e16f7
--- /dev/null
+++ b/50/CH5/EX5.12/ex_5_12.sce
@@ -0,0 +1,17 @@
+// example 5.12
+// caption: solve the integral by 1)mid-point rule,2)two-point open type rule
+
+
+// let integration of f(x)=sin(x)/(x) in the range [0,1] is equal to I1 and I2
+// 1)mid -point rule;
+a=0;b=1;
+h=(b-a)/2;
+
+x=0:h:1;
+deff('[y]=f(x)','y=sin(x)/x')
+I1=2*h*f(x(1)+h)
+
+
+//2) two-point open type rule
+h=(b-a)/3;
+I2=(3/2)*h*(f(x(1)+h)+f(x(1)+2*h)) \ No newline at end of file