Skip to main content

Section 13.5 Examples and questions

These are additional examples for reviewing the topic we have covered. When reading each example, try to find your own solution before clicking “Answer”. There are also questions for reviewing the concepts of this section.

Estimate the error of the rightpoint rule.

Solution

The rightpoint rule is exact for \(x^0\text{.}\) But for \(\int_0^h x^1\,dx\) it predicts \(\int_0^h x^1\,dx = h^2\text{,}\) while the true value is \(h^2/2\text{.}\) So we stop at \(d=1\) with the error of \(h^2/2\text{,}\) which cam be written as \(\dfrac{1}{2} \ 1! \ h^2\text{.}\) Therefore, the constant factor in the error formula: is \(C=1/2\text{.}\) In conclusion, the error of the rightpoint rule is at most

\begin{equation*} |\text{error}| \le \frac{1}{2}\max_{[a,b]} |f'| (b-a) h \end{equation*}

The integral

\begin{equation*} \int_1^\infty \frac{e^{-x}}{x} \,dx \end{equation*}

is improper (of first kind, meaning the interval of integration is infinite). Having an integration limit \(b = \infty\) is not good for any of the integration rules in this chapter. Make a substitution to transform this integral into a proper one.

Solution

The substitution \(u = e^{-x}\) works well here. Since \(du = -e^{-x}\,dx\) and \(x = -\log u\text{,}\) it follows that

\begin{equation*} \int_1^\infty \dfrac{e^{-x}}{x} \,dx = -\int_0^{1/e} \dfrac{1}{\log u} \,du \end{equation*}

The integral on the right is proper. As \(u\to 0+\text{,}\) the logarithm tends to negative infinity, but this only makes the integrand zero; so it is a continuous function on the interval of integration.

Note that the substitution does not bring us any closer to the symbolic solution, since \(1/\log u\) cannot be integrated with calculus methods either. But it makes a more convenient integral for numerical methods.

The integral

\begin{equation*} \int_0^{1/e} \dfrac{1}{\log u} \,du \end{equation*}

could be approximated using any of the rules in this chapter. The endpoint 0 is not a problem, because Matlab is okay with 1/log(0): it simply evaluates it as 0. But it is still a good idea to avoid this endpoint, so the midpoint rule is preferable. Try it with \(n=5\text{,}\) for example. Then try to estimate the error of this rule using the formula in Example 13.4.1. What goes wrong, and what does this mean for the approximation?

The integral \(\int_0^1 x^{-1/2}\,dx\) is improper (of second kind) but it converges. Which of the above integration rules could be used to evaluate this integral? Which of those rules would you use?