<s>
In	O
calculus	O
,	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
(	O
also	O
known	O
as	O
the	O
trapezoid	B-Algorithm
rule	I-Algorithm
or	O
trapezium	B-Algorithm
rule	I-Algorithm
;	O
see	O
Trapezoid	O
for	O
more	O
information	O
on	O
terminology	O
)	O
is	O
a	O
technique	O
for	O
approximating	O
the	O
definite	O
integral	O
.	O
</s>
<s>
The	O
trapezoidal	B-Algorithm
rule	I-Algorithm
may	O
be	O
viewed	O
as	O
the	O
result	O
obtained	O
by	O
averaging	O
the	O
left	O
and	O
right	O
Riemann	O
sums	O
,	O
and	O
is	O
sometimes	O
defined	O
this	O
way	O
.	O
</s>
<s>
The	O
integral	O
can	O
be	O
even	O
better	O
approximated	O
by	O
partitioning	O
the	O
integration	O
interval	O
,	O
applying	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
to	O
each	O
subinterval	O
,	O
and	O
summing	O
the	O
results	O
.	O
</s>
<s>
In	O
practice	O
,	O
this	O
"	O
chained	O
"	O
(	O
or	O
"	O
composite	O
"	O
)	O
trapezoidal	B-Algorithm
rule	I-Algorithm
is	O
usually	O
what	O
is	O
meant	O
by	O
"	O
integrating	O
with	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
"	O
.	O
</s>
<s>
As	O
discussed	O
below	O
,	O
it	O
is	O
also	O
possible	O
to	O
place	O
error	O
bounds	O
on	O
the	O
accuracy	O
of	O
the	O
value	O
of	O
a	O
definite	O
integral	O
estimated	O
using	O
a	O
trapezoidal	B-Algorithm
rule	I-Algorithm
.	O
</s>
<s>
A	O
2016	O
Science	O
paper	O
reports	O
that	O
the	O
trapezoid	B-Algorithm
rule	I-Algorithm
was	O
in	O
use	O
in	O
Babylon	B-General_Concept
before	O
50	O
BCE	O
for	O
integrating	O
the	O
velocity	O
of	O
Jupiter	O
along	O
the	O
ecliptic	O
.	O
</s>
<s>
The	O
error	O
of	O
the	O
composite	B-Algorithm
trapezoidal	I-Algorithm
rule	I-Algorithm
is	O
the	O
difference	O
between	O
the	O
value	O
of	O
the	O
integral	O
and	O
the	O
numerical	O
result	O
:	O
</s>
<s>
It	O
follows	O
that	O
if	O
the	O
integrand	O
is	O
concave	O
up	O
(	O
and	O
thus	O
has	O
a	O
positive	O
second	O
derivative	O
)	O
,	O
then	O
the	O
error	O
is	O
negative	O
and	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
overestimates	O
the	O
true	O
value	O
.	O
</s>
<s>
Further	O
terms	O
in	O
this	O
error	O
estimate	O
are	O
given	O
by	O
the	O
Euler	B-Algorithm
–	I-Algorithm
Maclaurin	I-Algorithm
summation	I-Algorithm
formula	I-Algorithm
.	O
</s>
<s>
It	O
is	O
argued	O
that	O
the	O
speed	O
of	O
convergence	O
of	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
reflects	O
and	O
can	O
be	O
used	O
as	O
a	O
definition	O
of	O
classes	O
of	O
smoothness	O
of	O
the	O
functions	O
.	O
</s>
<s>
Let	O
be	O
the	O
function	O
such	O
that	O
is	O
the	O
error	O
of	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
on	O
one	O
of	O
the	O
intervals	O
,	O
.	O
</s>
<s>
The	O
trapezoidal	B-Algorithm
rule	I-Algorithm
converges	O
rapidly	O
for	O
periodic	O
functions	O
.	O
</s>
<s>
The	O
evaluation	O
of	O
the	O
full	O
integral	O
of	O
a	O
Gaussian	O
function	O
by	O
trapezoidal	B-Algorithm
rule	I-Algorithm
with	O
1%	O
accuracy	O
can	O
be	O
made	O
using	O
just	O
4	O
points	O
.	O
</s>
<s>
Simpson	B-Algorithm
's	I-Algorithm
rule	I-Algorithm
requires	O
1.8	O
times	O
more	O
points	O
to	O
achieve	O
the	O
same	O
accuracy	O
.	O
</s>
<s>
Although	O
some	O
effort	O
has	O
been	O
made	O
to	O
extend	O
the	O
Euler-Maclaurin	B-Algorithm
summation	I-Algorithm
formula	I-Algorithm
to	O
higher	O
dimensions	O
,	O
the	O
most	O
straightforward	O
proof	O
of	O
the	O
rapid	O
convergence	O
of	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
in	O
higher	O
dimensions	O
is	O
to	O
reduce	O
the	O
problem	O
to	O
that	O
of	O
convergence	O
of	O
Fourier	O
series	O
.	O
</s>
<s>
Interestingly	O
,	O
in	O
this	O
case	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
often	O
has	O
sharper	O
bounds	O
than	O
Simpson	B-Algorithm
's	I-Algorithm
rule	I-Algorithm
for	O
the	O
same	O
number	O
of	O
function	O
evaluations	O
.	O
</s>
<s>
The	O
trapezoidal	B-Algorithm
rule	I-Algorithm
is	O
one	O
of	O
a	O
family	O
of	O
formulas	O
for	O
numerical	B-Algorithm
integration	I-Algorithm
called	O
Newton	B-Algorithm
–	I-Algorithm
Cotes	I-Algorithm
formulas	I-Algorithm
,	O
of	O
which	O
the	O
midpoint	O
rule	O
is	O
similar	O
to	O
the	O
trapezoid	B-Algorithm
rule	I-Algorithm
.	O
</s>
<s>
Simpson	B-Algorithm
's	I-Algorithm
rule	I-Algorithm
is	O
another	O
member	O
of	O
the	O
same	O
family	O
,	O
and	O
in	O
general	O
has	O
faster	O
convergence	O
than	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
for	O
functions	O
which	O
are	O
twice	O
continuously	O
differentiable	O
,	O
though	O
not	O
in	O
all	O
specific	O
cases	O
.	O
</s>
<s>
However	O
,	O
for	O
various	O
classes	O
of	O
rougher	O
functions	O
(	O
ones	O
with	O
weaker	O
smoothness	O
conditions	O
)	O
,	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
has	O
faster	O
convergence	O
in	O
general	O
than	O
Simpson	B-Algorithm
's	I-Algorithm
rule	I-Algorithm
.	O
</s>
<s>
Moreover	O
,	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
tends	O
to	O
become	O
extremely	O
accurate	O
when	O
periodic	O
functions	O
are	O
integrated	O
over	O
their	O
periods	O
,	O
which	O
can	O
be	O
analyzed	O
in	O
various	O
ways	O
.	O
</s>
<s>
For	O
non-periodic	O
functions	O
,	O
however	O
,	O
methods	O
with	O
unequally	O
spaced	O
points	O
such	O
as	O
Gaussian	B-Algorithm
quadrature	I-Algorithm
and	O
Clenshaw	B-Algorithm
–	I-Algorithm
Curtis	I-Algorithm
quadrature	I-Algorithm
are	O
generally	O
far	O
more	O
accurate	O
;	O
Clenshaw	B-Algorithm
–	I-Algorithm
Curtis	I-Algorithm
quadrature	I-Algorithm
can	O
be	O
viewed	O
as	O
a	O
change	O
of	O
variables	O
to	O
express	O
arbitrary	O
integrals	O
in	O
terms	O
of	O
periodic	O
integrals	O
,	O
at	O
which	O
point	O
the	O
trapezoidal	B-Algorithm
rule	I-Algorithm
can	O
be	O
applied	O
accurately	O
.	O
</s>
