summaryrefslogtreecommitdiff
path: root/50/CH5/EX5.16
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /50/CH5/EX5.16
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '50/CH5/EX5.16')
-rwxr-xr-x50/CH5/EX5.16/ex_5_16.sce16
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