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.
Example 13.5.1. The error of rightpoint rule.
Estimate the error of the rightpoint rule.
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
Example 13.5.2. Using substitution to evaluate an improper integral.
The integral
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.
The substitution \(u = e^{-x}\) works well here. Since \(du = -e^{-x}\,dx\) and \(x = -\log u\text{,}\) it follows that
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.
Question 13.5.3. Failure of error estimates.
The integral
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?
Question 13.5.4. An improper integral of second kind.
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?