summaryrefslogtreecommitdiff
path: root/50/CH5/EX5.15/ex_5_15.sce
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.15/ex_5_15.sce
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.15/ex_5_15.sce')
-rwxr-xr-x50/CH5/EX5.15/ex_5_15.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/50/CH5/EX5.15/ex_5_15.sce b/50/CH5/EX5.15/ex_5_15.sce
new file mode 100755
index 000000000..b56793e06
--- /dev/null
+++ b/50/CH5/EX5.15/ex_5_15.sce
@@ -0,0 +1,26 @@
+// example :5.15
+// find the quadrature formula of
+// integral of f(x)*(1/sqrt(x(1+x))) in the range [0,1]= a1*f(0)+a2*f(1/2)+a3*f(1)=I
+// hence find integral 1/sqrt(x-x^3) in the range [0,1]
+
+// making the method exact for polinomials of degree upto 2,
+// I=I1=a1+a2+a3
+// I=I2=(1/2)*a2+a3
+// I=I3=(1/4)*a2+a3
+
+// A=[a1 a2 a3]'
+
+I1=integrate('1/sqrt(x*(1-x))','x',0,1)
+I2=integrate('x/sqrt(x*(1-x))','x',0,1)
+I3=integrate('x^2/sqrt(x*(1-x))','x',0,1)
+
+//hence
+// [1 1 1;0 1/2 1 ;0 1/4 1]*A=[I1 I2 I3]'
+
+A=inv([1 1 1;0 1/2 1 ;0 1/4 1])*[I1 I2 I3]'
+// I=(3.14/4)*(f(0)+2*f(1/2)+f(1));
+
+// hence, for solving the integral 1/sqrt(x-x^3) in the range [0,1]=I
+
+deff('[y]=f(x)','y=1/sqrt(1+x)');
+I=(3.14/4)*[1+2*sqrt(2/3)+sqrt(2)/2] \ No newline at end of file