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.15/ex_5_15.sce | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 50/CH5/EX5.15/ex_5_15.sce (limited to '50/CH5/EX5.15/ex_5_15.sce') 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 -- cgit