Left Endpoint, Right Endpoint and Midpoint Rules

There are two possible situation when we need numerical approximation (rule):

  1. To calculate abf(x)dx{\int_{{a}}^{{b}}}{f{{\left({x}\right)}}}{d}{x} we need to know antiderivative of f(x){f{{\left({x}\right)}}}. In some cases, it is difficult, or even impossible to find an antiderivative. For example, 13sin(x)xdx{\int_{{1}}^{{3}}}\frac{{{\sin{{\left({x}\right)}}}}}{{x}}{d}{x} and 12u3+1du{\int_{{1}}^{{2}}}\sqrt{{{{u}}^{{3}}+{1}}}{d}{u} can't be found exactly.
  2. The function is determined from a scientific experiment through instrument readings or collected data. There may be no formula for the function.

Actually we already made approximations when we introduced Definite Integral. We approximated area under curve by dividing interval into n{n} subintervals, where i-th subinterval is [xi1,xi]{\left[{x}_{{{i}-{1}}},{x}_{{i}}\right]} and calculate sum of areas of n{n} rectangles. Then we said that when n{n}\to\infty then sum of areas of those rectangles is abf(x)dx{\int_{{a}}^{{b}}}{f{{\left({x}\right)}}}{d}{x} :

abf(x)dx=limni=1nf(xi)Δx{\int_{{a}}^{{b}}}{f{{\left({x}\right)}}}{d}{x}=\lim_{{{n}\to\infty}}{\sum_{{{i}={1}}}^{{n}}}{f{{\left({{x}_{{i}}^{{\star}}}\right)}}}\Delta{x}, where Δx=ban\Delta{x}=\frac{{{b}-{a}}}{{n}} and xi{{x}_{{i}}^{{\star}}} lies in interval [xi1,xi]{\left[{x}_{{{i}-{1}}},{x}_{{i}}\right]}.

This gives us ability to approximate definite integral: abf(x)dxi=1nf(xi)Δx{\int_{{a}}^{{b}}}{f{{\left({x}\right)}}}{d}{x}\approx{\sum_{{{i}={1}}}^{{n}}}{f{{\left({{x}_{{i}}^{{\star}}}\right)}}}\Delta{x}.

If we choose xi{{x}_{{i}}^{{\star}}} to be left endpoint xi1{x}_{{{i}-{1}}} of interval [xi1,xi]{\left[{x}_{{{i}-{1}}},{x}_{{i}}\right]} then this approximation is left right and midpoint approximationscalled Left Endpoint Approximation: abf(x)dxLn=i=1nf(xi1)Δx{\int_{{a}}^{{b}}}{f{{\left({x}\right)}}}{d}{x}\approx{L}_{{n}}={\sum_{{{i}={1}}}^{{{n}}}}{f{{\left({x}_{{{i}-{1}}}\right)}}}\Delta{x}.

If we choose xi{{x}_{{i}}^{{\star}}} to be right endpoint xi{x}_{{i}} of interval [xi1,xi]{\left[{x}_{{{i}-{1}}},{x}_{{i}}\right]} then this approximation is called Right Endpoint Approximation: abf(x)dxRn=i=1nf(xi)Δx{\int_{{a}}^{{b}}}{f{{\left({x}\right)}}}{d}{x}\approx{R}_{{n}}={\sum_{{{i}={1}}}^{{{n}}}}{f{{\left({x}_{{i}}\right)}}}\Delta{x}.

If we choose xi{{x}_{{i}}^{{\star}}} to be midpoint of interval [xi1,xi]{\left[{x}_{{{i}-{1}}},{x}_{{i}}\right]}, i.e. xi=12(xi1+xi){{x}_{{i}}^{{\star}}}=\frac{{1}}{{2}}{\left({x}_{{{i}-{1}}}+{x}_{{i}}\right)} then this approximation is called Midpoint Rule Approximation: abf(x)dxMn=i=1nf(12(xi1+xi))Δx{\int_{{a}}^{{b}}}{f{{\left({x}\right)}}}{d}{x}\approx{M}_{{n}}={\sum_{{{i}={1}}}^{{{n}}}}{f{{\left(\frac{{1}}{{2}}{\left({x}_{{{i}-{1}}}+{x}_{{i}}\right)}\right)}}}\Delta{x}.

