Simpson's and Weddle's Rule
Simpson's and Weddle's Rule
Simpson's and Weddle's Rule
------- -- '"Date I I
euul
-x,o )l ~
- - - ~
Teacher-s Signature:
------
- ':>0~1~ !Page No. "
Experiment No. Name: '"Date I I ~
---. T I l I I I I 1
'
• I
' ' ' T T T T I 1
' '
.•, .
--
,;;} "
) '111. - h -~ 0 .... ~ ( \.•' +~I 2)-. .\,- ~ ( ~ ,,"tr \.f 11 ~ ..
"'1 . ) ~)t 3 ~ { -£ \ - ' J
(' ~
- 0•5
...
I,
0,5 -t ~ I* O, J..t-+
"'
O, J-,8) -}, J-( fJ ,3 6), .J-
.....
I
o. l-5
J
1
3
-- C,.b85
AL Ulo~\T>4M :
1. ~
.2. Ln"' 111'\J, h, I'\~
1
l
1
tL ~
3. hi~ -ik A,W\l'tL t.e \u \!M'\t 011xoi'tA.
) ) l
' . • • I
' • I • I I I • . . . • • I I
• I I
•
Teacher-s Signature:
r:::>OHS lPage No.
Experiment No. _ _ _ _ Name: _ _ _ _ _ _ _ _ __ '"Date I I
10
\. S3
S3 ~ Sl 3 b
Tl f~ ~ V~ si
13 0
,~.
SIMPSON RULE
#include<iostrea m>
#include<math.h>
using namespace std;
int main()
{
float s3,a,b;
cout<<"\n Enter the initial limit : ";
cin>>a;
cout<<"\n Enter the final limit : ";
cin>>b;
s3=sim3(a,b);
cout<<"\n The integral of x•x from "<<a<<" to "<<b<<" is : "<<s3<<"\n"<<endl;
return O;
}
~I ·e:vuscrs\lANRJKA,~ '_ op\l X
~Mlt,).4
.
~
~ h, ~ 5.2 -l-J ~ o.i.
b
~ i., 11 .1. i..,, 11 J..} ,c, 4,g 5'.o 5, 2- )(..
• 10 + 5((,(,0'1'1 t-Jt{,487
r:,Q~1~ jPage No.
Experiment No. _ _ _ Name: _ _ _ _ _ _ __ '"Date I I
LfuO~ T~M :
1.
,. b
wCo] 2(01
5.
t -z. CbJJ .
G. IIY\,
1.
\)~
K.
0
WEDDLE RULE
h = {y-x)/6;
w[O]=x;
z[O)=w[O]*w[O];
w[6]=y;
z[6]=w(6]•w[6];
for(int i=l;i<6;++i)
{
w[i]=w[i-l]+h;
z(i]=w[i]•w(i); //y=x" 2
}
k=3*h/10*(z[O)+S*z(l)+z[2)+6•z[3]+z[4]+5•z[S]+z(6));
return k;
}
int main()
{
float a,b,wedl;
cout<<"\n Enter the initial limit : ";
cin>>a;
cout<<"\n Enter the final limit : ";
cin>>b;
wedl=wed(a,b); //function invoking
11
cout<<"\n The integral of x•x from "<<a<<" to <<b<<" is: "<<wedl<<"\nn<<endl;
return O;
}