diff options
Diffstat (limited to '50/CH5/EX5.16/ex_5_16.sce')
-rwxr-xr-x | 50/CH5/EX5.16/ex_5_16.sce | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/50/CH5/EX5.16/ex_5_16.sce b/50/CH5/EX5.16/ex_5_16.sce new file mode 100755 index 000000000..f3b260f89 --- /dev/null +++ b/50/CH5/EX5.16/ex_5_16.sce @@ -0,0 +1,16 @@ +// example 5.16
+// caption: gauss-legendre three point method
+// I= integral 1/(1+x) in the range [0,1];
+// first we need ti transform the interval [0,1 ] to [-1,1], since gauss-legendre three point method is applicable in the range[-1,1],
+
+// let t=ax+b;
+// solving for a,b from the two ranges, we get a=2; b=-1; t=2x-1;
+
+// hence I=integral 1/(1+x) in the range [0,1]= integral 1/(t+3) in the range [-1,1];
+
+
+deff('[y]=f(t)','y=1/(t+3)');
+// since , from gauss legendre three point rule(n=2);
+I=(1/9)*(5*f(-sqrt(3/5))+8*f(0)+5*f(sqrt(3/5)))
+
+// we know , exact solution is ln 2=0.693147;
\ No newline at end of file |