Example. Approximate I=121x2dx{I}={\int_{{1}}^{{2}}}\frac{{1}}{{{x}}^{{2}}}{d}{x} using above three methods with n=5{n}={5}.

We have f(x)=1x{f{{\left({x}\right)}}}=\frac{{1}}{{x}}, a=1{a}={1}, b=2{b}={2}, n=5{n}={5}, so Δx=ban=215=0.2\Delta{x}=\frac{{{b}-{a}}}{{n}}=\frac{{{2}-{1}}}{{5}}={0.2}.

Interval is divided into n=5{n}={5} subintervals: [1,1.2]{\left[{1},{1.2}\right]}, [1.2,1.4]{\left[{1.2},{1.4}\right]}, [1.4,1.6]{\left[{1.4},{1.6}\right]}, [1.6,1.8]{\left[{1.6},{1.8}\right]} and [1.8,2]{\left[{1.8},{2}\right]}.

Left endpoint approximation gives (left endpoints of intervals are 1, 1.2, 1.4, 1.6, 1.8)

ILn=Δx(f(1)+f(1.2)+f(1.4)+f(1.6)+f(1.8))={I}\approx{L}_{{n}}=\Delta{x}{\left({f{{\left({1}\right)}}}+{f{{\left({1.2}\right)}}}+{f{{\left({1.4}\right)}}}+{f{{\left({1.6}\right)}}}+{f{{\left({1.8}\right)}}}\right)}=

=0.2(1(1)2+1(1.2)2+1(1.4)2+1(1.6)2+1(1.8)2)0.580783={0.2}{\left(\frac{{1}}{{{\left({1}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.2}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.4}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.6}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.8}\right)}}^{{2}}}\right)}\approx{0.580783}.

Right endpoint approximation gives (right endpoints of intervals are 1.2, 1.4, 1.6, 1.8, 2)

IRn=Δx(f(1.2)+f(1.4)+f(1.6)+f(1.8)+f(2))={I}\approx{R}_{{n}}=\Delta{x}{\left({f{{\left({1.2}\right)}}}+{f{{\left({1.4}\right)}}}+{f{{\left({1.6}\right)}}}+{f{{\left({1.8}\right)}}}+{f{{\left({2}\right)}}}\right)}=

=0.2(1(1.2)2+1(1.4)2+1(1.6)2+1(1.8)2+122)0.430783={0.2}{\left(\frac{{1}}{{{\left({1.2}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.4}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.6}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.8}\right)}}^{{2}}}+\frac{{1}}{{{2}}^{{2}}}\right)}\approx{0.430783}.

Midpoint approximation gives

IMn={I}\approx{M}_{{n}}=

=Δx(f(12(1+1.2))+f(12(1.2+1.4))+f(12(1.4+1.6))+f(12(1.6+1.8))+f(12(1.8+2)))==\Delta{x}{\left({f{{\left(\frac{{1}}{{2}}{\left({1}+{1.2}\right)}\right)}}}+{f{{\left(\frac{{1}}{{2}}{\left({1.2}+{1.4}\right)}\right)}}}+{f{{\left(\frac{{1}}{{2}}{\left({1.4}+{1.6}\right)}\right)}}}+{f{{\left(\frac{{1}}{{2}}{\left({1.6}+{1.8}\right)}\right)}}}+{f{{\left(\frac{{1}}{{2}}{\left({1.8}+{2}\right)}\right)}}}\right)}=

