From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 50/CH5/EX5.16/ex_5_16.sce | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 50/CH5/EX5.16/ex_5_16.sce (limited to '50/CH5/EX5.16') 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 -- cgit