Rectangle method
Encyclopedia
In mathematics
, specifically in integral calculus, the rectangle method (also called the midpoint or mid-ordinate rule) computes an approximation
to a definite integral, made by finding the area
of a collection of rectangle
s whose heights are determined by the values of the function.
Specifically, the interval over which the function is to be integrated is divided into equal subintervals of length . The rectangles are then drawn so that either their left or right corners, or the middle of their top line lies on the graph
of the function, with bases running along the -axis. The approximation to the integral is then calculated by adding up the areas (base multiplied by height) of the rectangles, giving the formula:
where and .
The formula for above gives for the Top-left corner approximation.
As N gets larger, this approximation gets more accurate. In fact, this computation is the spirit of the definition of the Riemann integral
and the limit
of this approximation as is defined and equal to the integral of on if this Riemann integral is defined. Note that this is true regardless of which is used, however the midpoint approximation tends to be more accurate for finite .
)
for some in . Summing this, the approximation error for intervals with width is less than or equal to
where is the number of nodes
in terms of the total interval, we know that so we can rewrite the expression:
for some in .
Mathematics
Mathematics is the study of quantity, space, structure, and change. Mathematicians seek out patterns and formulate new conjectures. Mathematicians resolve the truth or falsity of conjectures by mathematical proofs, which are arguments sufficient to convince other mathematicians of their validity...
, specifically in integral calculus, the rectangle method (also called the midpoint or mid-ordinate rule) computes an approximation
Approximation
An approximation is a representation of something that is not exact, but still close enough to be useful. Although approximation is most often applied to numbers, it is also frequently applied to such things as mathematical functions, shapes, and physical laws.Approximations may be used because...
to a definite integral, made by finding the area
Area
Area is a quantity that expresses the extent of a two-dimensional surface or shape in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat...
of a collection of rectangle
Rectangle
In Euclidean plane geometry, a rectangle is any quadrilateral with four right angles. The term "oblong" is occasionally used to refer to a non-square rectangle...
s whose heights are determined by the values of the function.
Specifically, the interval over which the function is to be integrated is divided into equal subintervals of length . The rectangles are then drawn so that either their left or right corners, or the middle of their top line lies on the graph
Graph of a function
In mathematics, the graph of a function f is the collection of all ordered pairs . In particular, if x is a real number, graph means the graphical representation of this collection, in the form of a curve on a Cartesian plane, together with Cartesian axes, etc. Graphing on a Cartesian plane is...
of the function, with bases running along the -axis. The approximation to the integral is then calculated by adding up the areas (base multiplied by height) of the rectangles, giving the formula:
where and .
The formula for above gives for the Top-left corner approximation.
As N gets larger, this approximation gets more accurate. In fact, this computation is the spirit of the definition of the Riemann integral
Riemann integral
In the branch of mathematics known as real analysis, the Riemann integral, created by Bernhard Riemann, was the first rigorous definition of the integral of a function on an interval. The Riemann integral is unsuitable for many theoretical purposes...
and the limit
Limit of a sequence
The limit of a sequence is, intuitively, the unique number or point L such that the terms of the sequence become arbitrarily close to L for "large" values of n...
of this approximation as is defined and equal to the integral of on if this Riemann integral is defined. Note that this is true regardless of which is used, however the midpoint approximation tends to be more accurate for finite .
Error
For a function which is twice differentiable, the approximation error in each section of the midpoint rule decays as the cube of the width of the rectangle. (For a derivation based on a Taylor approximation, see Midpoint methodMidpoint method
In numerical analysis, a branch of applied mathematics, the midpoint method is a one-step method for solving the differential equation y' = f, \quad y = y_0...
)
for some in . Summing this, the approximation error for intervals with width is less than or equal to
where is the number of nodes
in terms of the total interval, we know that so we can rewrite the expression:
for some in .
Matlab Example Program
C example program
Fortran Example Program
See also
- Midpoint methodMidpoint methodIn numerical analysis, a branch of applied mathematics, the midpoint method is a one-step method for solving the differential equation y' = f, \quad y = y_0...
for solving ordinary differential equationOrdinary differential equationIn mathematics, an ordinary differential equation is a relation that contains functions of only one independent variable, and one or more of their derivatives with respect to that variable....
s - Trapezoidal rule
- Simpson's ruleSimpson's ruleIn numerical analysis, Simpson's rule is a method for numerical integration, the numerical approximation of definite integrals. Specifically, it is the following approximation:...