=0.2(f(1.1)+f(1.3)+f(1.5)+f(1.7)+f(1.9))=0.2(1(1.1)2+1(1.3)2+1(1.5)2+1(1.7)2+1(1.9)2)={0.2}{\left({f{{\left({1.1}\right)}}}+{f{{\left({1.3}\right)}}}+{f{{\left({1.5}\right)}}}+{f{{\left({1.7}\right)}}}+{f{{\left({1.9}\right)}}}\right)}={0.2}{\left(\frac{{1}}{{{\left({1.1}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.3}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.5}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.7}\right)}}^{{2}}}+\frac{{1}}{{{\left({1.9}\right)}}^{{2}}}\right)}\approx

0.497127\approx{0.497127}.

We deliberately chose integral that can be integrated directly to compare true value with approximations.

True value of integral is I=121x2dx=1x12=(1211)=12=0.5{I}={\int_{{1}}^{{2}}}\frac{{1}}{{{x}}^{{2}}}{d}{x}=-\frac{{1}}{{x}}{{\mid}_{{1}}^{{2}}}=-{\left(\frac{{1}}{{2}}-\frac{{1}}{{1}}\right)}=\frac{{1}}{{2}}={0.5}.

As can be seen midpoint rule gave better approximation then endpoint approximations.

We will get more accurate approximations when we increase the value of n{n}. (But very large values result in so many arithmetic operations that we have to beware of accumulated round-off error).

As can be seen errors in the left and right endpoint approximations are opposite in sign.

Also, left endpoint approximation overestimated integral, while two other approximations underestimated it.

In general,

  1. if function f(x){f{{\left({x}\right)}}} is increasing then left endpoint approximation underestimates value of integral, while right endpoint approximation overestimates it.
  2. If function f(x){f{{\left({x}\right)}}} is decreasing then left endpoint approximation overestimates value of integral, while right endpoint approximation underestimates it.
  3. If function f(x){f{{\left({x}\right)}}} is concave up then midpoint rule underestimates value of integral, if function f(x){f{{\left({x}\right)}}} is concave down then midpoint rule overestimates value of integral.

When we approximate integral we will always have some error: E=abf(x)dxApp{E}={\int_{{a}}^{{b}}}{f{{\left({x}\right)}}}{d}{x}-{A}{p}{p} where App{A}{p}{p} is approximation and E{E} is error.

Error Bound for Midpoint Rule. Suppose f(x)M{\left|{f{''}}{\left({x}\right)}\right|}\le{M} for axb{a}\le{x}\le{b} then EM(ba)324n2{\left|{E}\right|}\le\frac{{{M}{{\left({b}-{a}\right)}}^{{3}}}}{{{24}{{n}}^{{2}}}}.

Example. How large should we take n{n} in order to guarantee that the Midpoint Rule approximation for 121x2dx{\int_{{1}}^{{2}}}\frac{{1}}{{{x}}^{{2}}}{d}{x} is accurate to within 0.0002?

Here a=1{a}={1}, b=2{b}={2}, f(x)=1x2{f{{\left({x}\right)}}}=\frac{{1}}{{{x}}^{{2}}}.

Then f(x)=2x3{f{'}}{\left({x}\right)}=-\frac{{2}}{{{x}}^{{3}}} and f(x)=6x4{f{''}}{\left({x}\right)}=\frac{{6}}{{{x}}^{{4}}}.

Therefore f(x)6{\left|{f{''}}{\left({x}\right)}\right|}\le{6} for 1x2{1}\le{x}\le{2}.

Thus, 6(21)324n2<0.0002\frac{{{6}{{\left({2}-{1}\right)}}^{{3}}}}{{{24}{{n}}^{{2}}}}<{0.0002} or n2>10.0008{{n}}^{{2}}>\frac{{1}}{{{0.0008}}}.

So, n>10.000835.36{n}>\frac{{1}}{\sqrt{{{0.0008}}}}\approx{35.36}.

Therefore, we should take n=36{n}={36} (the closest integer that is greater than 35.36).