Navigation

Integration

1.11 Numerical Integration

33 problems · hints, answers and solutions shown beside each one

Recall that we are using logx\log x to denote the logarithm of xx with base ee. In other courses it is often denoted lnx\ln x.

1Stage 1Conceptual

Do you understand the idea? Usually little or no calculation.

Q1Stage 1

Suppose we approximate an object to have volume 1.5m31.5 \mathrm{m}^3, when its exact volume is 1.387m31.387 \mathrm{m}^3. Give the relative error, absolute error, and percent error of our approximation.

Hint

The absolute error is the difference of the two values; the relative error is the absolute error divided by the exact value; the percent error is one hundred times the relative error.

Answer

Relative error: 0.08147\approx 0.08147; absolute error: 0.1130.113; percent error: 8.147%\approx 8.147\%.

Full solution

The absolute error is the difference between the two values:

1.3871.5=0.113|1.387-1.5| = 0.113

The relative error is the absolute error divided by the exact value:

0.1131.3870.08147\frac{0.113}{1.387}\approx 0.08147

The percent error is 100 times the relative error:

8.147%\approx 8.147\%
Q2Stage 1

Consider approximating 210f(x) dx\displaystyle\int_2^{10} f(x)~\dee{x}, where f(x)f(x) is the function in the graph below.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

  1. Draw the rectangles associated with the midpoint rule approximation and n=4n=4.

  2. Draw the trapezoids associated with the trapezoidal rule approximation and n=4n=4.

You don't have to give an approximation.

Hint

You should have four rectangles in one drawing, and four trapezoids in another.

Answer

Midpoint rule:

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Trapezoidal rule:

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Full solution

Midpoint rule:

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Trapezoidal rule:

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Q3Stage 1

Let f(x)=112x4+76x33x2f(x) = -\dfrac{1}{12}x^4+\dfrac{7}{6}x^3-3x^2.

  1. Find a reasonable value MM such that f(x)M|f''(x)| \leq M for all 1x61 \leq x \leq 6.

  2. Find a reasonable value LL such that f(4)(x)L|f^{(4)}(x)| \leq L for all 1x61 \leq x \leq 6.

Hint

Sketch the second derivative–it's quadratic.

Answer

M=6.25M=6.25, L=2L=2

Full solution
  1. Differentiating, we find f(x)=x2+7x6f''(x) = -x^2+7x-6. Since f(x)f''(x) is quadratic, we have a pretty good idea of what it looks like.

    • It factors as f(x)=(x6)(x1)f(x) = -(x-6)(x-1), so its two roots are at x=6x=6 and x=1x=1.

    • The “flat part" of the parabola is at x=3.5x=3.5 (since this is exactly half way between x=1x=1 and x=6x=6; alternately, we can check that f(3.5)=0f'''(3.5)=0).

    • Since the coefficient of x2x^2 is negative, f(x)f(x) is increasing from -\infty to 3.53.5, then decreasing from 3.53.5 to \infty.

    Therefore, over the interval [1,6][1,6], the largest positive value of f(x)f''(x) occurs when x=3.5x=3.5, and this is f(3.5)=(3.56)(3.51)=6.25f''(3.5) = -(3.5-6)(3.5-1)=6.25.

    Figure from prob_s1.11, line 2

    Figure from prob_s1.11, line 2

    So, we take M=6.25M=6.25.

  2. We differentiate further to find f(4)(x)=2f^{(4)}(x)=-2. This is constant everywhere, so we take L=2=2L=|-2|=2.

Q4Stage 1

Let f(x)=xsinx+2cosxf(x) = x\sin x+2\cos x. Find a reasonable value MM such that f(x)M|f''(x)| \leq M for all 3x2-3 \leq x \leq 2.

Hint

You don't have to find the actual, exact maximum the second derivative achieves–you only have to give a reasonable “ceiling" that it never breaks through.

Answer

One reasonable answer is M=3M=3.

Full solution

Let's start by differentiating.

f(x)=xsinx+2cosxf(x)=xcosx+sinx2sinx=xcosxsinxf(x)=xsinx+cosxcosx=xsinx\begin{align*} f(x)&=x\sin x +2\cos x\\ f'(x)&=x\cos x + \sin x - 2\sin x =x\cos x - \sin x\\ f''(x)&=-x\sin x + \cos x -\cos x = -x\sin x \end{align*}

For any value of xx, sinx1|\sin x| \leq 1. When 3x2-3 \leq x \leq 2, then x3|x| \leq 3. So, it is true (and not unreasonably sloppy) that

f(x)3f''(x) \leq 3

whenever xx is in the interval [3,2][-3,2]. So, we can take M=3M=3.

Note that f(x)|f''(x)| is actually smaller than 3 whenever xx is in the interval [3,2][-3,2], because when x=3x=-3, sinx1\sin x \neq 1. In fact, since 3 is pretty close to π\pi, sin3\sin 3 is pretty small. (The actual maximum value of f(x)|f''(x)| when 3x2-3\leq x\leq 2 is about 1.8.) However, we find parameters like MM for the purpose of computing error bounds. There is often not much to be gained from taking the time to find the actual maximum of a function, so we content ourselves with reasonable upper bounds. Question 31 has a further investigation of “sloppy" bounds like this.

Q5Stage 1

Consider the quantity A=ππcosx dxA=\displaystyle\int_{-\pi}^{\pi} \cos x~\dee{x}.

  1. Find the upper bound on the error using Simpson's rule with n=4n=4 to approximate AA using Theorem 1.11.12 in the CLP-2 text.

  2. Find the Simpson's rule approximation of AA using n=4n=4.

  3. What is the (actual) absolute error in the Simpson's rule approximation of AA with n=4n=4?

Hint

To compute the upper bound on the error, find an upper bound on the fourth derivative of cosine, then use Theorem 1.11.12 in the CLP-2 text.

To find the actual error, you need to find the actual value of AA.

Answer

(a) π51808\dfrac{\pi^5}{180\cdot8} (b) 00 (c) 00

Full solution
  1. Let f(x)=cosxf(x) = \cos x. Then f(4)(x)=cosxf^{(4)}(x)=\cos x, so f(4)(x)1|f^{(4)}(x)| \leq 1 when πxπ-\pi \leq x \leq \pi. So, using L=1L=1, we find the upper bound of the error using Simpson's rule with n=4n=4 is:

    L(ba)5180n4=(2π)518044=π518080.2\frac{L(b-a)^5}{180 n^4} = \frac{(2\pi)^5}{180\cdot 4^4} = \frac{\pi^5}{180\cdot8}\approx 0.2

    The error bound comes from Theorem 1.11.12 in the CLP-2 text. We used a calculator to find the approximate decimal value.

  2. We use the general form of Simpson's rule (Equation 1.11.9 in the CLP-2 text) with Δx=ban=2π4=π2\Delta x = \frac{b-a}{n}=\frac{2\pi}{4} = \frac{\pi}{2}.

    AΔx3(f(x0)+4f(x1)+2f(x2)+4f(x3)+f(x4))=π/23(f(π)+4f(π2)+2f(0)+4f(π2)+f(π))=π6(1+4(0)+2(1)+4(0)1)=0\begin{align*} A& \approx \frac{\Delta x}{3}\left(f(x_0) + 4f(x_1)+2f(x_2)+4f(x_3)+f(x_4)\right) \\&=\frac{\pi/2}{3}\left(f(-\pi) + 4f(\tfrac{-\pi}{2})+2f(0)+4f(\tfrac{\pi}{2})+f(\pi)\right)\\ &= \frac{\pi}{6}\left(-1 + 4(0)+2(1)+4(0)-1\right)=0 \end{align*}
  3. To find the actual error in our approximation, we compare the approximation from (b) to the exact value of AA. In fact, A=0A=0: this is a fact you've probably seen before by considering the symmetry of cosine, but it's easy enough to calculate:

    A=ππcosx dx=sinπsin(π)=0A = \int_{-\pi}^{\pi} \cos x~\dee{x}= \sin \pi - \sin (-\pi) = 0

    So, our approximation was exactly the same as our exact value. The absolute error is 0.

Remark: the purpose of this question was to remind you that the error bounds we calculate are not (usually) the same as the actual error. Often our approximations are better than we give them credit for. In normal circumstances, we would be approximating an integral precisely to avoid evaluating it exactly, so we wouldn't find our exact error. The bound is a quick way of ensuring that our approximation is not too far off.

Q6Stage 1

Give a function f(x)f(x) such that:

  • f(x)3f''(x) \leq 3 for every xx in [0,1][0,1], and

  • the error using the trapezoidal rule approximating 01f(x) dx\displaystyle\int_0^1 f(x)~\dee{x} with n=2n=2 intervals is exactly 116\dfrac{1}{16}.

Hint

Find a function with f(x)=3f''(x)=3 for all xx in [0,1][0,1].

Answer

Possible answers: f(x)=32x2+Cx+Df(x) = \dfrac{3}{2}x^2+Cx+D for any constants CC, DD.

Full solution

Using Theorem 1.11.12 in the CLP-2 text, the error using the trapezoidal rule as described is at most

M(ba)312n2=M48348=116.\dfrac{M(b-a)^3}{12\cdot n^2} = \dfrac{M}{48} \leq \frac{3}{48}=\frac{1}{16}.

So, we're really being asked to find a function with the maximum possible error using the trapezoidal rule, given its second derivative.

With that in mind, our function should have the largest second derivative possible: let's set f(x)=3f''(x)=3 for every xx. Then:

f(x)=3f(x)=3x+Cf(x)=32x2+Cx+D\begin{align*}&&f''(x)&=3\\ &&f'(x)&=3x+C\\ &&f(x)&=\frac{3}{2}x^2+Cx+D\end{align*}

for some constants CC and DD. Now we can find the exact and approximate values of 01f(x) dx\displaystyle\int_0^1 f(x)~\dee{x}.

Exact:01f(x) dx=01(32x2+Cx+D) dx=[12x3+C2x2+Dx]01=12+C2+DApproximate:01f(x) dxΔx[12f(0)+f(12)+12f(1)]=12[12(D)+(38+C2+D)+12(32+C+D)]=12[98+C+2D]=916+C2+D\begin{align*}&\text{Exact:}&\int_0^1 f(x)~\dee{x}&=\int_0^1 \left(\frac{3}{2}x^2+Cx+D\right)~\dee{x}\\ &&&=\left[\frac{1}{2}x^3+\frac{C}{2}x^2+Dx\right]_0^1\\ &&&=\textcolor{blue}{\frac{1}{2}+\frac{C}{2}+D}\\ &\text{Approximate:}&\int_0^1 f(x)~\dee{x}&\approx \Delta x \left[\frac{1}{2}f(0)+f(\tfrac{1}{2})+\frac{1}{2}f(1)\right]\\ &&&=\frac{1}{2}\left[\frac{1}{2}(D)+\left(\frac{3}{8}+\frac{C}{2}+D\right)+\frac{1}{2}\left(\frac{3}{2}+C+D\right)\right]\\ &&&=\frac{1}{2}\left[\frac{9}{8}+C+2D\right]\\ &&&=\textcolor{red}{\frac{9}{16}+\frac{C}{2}+D}\end{align*}

So, the absolute error associated with the trapezoidal approximation is:

(12+C2+D)(916+C2+D)=116\left|\left(\textcolor{blue}{\frac{1}{2}+\frac{C}{2}+D}\right) - \left(\textcolor{red}{\frac{9}{16}+\frac{C}{2}+D}\right) \right| = \frac{1}{16}

So, for any constants CC and DD, f(x)=32x2+Cx+Df(x) = \frac{3}{2}x^2+Cx+D has the desired error.

Remark: contrast this question with Question 5. In this problem, our absolute error was exactly as bad as the bound predicted, but sometimes it is much better. The thing to remember is that, in general, we don't know our absolute error. We only guarantee that it's not any worse than some worst-case-scenario bound.

Q7Stage 1

Suppose my mother is under 100 years old, and I am under 200 years old. (We're going somewhere with this.) Who is older?

Hint

You're allowed to use common sense for this one.

Answer

my mother

Full solution

Under any reasonable assumptions (Anyone caught trying to come up with a scenario in which I am older than my mother will be sent to maximum security grad school.), my mother is older than I am.

Q8Stage 1
  1. True or False: for fixed positive constants MM, nn, aa, and bb, with b>ab>a,

    M24(ba)3n2M12(ba)3n2\dfrac{M}{24}\dfrac{(b-a)^3}{n^2}\leq \dfrac{M}{12}\dfrac{(b-a)^3}{n^2}
  2. True or False: for a function f(x)f(x) and fixed constants nn, aa, and bb, with b>ab>a, the nn-interval midpoint approximation of abf(x) dx\displaystyle\int_a^b f(x)~\dee{x} is more accurate than the nn-interval trapezoidal approximation.

Hint

For part (b), consider Question 7.

Answer

(a) true (b) false

Full solution

(a) Since both expressions are positive, and 124112\frac{1}{24} \leq \frac{1}{12}, the inequality is true.
(b) False. The reasoning is the same as in Question 7. The error bound given by Theorem 1.11.12 is always better for the trapezoid rule, but this doesn't necessarily mean the error is better.

To see how the trapezoid approximation could be better than the corresponding midpoint approximation in some cases, consider the function f(x)f(x) sketched below.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

The trapezoidal approximation of abf(x) dx\displaystyle\int_a^b f(x)~\dee{x} with n=1n=1 misses the thin spike, and gives a mild underapproximation. By contrast, the midpoint approximation with n=1n=1 takes the spike as the height of the entire region, giving a vast overapproximation.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 15

Figure from prob_s1.11, line 15

Q9Stage 1Past exam · 2015A

Decide whether the following statement is true or false. If false, provide a counterexample. If true, provide a brief justification.

When f(x)f(x) is positive and concave up, any trapezoidal rule approximation for abf(x)dx\displaystyle\int_{a}^{b} f(x) \,\dee{x} will be an upper estimate for abf(x)dx\displaystyle\int_{a}^{b} f(x) \,\dee{x}.

Hint

Draw a sketch.

Answer

True. Because f(x)f(x) is positive and concave up, the graph of f(x)f(x) is always below the top edges of the trapezoids used in the trapezoidal rule.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Full solution

True. Because f(x)f(x) is positive and concave up, the graph of f(x)f(x) is always below the top edges of the trapezoids used in the trapezoidal rule.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Q10Stage 1

Give a polynomial f(x)f(x) with the property that the Simpson's rule approximation of abf(x) dx\displaystyle\int_a^b f(x)~\dee{x} is exact for all aa, bb, and nn.

Hint

The error bound for the approximation is given in Theorem 1.11.12 in the CLP-2 text. You want this bound to be zero.

Answer

Any polynomial of degree at most 3 will do. For example, f(x)=5x327f(x)=5x^3-27, or f(x)=x2f(x)=x^2.

Full solution

According to Theorem 1.11.12 in the CLP-2 text, the error associated with the Simpson's rule approximation is no more than L180(ba)5n4\dfrac{L}{180}\dfrac{(b-a)^5}{n^4}, where LL is a constant such that f(4)(x)L|f^{(4)}(x)| \leq L for all xx in [a,b][a,b]. If L=0L=0, then the error is no more than 0 regardless of aa, bb, or nn–that is, the approximation is exact.

Any polynomial f(x)f(x) of degree at most 3 has f(4)(x)=0f^{(4)}(x)=0 for all xx. So, any polynomial of degree at most 3 is an acceptable answer. For example, f(x)=5x327f(x)=5x^3-27, or f(x)=x2f(x)=x^2.

2Stage 2Procedural

Practising the skill itself, until applying it is automatic.

Questions 11 and 12 ask you to approximate a given integral using the formulas in Equations 1.11.2, 1.11.6, and 1.11.9 in the CLP-2 text.

Q11Stage 2

Write out all three approximations of 0301x3+1 dx\displaystyle\int_0^{30} \frac{1}{x^3+1}~\dee{x} with n=6n=6. (That is: midpoint, trapezoidal, and Simpson's.) You do not need to simplify your answers.

Hint

Follow the formulas in Equations 1.11.2, 1.11.6, and 1.11.9 in the CLP-2 text.

Answer

Midpoint:

0301x3+1dx[1(2.5)3+1+1(7.5)3+1+1(12.5)3+1+1(17.5)3+1+1(22.5)3+1+1(27.5)3+1]5\displaystyle \int_0^{30} \frac{1}{x^3+1}\,\dee{x}\approx\left[\tfrac{1}{\left(2.5\right)^3+1} +\tfrac{1}{\left(7.5\right)^3+1} +\tfrac{1}{\left(12.5\right)^3+1} +\tfrac{1}{\left(17.5\right)^3+1} +\tfrac{1}{\left(22.5\right)^3+1} +\tfrac{1}{\left(27.5\right)^3+1} \right]5

Trapezoidal:

0301x3+1dx[1/203+1+153+1+1103+1+1153+1+1203+1+1253+1+1/2303+1]5\displaystyle\int_0^{30} \frac{1}{x^3+1}\,\dee{x} \approx\left[ \frac{1/2}{0^3+1}+ \frac{1}{5^3+1}+ \frac{1}{10^3+1}+ \frac{1}{15^3+1}+ \frac{1}{20^3+1}+ \frac{1}{25^3+1}+ \frac{1/2}{30^3+1} \right]5

Simpson's:

0301x3+1dx[103+1 ⁣+453+1 ⁣+2103+1 ⁣+4153+1 ⁣+2203+1 ⁣+4253+1 ⁣+1303+1]53\displaystyle\int_0^{30} \frac{1}{x^3+1}\,\dee{x}\approx \Big[\frac{1}{{0}^3+1}\!+\frac{4}{{5}^3+1}\!+\frac{2}{{10}^3+1}\!+\frac{4}{{15}^3+1}\!+\frac{2}{{20}^3+1}\!+\frac{4}{{25}^3+1}\!+ \frac{1}{{30}^3+1}\Big]\frac{5}{3}

Full solution
  • For all three approximations, Δx=ban=3006=5\Delta x = \dfrac{b-a}{n}=\dfrac{30-0}{6}=5.

  • For the trapezoidal rule and Simpson's rule, the xx-values where we evaluate 1x3+1\dfrac{1}{x^3+1} start at x=a=0x=a=0 and move up by Δx=5\Delta x = 5: x0=0x_0=0, x1=5x_1=5, x2=10x_2=10, x3=15x_3=15, x4=20x_4=20, x5=25x_5=25, and x6=30x_6=30.

    Figure from prob_s1.11, line 2

    Figure from prob_s1.11, line 2

  • For the midpoint rule, the xx-values where we evaluate 1x3+1\dfrac{1}{x^3+1} start at x=2.5=x0+x12x=2.5 = \frac{x_0+x_1}{2} and move up by Δx=5\Delta x = 5: xˉ1=2.5\bar x_1=2.5, xˉ2=7.5\bar x_2=7.5, xˉ3=12.5\bar x_3=12.5, xˉ4=17.5\bar x_4=17.5, xˉ5=22.5\bar x_5=22.5, and xˉ6=27.5\bar x_6=27.5.

    Figure from prob_s1.11, line 2

    Figure from prob_s1.11, line 2

  • Following Equation 1.11.2 in the CLP-2 text, the midpoint rule approximation is:

    0301x3+1dx[f(xˉ1)+f(xˉ2)++f(xˉn)]Δx=[1(2.5)3+1+1(7.5)3+1+1(12.5)3+1+1(17.5)3+1+1(22.5)3+1+1(27.5)3+1]5\begin{align*} \int_0^{30} \frac{1}{x^3+1}\,\dee{x}&\approx\Big[f(\bar x_1)+f(\bar x_2)+\cdots +f(\bar x_n)\Big]\De x\\ &=\left[\tfrac{1}{\left(2.5\right)^3+1} +\tfrac{1}{\left(7.5\right)^3+1} +\tfrac{1}{\left(12.5\right)^3+1} +\tfrac{1}{\left(17.5\right)^3+1} +\tfrac{1}{\left(22.5\right)^3+1} +\tfrac{1}{\left(27.5\right)^3+1} \right]5 \end{align*}
  • Following Equation 1.11.6 in the CLP-2 text, the trapezoidal rule approximation is:

    0301x3+1dx[12f(x0)+f(x1)+f(x2)++f(xn1)+12f(xn)]Δx=[1/203+1+153+1+1103+1+1153+1+1203+1+1253+1+1/2303+1]5\begin{align*} \int_0^{30} \frac{1}{x^3+1}\,\dee{x} &\approx\Big[\half f(x_0)+f(x_1)+f(x_2)+\cdots+ f(x_{n-1})+\half f(x_n)\Big]\De x\\ &=\left[ \frac{1/2}{0^3+1}+ \frac{1}{5^3+1}+ \frac{1}{10^3+1}+ \frac{1}{15^3+1}+ \frac{1}{20^3+1}+ \frac{1}{25^3+1}+ \frac{1/2}{30^3+1} \right]5 \end{align*}
  • Following Equation 1.11.9 in the CLP-2 text, the Simpson's rule approximation is:

    0301x3+1dx[f(x0) ⁣+4f(x1) ⁣+2f(x2) ⁣+4f(x3) ⁣+2f(x4) ⁣+4f(x5) ⁣+f(x6)]Δx3=[103+1 ⁣+453+1 ⁣+2103+1 ⁣+4153+1 ⁣+2203+1 ⁣+4253+1 ⁣+1303+1]53\begin{align*} \int_0^{30} \frac{1}{x^3+1}\,\dee{x} &\approx\Big[f(x_0)\!+4f(x_1)\!+2f(x_2)\!+4f(x_3)\!+2f(x_4)\!+4f(x_{5})\!+ f(x_6)\Big]\tfrac{\De x}{3}\\ &=\Big[\frac{1}{{0}^3+1}\!+\frac{4}{{5}^3+1}\!+\frac{2}{{10}^3+1}\!+\frac{4}{{15}^3+1}\!+\frac{2}{{20}^3+1}\!+\frac{4}{{25}^3+1}\!+ \frac{1}{{30}^3+1}\Big]\frac{5}{3} \end{align*}
Q12Stage 2Past exam · M121 2012A

Find the midpoint rule approximation to 0πsinx dx\displaystyle\int_0^\pi \sin x\ \dee{x} with n=3n = 3.

Hint

See Section 1.11.1 in the

CLP-2 text. You should be able to simplify your answer to an exact value (in terms of π\pi).

Answer

2π3\dfrac{2\pi}{3}

Full solution

By Equation 1.11.2 in the CLP-2 text, the midpoint rule approximation to abf(x) dx\int_a^b f(x)\ \dee{x} with n=3n=3 is

abf(x)dx[f(xˉ1)+f(xˉ2)+f(xˉ3)]Δx\begin{align*} \int_a^b f(x)\,\dee{x}\approx\big[f(\bar x_1)+f(\bar x_2)+f(\bar x_3)\big]\De x \end{align*}

where Δx=ba3\De x = \tfrac{b-a}{3} and

x0=ax1=a+Δxx2=a+2Δxx3=bxˉ1=x0+x12xˉ2=x1+x22xˉ3=x2+x32\begin{alignat*}{7} x_0&=a&\quad x_1&=a+\De x&\quad x_2&=a+2\De x&\quad x_3&=b\\ & & \bar x_1&=\tfrac{x_0+x_1}{2}& \bar x_2&=\tfrac{x_1+x_2}{2}& \bar x_3&=\tfrac{x_2+x_3}{2} \end{alignat*}

For this problem, a=0a=0, b=πb=\pi and f(x)=sinxf(x) = \sin x, so that Δx=π3\De x = \tfrac{\pi}{3} and

x0=0x1=π3x2=2π3x3=πxˉ1=π6xˉ2=π2xˉ3=5π6\begin{alignat*}{7} x_0&=0&\quad x_1&=\tfrac{\pi}{3}&\quad x_2&=\tfrac{2\pi}{3}&\quad x_3&=\pi\\ & & \bar x_1&=\tfrac{\pi}{6}& \bar x_2&=\tfrac{\pi}{2}& \bar x_3&=\tfrac{5\pi}{6} \end{alignat*}

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Therefore,

0πsinx dx[sinπ6+sinπ2+sin5π6]π3=[12+1+12]π3=2π3\begin{align*} \int_0^\pi \sin x\ \dee{x} &\approx\left[\sin\frac{\pi}{6} +\sin \frac{\pi}{2} +\sin \frac{5\pi}{6}\right]\frac{\pi}{3} =\left[\frac{1}{2} +1 +\frac{1}{2}\right]\frac{\pi}{3} =\frac{2\pi}{3} \end{align*}

Questions 13 though 17 ask you to approximate a quantity based on observed data.

Q13Stage 2Past exam · 1997D

The solid VV is 40 cm high and the horizontal cross sections are circular disks. The table below gives the diameters of the cross sections in centimeters at 10 cm intervals. Use the trapezoidal rule to estimate the volume of VV.

height010203040
diameter24161064
Hint

See Section 1.11.2 in the

CLP-2 text. To set up the volume integral, see Example 1.6.6 in the

CLP-2 text. Note the dimensions given for the cross sections are diameters, not radii.

Answer

1720π5403.5 cm31720\pi\approx 5403.5\ {\rm cm}^3

Full solution

Let f(x)f(x) denote the diameter at height xx. As in Example 1.6.6 of the

CLP-2 text, we slice VV into thin horizontal “pancakes”, which in this case are circular.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

  • We are told that the pancake at height xx is a circular disk of diameter f(x)f(x) and so

  • has cross-sectional area π(f(x)2)2\pi\big(\frac{f(x)}{2}\big)^2 and thickness dx\dee{x} and hence

  • has volume π(f(x)2)2dx\pi\big(\frac{f(x)}{2}\big)^2\dee{x}.

Hence the volume of VV is

040π[f(x)2]2dxπ410[12f(0)2+f(10)2+f(20)2+f(30)2+12f(40)2]=π410[12242+162+102+62+1242]=688×2.5π=1720π5403.5\begin{align*} \int_0^{40}\pi\Big[\frac{f(x)}{2}\Big]^2\,\dee{x} &\approx \frac{\pi}{4}10\Big[\half f(0)^2+f(10)^2+f(20)^2+f(30)^2+\half f(40)^2\Big]\\ &=\frac{\pi}{4}10\Big[\half 24^2+16^2+10^2+6^2+\half 4^2\Big]\\ &=688\times 2.5\pi =1720\pi\approx 5403.5 \end{align*}

where we have approximated the integral using the trapezoidal rule with Δx=10\De x=10, and used a calculator to get a decimal approximation.

Q14Stage 2Past exam · 1996D

A 66 metre long cedar log has cross sections that are approximately circular. The diameters of the log, measured at one metre intervals, are given below:

metres from left end of log0123456
diameter in metres1.210.80.8111.2

Use Simpson's Rule to estimate the volume of the log.

Hint

See Section 1.11.3 in the

CLP-2 text, and compare to Question 13. Note the table gives diameters, not radii.

Answer

π12(16.72)4.377 m3\displaystyle\frac{\pi}{12}(16.72)\approx4.377\ {\rm m}^3

Full solution

Let f(x)f(x) be the diameter a distance xx from the left end of the log. If we slice our log into thin disks, the disks xx metres from the left end of the log has

  • radius f(x)2\frac{f(x)}{2},

  • width dx\dee{x}, and so

  • volume π(f(x)2)2 dx=π4f(x)2 dx\pi\left(\frac{f(x)}{2}\right)^2~\dee{x}=\frac{\pi}{4}f(x)^2~\dee{x}.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Using Simpson's Rule with Δx=1\De x=1, the volume of the log is:

V=06π4f(x)2dxπ413[f(0)2+4f(1)2+2f(2)2+4f(3)2+2f(4)2+4f(5)2+f(6)2]=π12[1.22+4(1)2+2(0.8)2+4(0.8)2+2(1)2+4(1)2+1.22]=π12(16.72)4.377 m3\begin{align*} V=\int_0^6 \frac{\pi}{4}f(x)^2\,\dee{x} &\approx\frac{\pi}{4}\frac{1}{3} \Big[f(0)^2+4f(1)^2+2f(2)^2+4f(3)^2+2f(4)^2+4f(5)^2+f(6)^2\Big]\\ &=\frac{\pi}{12} \Big[1.2^2+4(1)^2+2(0.8)^2+4(0.8)^2+2(1)^2+4(1)^2+1.2^2\Big]\\ &=\frac{\pi}{12}(16.72)\\ &\approx4.377\ {\rm m}^3 \end{align*}

where we used a calculator to approximate the decimal value.

Q15Stage 2Past exam · 1998A

The circumference of an 8 metre high tree at different heights above the ground is given in the table below. Assume that all horizontal cross-sections of the tree are circular disks.

height (metres)02468
circumference (metres)1.21.11.30.90.2

Use Simpson's rule to approximate the volume of the tree.

Hint

See §1.11.3 in the

CLP-2 text. To set up the volume integral, see Example 1.6.6 in the

CLP-2 text, or Question 14.

Note that the table gives the circumference, not radius, of the tree at a given height.

Answer

12.946π0.6865 m3\dfrac{12.94}{6\pi} \approx0.6865\ {\rm m}^3

Full solution

At height xx metres, let the circumference of the tree be c(x)c(x). The corresponding radius is c(x)2π\dfrac{c(x)}{2\pi}, so the corresponding cross-sectional area is π(c(x)2π)2=c(x)24π\pi\left(\dfrac{c(x)}{2\pi}\right)^2=\dfrac{c(x)^2}{4\pi}.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

The height of a very thin cross-sectional disk is dx\dee{x}, so the volume of a cross-sectional disk is c(x)24π dx\dfrac{c(x)^2}{4\pi}~\dee{x}. Therefore, total volume of the tree is:

08c(x)24πdx14π23[c(0)2+4c(2)2+2c(4)2+4c(6)2+c(8)2]=16π[1.22+4(1.1)2+2(1.3)2+4(0.9)2+0.22]=12.946π0.6865\begin{align*} \int_0^8 \frac{c(x)^2}{4\pi}\,\dee{x} &\approx \frac{1}{4\pi}\frac{2}{3}\Big[c(0)^2+4c(2)^2+2c(4)^2+4c(6)^2+c(8)^2\Big]\cr &=\frac{1}{6\pi}\Big[1.2^2+4(1.1)^2+2(1.3)^2+4(0.9)^2+0.2^2\Big]\\ &=\frac{12.94}{6\pi} \approx0.6865 \end{align*}

where we used Simpson's rule with Δx=2\De x = 2 and n=4n=4 to approximate the value of the integral based on the values of c(x)c(x) given in the table.

Q16Stage 2Past exam · 2001A

By measuring the areas enclosed by contours on a topographic map, a geologist determines the cross sectional areas AA in m2\mathrm{m}^2 of a 6060 m high hill. The table below gives the cross sectional area A(h)A(h) at various heights hh. The volume of the hill is V=060A(h)dhV=\int_0^{60} A(h)\,\dee{h}.

hh0102030405060
AA10,2009,2008,0007,1004,5002,400100
  1. If the geologist uses the Trapezoidal Rule to estimate the volume of the hill, what will be their estimate, to the nearest 1,000m3\mathrm{m}^3?

  2. What will be the geologist's estimate of the volume of the hill if they use Simpson's Rule instead of the Trapezoidal Rule?

Answer

(a) 363,500 (b) 367,000

Full solution

For both approximations, Δx=10\De x = 10 and n=6n=6.

(a) The Trapezoidal Rule gives

V=060A(h)dh10[12A(0)+A(10)+A(20)+A(30)+A(40)+A(50)+12A(60)]=363,500\begin{align*} V&=\int_0^{60} A(h)\,\dee{h} \approx 10\Big[\half A(0)+A(10)+A(20)+A(30)+A(40)+A(50)+\half A(60)\Big] \\ &=\text{363,500} \end{align*}

(b) Simpson's Rule gives

V=060A(h)dh103[A(0)+4A(10)+2A(20)+4A(30)+2A(40)+4A(50)+A(60)]=367,000\begin{align*} V&=\int_0^{60} A(h)\,\dee{h} \approx \frac{10}{3}\Big[A(0)+4A(10)+2A(20)+4A(30)+2A(40)+4A(50)+A(60)\Big]\\ &=\text{367,000} \end{align*}
Q17Stage 2Past exam · 2013A

The graph below applies to both parts (a) and (b).

Figure from prob_s1.11, line 897

Figure from prob_s1.11, line 897

  1. Use the Trapezoidal Rule, with n=4n = 4, to estimate the area under the graph between x=2x = 2 and x=6x = 6. Simplify your answer completely.

  2. Use Simpson's Rule, with n=4n = 4, to estimate the area under the graph between x=2x = 2 and x=6x = 6.

Answer

(a) 492\dfrac{49}{2} (b) 773\dfrac{77}{3}

Full solution

Call the curve in the graph y=f(x)y=f(x). It looks like

f(2)=3f(3)=8f(4)=7f(5)=6f(6)=4\begin{align*} f(2)=3 \qquad f(3)=8 \qquad f(4)=7 \qquad f(5)=6 \qquad f(6)=4 \end{align*}

We're estimating 26f(x) dx\int_2^6 f(x)~\dee{x} with n=4n=4, so Δx=624=1\De x = \frac{6-2}{4}=1.

(a) The trapezoidal rule gives

T4=[32+8+7+6+42]×1=492\begin{align*} T_4=\left[\frac{3}{2}+ 8+7+ 6+\frac{4}{2}\right]\times 1=\frac{49}{2} \end{align*}

(b) Simpson's rule gives

S4=13[3+4×8+2×7+4×6+4]×1=773\begin{align*} S_4=\frac{1}{3}\big[3+4\times 8+2\times 7+4\times 6+4\big]\times 1 =\frac{77}{3} \end{align*}

In Questions 18 through 24, we practice finding error bounds for our approximations.

Q18Stage 2Past exam · 2016Q4

The integral 11sin(x2)dx\displaystyle\int_{-1}^{1} \sin(x^2) \, \dee{x} is estimated using the Midpoint Rule with 10001000 intervals. Show that the absolute error in this approximation is at most 21062\cdot 10^{-6}.

You may use the fact that when approximating abf(x)dx\int_a^b f(x) \, \dee{x} with the Midpoint Rule using nn points, the absolute value of the error is at most M(ba)3/24n2M(b-a)^3/24n^2 when f(x)M\left|f''(x)\right|\leq M for all x[a,b]x\in[a,b].

Hint

The main step is to find an appropriate value of MM. It is not necessary to find the smallest possible MM.

Answer

Let f(x)=sin(x2)f(x) = \sin(x^2). Then f(x)=2xcos(x2)f'(x) = 2x \cos(x^2) and

f(x)=2cos(x2)4x2sin(x2).f''(x) = 2\cos(x^2) - 4x^2\sin(x^2).

Since x21|x^2|\le1 when x1|x|\leq 1, and sinθ1\left|\sin\theta\right|\le1 and cosθ1\left|\cos\theta\right|\leq 1 for all θ\theta, we have

2cos(x2)4x2sin(x2)2cos(x2)+4x2sin(x2)2×1+4×1×1=2+4=6\begin{align*} \left|2\cos(x^2) - 4x^2\sin(x^2)\right| \le 2|\cos(x^2)| + 4x^2|\sin(x^2)| \le 2\times 1 +4\times 1\times 1 = 2+4 = 6 \end{align*}

We can therefore choose M=6M=6, and it follows that the error is at most

M[ba]324n26[1(1)]32410002=2106=2106\begin{align*} \frac{M[b-a]^3}{24n^2} \le \frac{6\cdot [1-(-1)]^3}{24 \cdot 1000^2} = \frac{2}{10^6} = 2\cdot 10^{-6} \end{align*}
Full solution

Let f(x)=sin(x2)f(x) = \sin(x^2). Then f(x)=2xcos(x2)f'(x) = 2x \cos(x^2) and

f(x)=2cos(x2)4x2sin(x2).f''(x) = 2\cos(x^2) - 4x^2\sin(x^2).

Since x21|x^2|\le1 when x1|x|\leq 1, and sinθ1\left|\sin\theta\right|\le1 and cosθ1\left|\cos\theta\right|\leq 1 for all θ\theta, we have

2cos(x2)4x2sin(x2)2cos(x2)+4x2sin(x2)2×1+4×1×1=2+4=6\begin{align*} \left|2\cos(x^2) - 4x^2\sin(x^2)\right| \le 2|\cos(x^2)| + 4x^2|\sin(x^2)| \le 2\times 1 +4\times 1\times 1 = 2+4 = 6 \end{align*}

We can therefore choose M=6M=6, and it follows that the error is at most

M[ba]324n26[1(1)]32410002=2106=2106\begin{align*} \frac{M[b-a]^3}{24n^2} \le \frac{6\cdot [1-(-1)]^3}{24 \cdot 1000^2} = \frac{2}{10^6} = 2\cdot 10^{-6} \end{align*}
Q19Stage 2Past exam · 2016Q4

The total error using the midpoint rule with nn subintervals to approximate the integral of f(x)f(x) over [a,b][a,b] is bounded by M(ba)3(24n2)\dfrac{M (b-a)^3}{(24n^2)}, if f(x)M|f''(x)| \le M for all axba \le x \le b.

Using this bound, if the integral 212x4dx\displaystyle\int_{-2}^{1} 2x^4 \,\dee{x} is approximated using the midpoint rule with 6060 subintervals, what is the largest possible error between the approximation M60M_{60} and the true value of the integral?

Hint

The main step is to find MM. This question is unusual in that its wording requires you to find the smallest possible allowed MM.

Answer

3100\dfrac{3}{100}

Full solution

Setting f(x)=2x4f(x) = 2 x^4 and ba=1(2)=3b-a = 1-(-2)=3, we compute f(x)=24x2f''(x) = 24x^2. The largest value of 24x224x^2 on the interval [2,1][-2,1] occurs at x=2x=-2, so we can take M=24(2)2=96M = 24\cdot(-2)^2=96. Thus the total error for the midpoint rule with n=60n=60 points is bounded by

M(ba)324n2=96×3324×60×60=3100\begin{align*} \frac{M (b-a)^3}{24n^2} = \frac{96 \times 3^3}{24 \times 60 \times 60} = \frac{3}{100} \end{align*}

That is: we are guaranteed our absolute error is certainly no more (This is what the error bound always tells us.) than 3100\frac{3}{100}, and using the bound stated in the problem we cannot give a better guarantee. (The second part of the previous sentence comes from the fact that we used the smallest possible MM: if we had used a larger value of MM, we would still have some true statement about the error, for example “the error is no more than 5100\frac{5}{100}," but it would not be the best true statement we could make.)

Q20Stage 2Past exam · 2016A

Both parts of this question concern the integral I=02(x3)5dxI = \displaystyle\int_{0}^{2} (x-3)^5\,\dee{x}.

  1. Write down the Simpson's Rule approximation to II with n=6n=6. Leave your answer in calculator-ready form.

  2. Which method of approximating II results in a smaller error bound: the Midpoint Rule with n=100n=100 intervals, or Simpson's Rule with n=10n=10 intervals? You may use the formulas

    EMM(ba)324n2andESL(ba)5180n4,\begin{align*} |E_M| \le \frac{M(b-a)^3}{24n^2} \qquad\text{and}\qquad |E_S| \le \frac{L(b-a)^5}{180n^4}, \end{align*}

    where MM is an upper bound for f(x)|f''(x)| and LL is an upper bound for f(4)(x)|f^{(4)}(x)|, and EME_M and ESE_S are the absolute errors arising from the midpoint rule and Simpson's rule, respectively.

Hint

The main steps in part (b) are to find the smallest possible values of MM and LL.

Answer

(a) 1/33((3)5+4(133)5+2(233)5+4(2)5+2(433)5+4(533)5+(1)5)\dfrac{1/3}3 \Big( (-3)^5 + 4\Big( \frac13-3 \Big)^5 + 2\Big( \frac23-3 \Big)^5 + 4(-2)^5 + 2\Big( \frac43-3 \Big)^5 + 4\Big( \frac53-3 \Big)^5 + (-1)^5 \Big)

(b) Simpson's Rule results in a smaller error bound.

Full solution

(a) Since a=0a=0, b=2b=2 and n=6n=6, we have Δx=ban=206=13\Delta x=\frac{b-a}{n}=\frac{2-0}6 = \frac{1}{3}, and so x0=0x_0=0, x1=13x_1=\frac{1}{3}, x2=23x_2=\frac{2}{3}, x3=1x_3=1, x4=43x_4=\frac{4}{3}, x5=53x_5=\frac{5}{3}, and x6=2x_6=2. Since Simpson's Rule with n=6n=6 in general is

Δx3[f(x0)+4f(x1)+2f(x2)+4f(x3)+2f(x4)+4f(x5)+f(x6)],\begin{align*} \frac{\Delta x}3 \big[ f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + 2f(x_4) + 4f(x_5) + f(x_6) \big], \end{align*}

the desired approximation is

1/33((3)5+4(133)5+2(233)5+4(2)5+2(433)5+4(533)5+(1)5)\begin{align*} \frac{1/3}3 \bigg( (-3)^5 + 4\Big( \frac13-3 \Big)^5 + 2\Big( \frac23-3 \Big)^5 + 4(-2)^5 + 2\Big( \frac43-3 \Big)^5 + 4\Big( \frac53-3 \Big)^5 + (-1)^5 \bigg) \end{align*}

(b) Here f(x)=(x3)5f(x) = (x-3)^5, which has derivatives

f(x)=5(x3)4f(x)=20(x3)3f(3)(x)=60(x3)2f(4)(x)=120(x3).\begin{align*} f'(x) &= 5(x-3)^4 & f''(x) &= 20(x-3)^3 \\ f^{(3)}(x) &= 60(x-3)^2 & f^{(4)}(x) &= 120(x-3). \end{align*}

For 0x20\le x\le 2, (x3)(x-3) runs from 3-3 to 1-1, so the maximum absolute values are found at x=0x=0, giving M=20033=540M= 20\cdot|0-3|^3=540 and L=12003=360L=120\cdot|0-3|=360. Consequently, for the Midpoint Rule with n=100n=100,

EMM(ba)324n2=540×2324×104=180104;\begin{align*} |E_M| \le \frac{M(b-a)^3}{24n^2} = \frac{540 \times 2^3}{24 \times 10^4} = \frac{180}{10^4}; \end{align*}

whereas for Simpson's Rule with n=10n=10,

ES360×25180×104=64104.\begin{align*} |E_S| \le \frac{360 \times 2^5 }{180 \times 10^4} = \frac{64}{10^4}. \end{align*}

Since 64<18064<180, Simpson's Rule results in a smaller error bound.

Q21Stage 2Past exam · M105 2013A

Find a bound for the error in approximating 151xdx\displaystyle\int_1^5 \frac{1}{x}\,\dee{x} using Simpson's rule with n=4n = 4. Do not write down the Simpson's rule approximation S4S_4.

In general the error in approximating abf(x) dx\int_a^b f(x)\ \dee{x} using Simpson's rule with nn steps is bounded by L(ba)180(Δx)4\dfrac{L(b-a)}{180}(\De x)^4 where Δx=ban\De x=\dfrac{b-a}{n} and Lf(4)(x)L\ge |f^{(4)}(x)| for all axba\le x\le b.

Hint

As usual, the biggest part of this problem is finding LL. Don't be thrown off by the error bound being given slightly differently from Theorem 1.11.12 in the CLP-2 text: these expressions are equivalent, since Δx=ban\De x = \frac{b-a}{n}.

Answer

815\dfrac{8}{15}

Full solution

In general the error in approximating abf(x) dx\int_a^b f(x)\ \dee{x} using Simpson's rule with nn steps is bounded by L(ba)180(Δx)4\frac{L(b-a)}{180}(\De x)^4 where Δx=ban\De x=\frac{b-a}{n} and Lf(4)(x)L\ge |f^{(4)}(x)| for all axba\le x\le b. In this case, a=1a=1, b=5b=5, n=4n=4 and f(x)=1xf(x)=\frac{1}{x}. We need to find LL, so we differentiate.

f(x)=1x2f(x)=2x3f(3)(x)=6x4f(4)(x)=24x5\begin{align*} f'(x)=-\frac{1}{x^2}\qquad f''(x)=\frac{2}{x^3}\qquad f^{(3)}(x)=-\frac{6}{x^4}\qquad f^{(4)}(x)=\frac{24}{x^5} \end{align*}

and

f(4)(x)24 for all x1\begin{align*} \big|f^{(4)}(x)\big|\le 24\text{ for all }x\ge 1 \end{align*}

So we may take L=24L=24 and Δx=514=1\De x=\frac{5-1}{4}=1, which leads to

Error 24(51)180(1)4=2445=815\begin{align*} |\text{Error }|\le \frac{24(5-1)}{180}(1)^4=\frac{24}{45}=\frac{8}{15} \end{align*}
Q22Stage 2Past exam · M105 2012A

Find a bound for the error in approximating

01(e2x+3x3)dx\begin{equation*} \int_0^1 \big(e^{-2x}+3x^3\big)\,\dee{x} \end{equation*}

using Simpson's rule with n=6n = 6. Do not write down the Simpson's rule approximation SnS_n.

In general, the error in approximating abf(x) dx\int_a^b f(x)\ \dee{x} using Simpson's rule with nn steps is bounded by L(ba)180(Δx)4\dfrac{ L(b-a)}{180}(\De x)^4 where Δx=ban\De x=\dfrac{b-a}{n} and Lf(4)(x)L\ge |f^{(4)}(x)| for all axba\le x\le b.

Hint

The function e2x=1e2xe^{-2x} = \dfrac{1}{e^{2x}} is positive and decreasing, so its maximum occurs when xx is as small as possible.

Answer

1180×34=114580\displaystyle\frac{1}{180\times 3^4} =\frac{1}{14580}

Full solution

In general, the error in approximating abf(x) dx\int_a^b f(x)\ \dee{x} using Simpson's rule with nn steps is bounded by L(ba)180(Δx)4\displaystyle\frac{L(b-a)}{180}(\De x)^4 where Δx=ban\De x=\dfrac{b-a}{n} and Lf(4)(x)L\ge |f^{(4)}(x)| for all axba\le x\le b. In this case, a=0a=0, b=1b=1, n=6n=6 and f(x)=e2x+3x3f(x)=e^{-2x}+3x^3. We need to find LL, so we differentiate.

f(x)=2e2x+9x2f(x)=4e2x+18xf(3)(x)=8e2x+18f(4)(x)=16e2x\begin{align*} f'(x)=-2e^{-2x}+9x^2\qquad f''(x)=4e^{-2x}+18x\qquad f^{(3)}(x)=-8e^{-2x}+18\qquad f^{(4)}(x)= 16 e^{-2x} \end{align*}

Since e2x=1e2xe^{-2x} = \dfrac{1}{e^{2x}}, we see f(4)(x)f^{(4)}(x) is a positive, decreasing function. So, its maximum occurs when xx is as small as possible. In the interval [0,1][0,1], that means x=0x=0.

f(4)(x)f(0)=16 for all x0\begin{align*} \big|f^{(4)}(x)\big|\le f(0)=16\text{ for all }x\ge 0 \end{align*}

So, we take L=16L=16 and Δx=106=16\De x=\frac{1-0}{6}=\frac{1}{6}.

Error L(ba)180(Δx)4=16(10)180(1/6)4=16180×64=1180×34=114580\begin{align*} |\text{Error }|\le \frac{L(b-a)}{180}(\De x)^4=\frac{16(1-0)}{180}(1/6)^4 =\frac{16}{180\times 6^4} =\frac{1}{180\times 3^4} =\frac{1}{14580} \end{align*}
Q23Stage 2Past exam · 2012A

Let I=12(1/x)dxI=\displaystyle\int_1^2 (1/x)\,\dee{x}.

  1. Write down the trapezoidal approximation T4T_4 for II. You do not need to simplify your answer.

  2. Write down the Simpson's approximation S4S_4 for II. You do not need to simplify your answer.

  3. Without computing II, find an upper bound for IS4|I - S_4|. You may use the fact that if f(4)(x)L\big|f^{(4)}(x)\big|\le L on the interval [a,b][a, b], then the error in using SnS_n to approximate abf(x)dx\int_a^b f(x)\,\dee{x} has absolute value less than or equal to L(ba)5/180n4L(b-a)^5/180n^4.

Answer

(a) T4=14[(12×1)+45+23+47+(12×12)]\displaystyle T_4 =\frac{1}{4}\left[\left(\frac{1}{2}\times 1\right)+\frac{4}{5}+\frac{2}{3}+ \frac{4}{7}+\left(\frac{1}{2}\times\frac{1}{2}\right)\right],

(b) S4=112[1+(4×45)+(2×23)+(4×47)+12]\displaystyle S_4 =\frac{1}{12}\left[1+\left(4\times\frac{4}{5}\right)+\left(2\times \frac{2}{3}\right)+\left(4\times \frac{4}{7}\right)+\frac{1}{2}\right]

(c) IS424180×44=11920\displaystyle\Big|I -S_4\Big| \le \frac{24}{180\times 4^4}=\frac{1}{1920}

Full solution

For both approximations, a=1a=1, b=2b=2, n=4n=4, f(x)=1xf(x)=\frac{1}{x} and Δx=ban=14\De x=\frac{b-a}{n}=\frac{1}{4}.

Then x0=1x_0 = 1, x1=54x_1=\frac{5}{4}, x2=32x_2 = \frac{3}{2}, x3=74x_3=\frac{7}{4}, and x4=2x_4=2.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

(a)

T4=Δx[12f(x0)+f(x1)+f(x2)+f(x3)+12f(x4)]=Δx[12f(1)+f(5/4)+f(3/2)+f(7/4)+12f(2)]=14[(12×1)+45+23+47+(12×12)]\begin{alignat*}{3} T_4&=&\De x&\left[\frac{1}{2}f(x_0)+f(x_1)+f(x_2)+f(x_3)+\frac{1}{2}f(x_4)\right]\\ &=&\De x&\left[\frac{1}{2}f(1)+f(5/4)+f(3/2)+f(7/4)+\frac{1}{2}f(2)\right]\\ &=&\frac{1}{4}&\left[\left(\frac{1}{2}\times 1\right)+\frac{4}{5}+\frac{2}{3}+ \frac{4}{7}+\left(\frac{1}{2}\times\frac{1}{2}\right)\right] \end{alignat*}

(b)

S4=Δx3[f(x0)+4f(x1)+2f(x2)+4f(x3)+f(x4)]=Δx3[f(1)+4f(5/4)+2f(3/2)+4f(7/4)+f(2)]=112[1+(4×45)+(2×23)+(4×47)+12]\begin{align*} S_4&=\frac{\De x}{3}\big[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+f(x_4)\big]\\ &=\frac{\De x}{3}\big[f(1)+4f(5/4)+2f(3/2)+4f(7/4)+f(2)\big]\\ &=\frac{1}{12}\left[1+\left(4\times\frac{4}{5}\right)+\left(2\times \frac{2}{3}\right)+\left(4\times \frac{4}{7}\right)+\frac{1}{2}\right] \end{align*}

(c) In this case, a=1a=1, b=2b=2, n=4n=4 and f(x)=1xf(x)=\frac{1}{x}. We need to find LL, so we differentiate.

f(x)=1x2f(x)=2x3f(3)(x)=6x4f(4)(x)=24x5\begin{align*} f'(x)=-\frac{1}{x^2}\qquad f''(x)=\frac{2}{x^3}\qquad f^{(3)}(x)=-\frac{6}{x^4}\qquad f^{(4)}(x)=\frac{24}{x^5} \end{align*}

So,

f(4)(x)24 for all x in the interval [1,2]\begin{align*} \big|f^{(4)}(x)\big|\le 24\text{ for all }x\text{ in the interval } [1,2] \end{align*}

We take L=24L=24.

Error L(ba)5180×n424(21)5180×44=24180×44=11920\begin{align*} |\text{Error }|\le \frac{L(b-a)^5}{180\times n^4} \le \frac{24(2-1)^5}{180\times 4^4}=\frac{24}{180\times 4^4}=\frac{1}{1920} \end{align*}
Q24Stage 2Past exam · M121 2000A

A function s(x)s(x) satisfies s(0)=1.00664s(0)=1.00664, s(2)=1.00543s(2)=1.00543, s(4)=1.00435s(4)=1.00435, s(6)=1.00331s(6)=1.00331, s(8)=1.00233s(8)=1.00233. Also, it is known to satisfy s(k)(x)k1000\big|s^{(k)}(x)\big|\le \dfrac{k}{1000} for 0x80\le x\le 8 and all positive integers kk.

  1. Find the best Trapezoidal Rule and Simpson's Rule approximations that you can for I=08s(x) dx\displaystyle I=\int_0^8 s(x)\ \dee{x}.

  2. Determine the maximum possible sizes of errors in the approximations you gave in part (a). Recall that if a function f(x)f(x) satisfies f(k)(x)Kk\big|f^{(k)}(x)\big|\le K_k on [a,b][a,b], then

    abf(x) dxTnK2(ba)312n2andabf(x) dxSnK4(ba)5180n4\begin{equation*} \bigg|\int_a^b f(x)\ \dee{x} -T_n\bigg|\le \frac{K_2(b-a)^3}{12n^2} \quad\hbox{and}\quad \bigg|\int_a^b f(x)\ \dee{x} -S_n\bigg|\le \frac{K_4(b-a)^5}{180n^4} \end{equation*}
Hint

The “best ... approximations that you can" means using the maximum number of intervals, given the information available.

The final sentence in part (b) is just a re-statement of the error bounds we're familiar with from Theorem 1.11.12 in the CLP-2 text. The information s(k)(x)k1000\big|s^{(k)}(x)\big|\le \dfrac{k}{1000} gives you values of MM and LL when you set k=2k=2 and k=4k=4, respectively.

Answer

(a) T4=8.03515T_4=8.03515, S48.03509S_4\approx 8.03509

(b) abf(x) dxTn210008312(4)20.00533\displaystyle\Big|\int_a^b f(x)\ \dee{x} -T_n\Big| \le \frac{2}{1000}\frac{8^3}{12(4)^2} \le0.00533, abf(x) dxSn4100085180(4)40.00284\displaystyle\Big|\int_a^b f(x)\ \dee{x} -S_n\Big| \le \frac{4}{1000}\frac{8^5}{180(4)^4}\le0.00284

Full solution

Set a=0a=0 and b=8b=8. Since we have information about s(x)s(x) when xx is 0, 2, 4, 6, and 8, we set Δx=ban=2\De x=\frac{b-a}{n}=2, so n=4n=4. (Recall with the trapezoid rule and Simpson's rule, n=4n=4 intervals actually uses the value of the function at 5 points.)

We could perform the trapezoidal approximations with fewer intervals, for example n=2n=2, but this would involve ignoring some of the points we're given. Since the question asks for the best estimation we can give, we use n=4n=4 intervals and no fewer.

  1. T4=Δx[12s(0)+s(2)+s(4)+s(6)+12s(8)]=2[1.006642+1.00543+1.00435+1.00331+1.002332]=8.03515S4=Δx3[s(0)+4s(2)+2s(4)+4s(6)+s(8)]=23[1.00664+4×1.00543+2×1.00435+4×1.00331+1.00233]8.03509\begin{align*} T_4&={\De x}\left[\frac{1}{2}s(0)+s(2)+s(4)+s(6)+\frac{1}{2}s(8)\right]\\ &=2\left[\frac{1.00664}{2}+1.00543+ 1.00435+1.00331+ \frac{1.00233}{2}\right]\\ &=8.03515 \\ S_4&=\frac{\De x}{3}\big[s(0)+4s(2)+2s(4)+4s(6)+s(8)\big]\\ &=\frac{2}{3}\big[1.00664+4\times 1.00543+2\times 1.00435+4\times1.00331+ 1.00233\big]\\ &\approx 8.03509 \end{align*}
  2. The information s(k)(x)k1000\big|s^{(k)}(x)\big|\le \dfrac{k}{1000}, with k=2k=2, tells us s(x)21000|s''(x)|\leq \frac{2}{1000} for all xx in the interval [0,8][0,8]. So, we take K2K_2 (also called MM in your text) to be 21000\frac{2}{1000}.

    Then the absolute error associated with our trapezoid rule approximation is at most

    abf(x) dxTnK2(ba)312n2210008312(4)20.00533\begin{alignat*}{3} \bigg|\int_a^b f(x)\ \dee{x} -T_n\bigg|&\le \frac{K_2(b-a)^3}{12n^2} &&\le \frac{2}{1000}\cdot\frac{8^3}{12(4)^2} &\le 0.00533 \end{alignat*}

    For k=4k=4, we see s(4)(x)41000|s^{(4)}(x)|\leq \frac{4}{1000} for all xx in the interval [0,8][0,8]. So, we take K4K_4 (also called LL in your text) to be 41000\frac{4}{1000}.

    Then the absolute error associated with our Simpson's rule approximation is at most

    abf(x) dxSnK4(ba)5180n44100085180(4)40.00284\begin{alignat*}{3} \bigg|\int_a^b f(x)\ \dee{x} -S_n\bigg|&\le \frac{K_4(b-a)^5}{180n^4} &&\le \frac{4}{1000}\cdot\frac{8^5}{180(4)^4} &\le0.00284 \end{alignat*}
Q25Stage 2Past exam · 2014A

Consider the trapezoidal rule for making numerical approximations to abf(x) dx\displaystyle\int_a^b f(x)\ \dee{x}. The error for the trapezoidal rule satisfies ETM(ba)312n2|E_T| \le \dfrac{ M(b - a)^3}{12n^2} , where f(x)M|f''(x)| \le M for axba \le x \le b. If 2<f(x)<0-2 < f''(x) < 0 for 1x41 \le x \le 4, find a value of nn to guarantee the trapezoidal rule will give an approximation for 14f(x) dx\displaystyle\int_1^4 f(x)\ \dee{x} with absolute error, ET|E_T|, less than 0.0010.001.

Hint

Set the error bound to be less than 0.0010.001, then solve for nn.

Answer

Any n68n\ge 68 works.

Full solution

In this case, a=1a=1, b=4b=4. Since 2f(x)0-2 \leq f''(x) \leq 0 over the relevant interval, we take M=2M=2. (Remember MM is an upper bound on f(x)|f''(x)|, not f(x)f''(x).) So we need nn to obey

2(41)312n20.001    n22(3)3121000=270006=90002=4500\begin{align*} \frac{ 2(4 - 1)^3}{12n^2} \le 0.001 \iff n^2\ge \frac{2(3)^3}{12} 1000 =\frac{27000}{6}=\frac{9000}{2}=4500 \end{align*}

One obvious allowed nn is 100100. Since 450067.01\sqrt{4500} \approx 67.01, and nn has to be a whole number, any n68n\ge 68 works.

3Stage 3Application

Further than practice: several ideas at once, or an unfamiliar situation.

Q26Stage 3Past exam · 1996A

A swimming pool has the shape shown in the figure below. The vertical cross-sections of the pool are semi-circular disks. The distances in feet across the pool are given in the figure at 2–foot intervals along the sixteen–foot length of the pool. Use Simpson's Rule to estimate the volume of the pool.

Figure from prob_s1.11, line 1411

Figure from prob_s1.11, line 1411

Hint

See Section 1.11.3 in the

CLP-2 text. To set up the volume integral, see Example 1.6.2 in the

CLP-2 text.

Since the cross-sections of the pool are semi-circular disks, a section that is dd metres across will have area 12π(d2)2\frac{1}{2}\pi\left(\frac{d}{2}\right)^2 square feet. Based on the drawing, you may assume the very ends of the pool have distance 0 feet across.

Answer

4723494 ft3\dfrac{472}{3}\approx 494 \ {\rm ft}^3

Full solution

Denote by f(x)f(x) the width of the pool xx feet from the left-hand end. From the sketch, f(0)=0f(0)=0, f(2)=10f(2)=10, f(4)=12f(4)=12, f(6)=10f(6)=10, f(8)=8f(8)=8, f(10)=6f(10)=6, f(12)=8f(12)=8, f(14)=10f(14)=10 and f(16)=0f(16)=0.

A cross-section of the pool xx feet from the left end is half of a circular disk with diameter f(x)f(x) (so, radius f(x)2\frac{f(x)}{2}) and thickness dx\dee{x}. So, the volume of the part of the pool with xx–coordinate running from xx to (x+dxx+\dee{x}) is 12π(f(x)2)2dx=π8[f(x)]2dx\half\pi\big(\frac{f(x)}{2}\big)^2\,\dee{x} = \frac{\pi}{8}[f(x)]^2\,\dee{x}.

The total volume is given by the following integral.

V=π8016f(x)2dxπ8Δx3[f(0)2+4f(2)2+2f(4)2+4f(6)2+2f(8)2+4f(10)2+2f(12)2+4f(14)2 ⁣+f(16)2]=π823[0+4(10)2+2(12)2+4(10)2+2(8)2+4(6)2+2(8)2+4(10)2+0]=4723π494 ft3\begin{align*} V&=\frac{\pi}{8}\int_0^{16}f(x)^2\,\dee{x}\cr &\approx\frac{\pi}{8}\cdot\frac{\De x}{3} \Big[f(0)^2+4f(2)^2+2f(4)^2+4f(6)^2+2f(8)^2 +4f(10)^2+2f(12)^2+4f(14)^2\!+f(16)^2\Big]\cr &=\frac{\pi}{8}\cdot\frac{2}{3} \Big[0+4(10)^2+2(12)^2+4(10)^2+2(8)^2 +4(6)^2+2(8)^2+4(10)^2+0\Big]\cr &=\frac{472}{3}\pi\approx 494 \ {\rm ft}^3 \end{align*}
Q27Stage 3Past exam · 2002A,M121 2002A

A piece of wire 1m long with radius 1mm is made in such a way that the density varies in its cross-section, but is radially symmetric (that is, the local density g(r)g(r) in kg/m3{\rm kg/m^3} depends only on the distance rr in mm from the centre of the wire). Take as given that the total mass WW of the wire in kg is given by

W=2π10601rg(r)dr\begin{align*} W=2\pi 10^{-6}\int_0^1 rg(r)\,\dee{r} \end{align*}

Data from the manufacturer is given below:

rr01/41/23/41
g(r)g(r)80518100814481708190
  1. Find the best Trapezoidal Rule approximation that you can for WW based on the data in the table.

  2. Suppose that it is known that g(r)<200|g'(r)|<200 and g(r)<150|g''(r)|<150 for all values of rr. Determine the maximum possible size of the error in the approximation you gave in part (a). Recall that if a function f(x)f(x) satisfies f(x)M|f''(x)|\le M on [a,b][a,b], then

    ITnM(ba)312n2\begin{align*} |I-T_n|\le\frac{M(b-a)^3}{12n^2} \end{align*}

    where I=abf(x)dxI=\int_a^b f(x)\,\dee{x} and TnT_n is the Trapezoidal Rule approximation to II using nn subintervals.

Hint

See Example 1.11.14 in the

CLP-2 text.

Don't get caught up in the interpretation of the integral. It's nice to see how integrals can be used, but for this problem, you're still just approximating the integral given, and bounding the error.

When you find the second derivative to bound your error, pay attention to the difference between the integrand and g(r)g(r).

Answer

(a) 0.0256350.025635 (b) 1.8×1051.8\times 10^{-5}

Full solution

(a) The Trapezoidal Rule with n=4n=4, a=0a=0, b=1b=1, and Δx=14\De x = \frac{1}{4} gives:

W=2π10601rg(r)dr2π106Δx[12x0g(x0)+x1g(x1)+x2g(x2)+x3g(x3)+12x4g(x4)]=2π106 14[120g(0)+14g(14)+12g(12)+34g(34)+12g(1)]=π106 12[81004+81442+381704+81902]=32639π41060.025635\begin{align*} W=2\pi 10^{-6}\int_0^1 rg(r)\,\dee{r} &\approx 2\pi 10^{-6}\De x\left[\frac{1}{2}x_0g(x_0)+x_1g(x_1)+x_2g(x_2)+x_3g(x_3)+ \frac{1}{2}x_4g(x_4)\right]\\ &=2\pi 10^{-6}\ \frac{1}{4} \Big[\frac{1}{2} 0g(0)+\frac{1}{4}g\Big(\frac{1}{4}\Big) +\frac{1}{2}g\Big(\frac{1}{2}\Big)+\frac{3}{4}g\Big(\frac{3}{4}\Big) +\frac{1}{2} g(1)\Big] \\ &=\pi 10^{-6}\ \frac{1}{2} \Big[\frac{8100}{4} +\frac{8144}{2}+\frac{3\cdot 8170}{4} +\frac{8190}{2} \Big] \\ & = \frac{32639\pi}{4\cdot 10^6}\approx 0.025635 \end{align*}

(b) Using the product rule, the integrand f(r)=2π106rg(r)f(r)=2\pi 10^{-6} rg(r) obeys

f(r)=2π106ddr[g(r)+rg(r)]=2π106[2g(r)+rg(r)]\begin{align*} f''(r)=2\pi 10^{-6} \diff{}{r}\big[g(r)+ rg'(r)\big] =2\pi 10^{-6} \big[2g'(r)+ rg''(r)\big] \end{align*}

and hence, for 0r10\le r\le 1,

f(r)2π106[2×200+1×150]=1.1π103\begin{align*} \big|f''(r)\big|\le 2\pi 10^{-6} \big[2\times200 + 1\times 150\big] =1.1\pi 10^{-3} \end{align*}

So,

Error1.1π103(10)312(4)21.8×105\begin{align*} |\text{Error}|\le \frac{1.1\pi 10^{-3}(1-0)^3}{12(4)^2} \le1.8\times 10^{-5} \end{align*}
Q28Stage 3Past exam · 1997A

Simpson's rule can be used to approximate log2\log 2, since log2=121xdx\displaystyle\log 2=\int_1^2\frac{1}{x}\,\dee{x}.

  1. Use Simpson's rule with 6 subintervals to approximate log2\log 2.

  2. How many subintervals are required in order to guarantee that the absolute error is less than 0.000010.00001?

    Note that if EnE_n is the error using nn subintervals, then EnL(ba)5180n4|E_n|\le\dfrac{L(b-a)^5}{180n^4} where LL is the maximum absolute value of the fourth derivative of the function being integrated and aa and bb are the end points of the interval.

Hint

See Example 1.11.15 in the

CLP-2 text. You'll want to use a calculator for the approximation in (a), and for finding the appropriate number of intervals in (b). Remember that Simpson's rule requires an even number of intervals.

Answer

(a) 0.6931698\approx 0.6931698 (b) n12n\ge 12 with nn even

Full solution

(a) Let f(x)=1xf(x)=\frac{1}{x}, a=1a=1, b=2b=2 and Δx=ba6=16\De x=\frac{b-a}{6}=\frac{1}{6}. Using Simpson's rule:

121x dxΔx3[f(1)+4f(76)+2f(86)+4f(96)+2f(106)+4f(116)+f(2)]=118[1+247+128+249+1210+2411+12]0.6931698\begin{align*} \int_1^2\frac{1}{x}\ \dee{x} &\approx \frac{\De x}{3}\Big[ f(1)+4f\Big(\frac{7}{6}\Big)+2f\Big(\frac{8}{6}\Big) +4f\Big(\frac{9}{6}\Big)+2f\Big(\frac{10}{6}\Big) +4f\Big(\frac{11}{6}\Big)+f(2)\Big]\\ &= \frac{1}{18}\Big[ 1+\frac{24}{7}+\frac{12}{8}+\frac{24}{9}+\frac{12}{10}+\frac{24}{11} +\frac{1}{2}\Big]\approx 0.6931698 \end{align*}

(b) The integrand is f(x)=1xf(x)=\frac{1}{x}. The first four derivatives of f(x)f(x) are:

f(x)=1x2,f(x)=2x3,f(3)(x)=6x4,f(4)(x)=24x5f'(x)=-\frac{1}{x^2}, \qquad f''(x)=\frac{2}{x^3}, \qquad f^{(3)}(x)=-\frac{6}{x^4}, \qquad f^{(4)}(x)=\frac{24}{x^5}

On the interval 1x21\le x\le 2, the fourth derivative is never bigger in magnitude than L=24L=24.

EnL(ba)5180n4=24(21)5180n4=430n4\begin{align*}|E_n|&\le\frac{L(b-a)^5}{180n^4} =\frac{24(2-1)^5}{180n^4} =\frac{4}{30n^4}\end{align*}

So, we want an even number nn such that

430n40.00001=1105n4400003n400003410.7\begin{align*}\frac{4}{30n^4} &\leq 0.00001 = \frac{1}{10^5}\\ n^4 & \geq \frac{40000}{3}\\ n&\geq \sqrt[4]{\frac{40000}{3}}\approx 10.7\end{align*}

So, any even number greater than or equal to 12 will do.

Q29Stage 3Past exam · 1997D

Let I=02cos(x2) dxI={\displaystyle\int_0^2}\cos(x^2)\ \dee{x} and let SnS_n be the Simpson's rule approximation to II using nn subintervals.

  1. Estimate the maximum absolute error in using S8S_8 to approximate II.

  2. How large should nn be in order to ensure that ISn0.0001|I-S_n|\le 0.0001?

Note: The graph of f(x)f''''(x), where f(x)=cos(x2)f(x)=\cos(x^2), is shown below. The absolute error in the Simpson's rule approximation is bounded by L(ba)5180n4\dfrac{L(b-a)^5}{180n^4} when f(x)L|f''''(x)|\le L on the interval [a,b][a,b].

Figure from prob_s1.11, line 1623

Figure from prob_s1.11, line 1623

Hint

See Example 1.11.15 in the

CLP-2 text.

Rather than calculating the fourth derivative of the integrand, use the graph to find the largest absolute value it attains over our interval.

Answer

(a) 0.013450.01345 (b) n28n\ge 28 with nn even

Full solution

(a) From the figure, we see that the magnitude of f(x)|f''''(x)| never exceeds 310 for 0x20\le x\le 2. So, the absolute error is bounded by

310(20)5180×840.01345\begin{align*} \frac{310(2-0)^5}{180\times 8^4}\le 0.01345 \end{align*}

(b) We want to choose nn such that:

310(20)5180×n4104n4310×25180104n10310×32180427.2\begin{align*} \frac{310(2-0)^5}{180\times n^4}&\le 10^{-4}\\ n^4&\ge \frac{310\times 2^5}{180}10^4\\ n&\ge 10\sqrt[4]{\frac{310\times 32}{180}}\approx27.2 \end{align*}

For Simpson's rule, nn must be even, so any even integer obeying n28n\ge28 will guarantee us the requisite accuracy.

Q30Stage 3Past exam · 2000D

Define a function f(x)f(x) and an integral II by

f(x)=0x2sin(t)dt,I=01f(t)dt\begin{align*} f(x)=\int_0^{x^2}\sin(\sqrt{t})\,\dee{t},\qquad I=\int_0^1 f(t)\,\dee{t} \end{align*}

Estimate how many subdivisions are needed to calculate II to five decimal places of accuracy using the trapezoidal rule.

Note that if EnE_n is the error using nn subintervals, then EnM(ba)312n212|E_n|\le\dfrac{M(b-a)^3}{12n^2\vphantom{\frac{1}{2}}}, where MM is the maximum absolute value of the second derivative of the function being integrated and aa and bb are the limits of integration.

Hint

See Example 1.11.14 in the

CLP-2 text.

You'll have to differentiate f(x)f(x). To that end, you may also want to review the fundamental theorem of calculus and, in particular, Example 1.3.5 in the

CLP-2 text.

You don't have to find the best possible value for MM. A reasonable upper bound on f(x)|f''(x)| will do.

To have five decimal places of accuracy, your error must be less than 0.000005. This ensures that, if you round your approximation to five decimal places, they will all be correct.

Answer

n259n\ge 259

Full solution

Let g(x)=0xsin(t)dtg(x)=\displaystyle\int_0^x\sin(\sqrt{t})\,\dee{t}. By the Fundamental Theorem of Calculus Part 1, g(x)=sin(x)g'(x)= \sin(\sqrt{x}). By its definition, f(x)=g(x2)f(x)=g(x^2), so we use the chain rule to differentiate f(x)f(x).

f(x)=2xg(x2)=2xsinxf(x)=2sinx+2xcosx\begin{align*} f'(x)=2xg'(x^2)=2x\sin x\qquad\qquad f''(x)=2\sin x+2x\cos x \end{align*}

Since sinx,cosx1|\sin x|,|\cos x|\le 1, we have f(x)2+2x|f''(x)|\le 2+2|x| and, for 0t10\le t\le 1, f(t)4|f''(t)|\le 4. When the trapezoidal rule with nn subintervals is applied, the resulting error EnE_n obeys

En4(10)312n2=13n2\begin{align*}E_n&\le\frac{4(1-0)^3}{12n^2}=\frac{1}{3n^2}\end{align*}

We want an integer nn such that

13n20.000005n2412×0.000005n13×0.000005258.2\begin{align*}\frac{1}{3n^2}&\le 0.000005\\ n^2&\ge \frac{4}{12\times 0.000005}\\ n&\ge\sqrt{ \frac{1}{3\times 0.000005}} \approx258.2\end{align*}

Any integer n259n \geq 259 will do.

Q31Stage 3

Let f(x)f(x) be a function (For example, f(x)=16x312x2+(1+x)logx+1f(x)=\frac{1}{6}x^3-\frac{1}{2}x^2+(1+x)\log|x+1| will do, but you don't need to know what f(x)f(x) is for this problem.) with f(x)=x2x+1f''(x) = \dfrac{x^2}{x+1}.

  1. Show that f(x)1|f''(x)| \leq 1 whenever xx is in the interval [0,1][0,1].

  2. Find the maximum value of f(x)|f''(x)| over the interval [0,1][0,1].

  3. Assuming M=1M=1, how many intervals should you use to approximate 01f(x) dx\displaystyle\int_{0}^{1}f(x)~\dee{x} to within 10510^{-5}?

  4. Using the value of MM you found in (b), how many intervals should you use to approximate 01f(x) dx\displaystyle\int_0^1 f(x)~\dee{x} to within 10510^{-5}?

Hint

To find the maximum value of f(x)|f''(x)|, check its critical points and endpoints.

Answer

(a) When 0x10 \leq x \leq1, then x21x^2 \leq 1 and x+11x+1 \geq 1, so f(x)=x2x+111=1|f''(x)| = \dfrac{x^2}{|x+1|}\leq \dfrac{1}{1}=1.
(b) 12\dfrac{1}{2} (c) n65n \geq 65 (d) n46n \geq 46

Full solution
  1. When 0x10 \leq x \leq1, then x21x^2 \leq 1 and x+11x+1 \geq 1, so f(x)=x2x+111=1|f''(x)| = \dfrac{x^2}{|x+1|}\leq \dfrac{1}{1}=1.

  2. To find the maximum value of a function over a closed interval, we test the function's values at the endpoints of the interval and at its critical points inside the interval. The critical points are where the function's derivative is zero or does not exist.

    The function we're trying to maximize is f(x)=x2x+1=x2x+1=f(x)|f''(x)| = \frac{x^2}{|x+1|} = \frac{x^2}{x+1}=f''(x) (since our interval only contains nonnegative numbers). So, the critical points occur when f(x)=0f'''(x) = 0 or does not exist. We find f(x)f'''(x) Using the quotient rule.

    f(x)=(x+1)(2x)x2(x+1)2=x2+2x(x+1)20=x(x+2)x+10=xorx=1orx=2\begin{align*} f'''(x)&=\frac{(x+1)(2x)-x^2}{(x+1)^2}=\frac{x^2+2x}{(x+1)^2}\\ 0&=\frac{x(x+2)}{x+1}\\ 0&=x \quad\text{or}\quad x=-1\quad\text{or}\quad x=-2 \end{align*}

    The only critical point in [0,1][0,1] is x=0x=0. So, the extrema of f(x)f''(x) over [0,1][0,1] will occur at its endpoints. Indeed, since f(x)0f'''(x) \geq 0 for all xx in [0,1][0,1], f(x)f''(x) is increasing over this interval, so its maximum occurs at x=1x=1. That is,

    f(x)f(1)=12|f''(x)|\leq f''(1)=\frac{1}{2}
  3. The absolute error using the midpoint rule is at most M(ba)324n2\dfrac{M(b-a)^3}{24n^2}. Using M=1M=1, if we want this to be no more than 10510^{-5}, we find an acceptable value of nn with the following calculation:

    M(ba)324n2105124n2105(ba=1,M=1)10524n2n65\begin{align*} \dfrac{M(b-a)^3}{24n^2}&\leq 10^{-5}\\ \dfrac{1}{24n^2}&\leq 10^{-5}&(b-a=1,\,M=1)\\ \frac{10^5}{24} & \leq n^2\\ n & \geq 65 \end{align*}
  4. The absolute error using the midpoint rule is at most M(ba)324n2\dfrac{M(b-a)^3}{24n^2}. Using M=12M=\frac{1}{2}, if we want this to be no more than 10510^{-5}, we find an acceptable value of nn with the following calculation:

    M(ba)324n2105148n2105(ba=1,M=12)10548n2n46\begin{align*} \dfrac{M(b-a)^3}{24n^2}&\leq 10^{-5}\\ \dfrac{1}{48n^2}&\leq 10^{-5}&(b-a=1,\,M=\frac{1}{2})\\ \frac{10^5}{48} & \leq n^2\\ n & \geq 46 \end{align*}

Remark: how accurate you want to be in these calculations depends a lot on your circumstances. Imagine, for instance, that you were finding MM by hand, using this to find nn by hand, then programming a computer to evaluate the approximation. For a simple integral like this, the difference between computing time for 65 intervals versus 46 is likely to be miniscule. So, there's not much to be gained by the extra work in (b). However, if your original sloppy MM gave you something like n=1000000n=1000000, you might want to put some time into improving it, to shorten computation time. Moreover, if you were finding the approximation by hand, the difference between adding 46 terms and adding 65 terms would be considerable, and you would probably want to put in the effort up front to find the most accurate MM possible.

Q32Stage 3

Approximate the function logx\log x with a rational function by approximating the integral 1x121t dt\displaystyle\int_1^{x\vphantom{\frac{1}{2}}} \frac{1}{t}~\dee{t} using Simpson's rule. Your rational function f(x)f(x) should approximate logx\log x with an error of not more than 0.1 for any xx in the interval [1,3][1,3].

Hint

In using Simpson's rule to approximate 1x121t dt\displaystyle\int_1^{x\vphantom{\frac{1}{2}}} \frac{1}{t}~\dee{t} with nn intervals, a=1a=1, b=xb=x, and Δx=x1n\De x = \dfrac{x-1}{n}.

Answer

x112[1+16x+3+4x+1+163x+1+1x]\displaystyle\frac{x-1}{12}\left[1+\frac{16}{x+3}+\frac{4}{x+1}+\frac{16}{3x+1}+\frac{1}{x}\right]

Full solution

Before we can take our Simpson's rule approximation of 1x1t dt\displaystyle\int_1^x \dfrac{1}{t}~\dee{t}, we need to know how many intervals to use. That means we need to bound our error, which means we need to bound d4dt4{1t}\ddiff{4}{}{t}\left\{\frac{1}{t}\right\}.

ddt{1t}=1t2d2dt2{1t}=2t3d3dt3{1t}=6t4d4dt4{1t}=24t5\begin{align*} \diff{}{t}\left\{\frac{1}{t}\right\}&=-\frac{1}{t^2}& \ddiff{2}{}{t}\left\{\frac{1}{t}\right\}&=\frac{2}{t^3}\\ \ddiff{3}{}{t}\left\{\frac{1}{t}\right\}&=-\frac{6}{t^4}& \ddiff{4}{}{t}\left\{\frac{1}{t}\right\}&=\frac{24}{t^5} \end{align*}

So, over the interval [1,3][1,3], d4dt4{1t}24\displaystyle\left|\ddiff{4}{}{t}\left\{\frac{1}{t}\right\}\right| \leq 24.

Now, we can find an appropriate nn to ensure our error will be be less than 0.1 for any xx in [1,3][1,3]:

L(ba)5180n4<0.124(x1)5180n4<110n4>24(x1)518\begin{align*}\frac{L(b-a)^5}{180 n^4}&<0 .1 \\\frac{24(x-1)^5}{180 n^4}&< \frac{1}{10} \\n^4 &> \frac{24\cdot (x-1)^5}{18}\end{align*}

Because x12x-1 \leq 2 for every xx in [1,3][1,3], if n4>242518n^4 > \dfrac{24\cdot 2^5}{18}, then n4>24(x1)518n^4 > \dfrac{24\cdot (x-1)^5}{18} for every allowed xx.

n4>242518=1283n>128342.6\begin{align*}n^4&> \frac{24\cdot 2^5}{18}= \frac{128}{3}\\ n&>\sqrt[4]{\frac{128}{3}}\approx 2.6\end{align*}

Since nn must be even, n=4n=4 is enough intervals to guarantee our error is not too high for any xx in [1,3][1,3]. Now we find our Simpson's rule approximation with n=4n=4, a=1a=1, b=xb=x, and Δx=x14\Delta x = \dfrac{x-1}{4}. The points where we evaluate 1t\frac{1}{t} are:

x0=1x1=1+x14x2=1+2x14x3=1+3x14x4=1+4x14=x+34=x+12=3x+14=x\begin{align*} x_0 =& 1 & x_1&=1+ \frac{x-1}{4}& x_2&=1+2\frac{x-1}{4}& x_3&=1+3\frac{x-1}{4}& x_4&=1+4\frac{x-1}{4}\\ & & &=\frac{x+3}{4}& &=\frac{x+1}{2}&&=\frac{3x+1}{4}& &=x \end{align*}

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

logx=1x1t dtΔx3[1x0+4x1+2x2+4x3+1x4]=x112[1+16x+3+4x+1+163x+1+1x]=f(x)\begin{align*} \log x=\int_1^x \frac{1}{t}~\dee{t}&\approx \frac{\De x}{3}\left[\frac{1}{x_0}+\frac{4}{x_1}+\frac{2}{x_2}+\frac{4}{x_3}+\frac{1}{x_4}\right]\\ &=\frac{x-1}{12}\left[1+\frac{16}{x+3}+\frac{4}{x+1}+\frac{16}{3x+1}+\frac{1}{x}\right]\\ &=f(x) \end{align*}

Below is a graph of our approximation f(x)f(x) and natural logarithm on the same axes. The natural logarithm function is shown red and dashed, while our approximating function is solid blue. Our approximation appears to be quite accurate for small, positive values of xx.

Figure from prob_s1.11, line 2

Figure from prob_s1.11, line 2

Q33Stage 3

Using an approximation of the area under the curve 1x2+1\dfrac{1}{x^2+1}, show that the constant arctan2\arctan2 is in the interval [π4+0.321,π4+0.323]\left[\dfrac{\pi}{4}+0.321,\, \dfrac{\pi}{4}+0.323\right].

You may assume use without proof that d4dx4{11+x2}=24(5x410x2+1)(x2+1)5\displaystyle\ddiff{4}{}{x}\left\{\frac{1}{1+x^2}\right\} = \dfrac{24(5x^4-10x^2+1)}{(x^2+1)^5}. You may use a calculator, but only to add, subtract, multiply, and divide.

Hint
  • 1211+x2 dx=arctan(2)π4\int_1^2 \frac{1}{1+x^2}~\dee{x} = \arctan(2) - \frac{\pi}{4}, so arctan(2)=π4+1211+x2 dx\arctan(2) = \frac{\pi}{4}+\int_1^2 \frac{1}{1+x^2}~\dee{x}

  • If an approximation AA of the integral 1211+x2 dx\int_1^2 \frac{1}{1+x^2}~\dee{x} has error at most ε\varepsilon, then Aε1211+x2 dxA+εA-\varepsilon \leq \int_1^2 \frac{1}{1+x^2}~\dee{x} \leq A+\varepsilon.

  • Looking at our target interval will tell you how small ε\varepsilon needs to be, which in turn will tell you how many intervals you need to use.

  • You can show, by considering the numerator and denominator separately, that f(4)(x)30.75|f^{(4)}(x)| \leq 30.75 for every xx in [1,2][1,2].

  • If you use Simpson's rule to approximate 1211+x2 dx\int_1^2 \frac{1}{1+x^2}~\dee{x}, you won't need very many intervals to get the requisite accuracy.

Answer

Note: for more detail, see the solutions.

First, we use Simpson's rule with n=4n=4 to approximate 1211+x2dx\int_1^2 \frac{1}{1+x^2}\,\dee{x}. The choice of this method (what we're approximating, why n=4n=4, etc.) is explained in the solutions–here, we only show that it works.

1211+x2dx112[12+6441+813+6465+15]0.321748\int_1^2 \frac{1}{1+x^2}\,\dee{x} \approx\frac{1}{12}\left[ \frac{1}{2} + \frac{64}{41}+\frac{8}{13}+\frac{64}{65}+\frac{1}{5} \right]\approx 0.321748

For ease of notation, define A=0.321748A=0.321748.

Now, we bound the error associated with this approximation. Define N(x)=24(5x410x2+1)N(x) = 24(5x^4-10x^2+1) and D(x)=(x2+1)5D(x) = (x^2+1)^5, so N(x)/D(x)N(x)/D(x) gives the fourth derivative of 11+x2\frac{1}{1+x^2}. When 1x21 \le x \le 2, N(x)N(2)=984|N(x)| \le N(2)=984 (because N(x)N(x) is increasing over that interval) and D(x)D(1)=25|D(x)| \geq D(1) = 2^5 (because D(x)D(x) is also increasing over that interval), so d4dx4{11+x2}=N(x)D(x)98425=30.75\left| \ddiff{4}{}{x}\left\{\frac{1}{1+x^2}\right\}\right| = \left| \frac{N(x)}{D(x)}\right| \leq \frac{984}{2^5}=30.75. Now we find the error bound for Simpson's rule with L=30.75L=30.75, b=2b=2, a=1a=1, and n=4n=4.

1211+x2dxA=errorL(ba)5180n4 =30.7518044<0.00067\left| \int_1^2 \frac{1}{1+x^2}\,\dee{x} - A\right| =|\text{error}| \leq \frac{L(b-a)^5}{180\cdot n^4}\ =\frac{30.75}{180\cdot 4^4}<0.00067

So,

0.00067<1211+x2dxA<0.00067A0.0067<1211+x2dx<A+0.00067A0.00067<arctan(2)arctan(1)<A+0.00067A0.00067<arctan(2)π4<A+0.00067π4+A0.00067<arctan(2)<π4+A+0.00067π4+0.3217480.00067<arctan(2)<π4+0.321748+0.00067π4+0.321078<arctan(2)<π4+0.322418π4+0.321<arctan(2)<π4+0.323\begin{align*} -0.00067 &&<&& \int_1^2 \frac{1}{1+x^2}\,\dee{x} - A &&<&& 0.00067\\ A-0.0067 &&<&& \int_1^2 \frac{1}{1+x^2}\,\dee{x} &&<&& A+0.00067\\ A-0.00067 &&<&& \arctan(2)-\arctan(1) &&<&& A+0.00067\\ A-0.00067 &&<&& \arctan(2)-\frac{\pi}{4} &&<&& A+0.00067\\ \frac{\pi}{4}+A-0.00067 &&<&& \arctan(2) &&<&&\frac{\pi}{4}+ A+0.00067\\ \frac{\pi}{4}+0.321748-0.00067 &&<&& \arctan(2) &&<&&\frac{\pi}{4}+0.321748+0.00067\\ \frac{\pi}{4}+0.321078 &&<&& \arctan(2) &&<&&\frac{\pi}{4}+0.322418\\ \frac{\pi}{4}+0.321 &&<&& \arctan(2) &&<&&\frac{\pi}{4}+0.323 \end{align*}

This was the desired bound.

Full solution

First, we want a strategy for approximating arctan2\arctan 2. Our hints are that involves integrating 11+x2\dfrac{1}{1+x^2}, which is the antiderivative of arctangent, and the number π4\dfrac{\pi}{4}, which is the same as arctan(1)\arctan(1). With that in mind:

1211+x2 dx=arctan(2)arctan(1)=arctan(2)π4So, arctan(2)=π4+1211+x2 dx\begin{align*}\int_1^2 \frac{1}{1+x^2}~\dee{x}& = \arctan(2) - \arctan(1) = \arctan(2) - \frac{\pi}{4}\\ \text{So, }\qquad \arctan(2) &= \frac{\pi}{4} + \int_1^2 \frac{1}{1+x^2}~\dee{x}\tag{$*$}\end{align*}

We won't know the value of the integral exactly, but we'll have an approximation AA bounded by some positive error bound ε\varepsilon. Then,

ε(1211+x2 dxA)εAε(1211+x2 dx)A+εSo, from (), π4+Aεarctan(2)π4+A+ε\begin{align*}- \varepsilon &\leq \left(\int_1^2 \frac{1}{1+x^2}~\dee{x} - A\right) \leq \varepsilon\\ A - \varepsilon &\leq \left(\int_1^2 \frac{1}{1+x^2}~\dee{x}\right) \leq A + \varepsilon\\ \text{So, from (}*\text{), }\qquad \frac{\pi}{4}+A-\varepsilon& \leq \arctan(2) \leq \frac{\pi}{4}+A+\varepsilon\end{align*}

Which approximation should we use? We're given the fourth derivative of 11+x2\dfrac{1}{1+x^2}, which is the derivative we need for Simpson's rule. Simpson's rule is also usually quite efficient, and we're very interested in not adding up dozens of terms, so we choose Simpson's rule.

Now that we've chosen Simpson's rule, we should decide how many intervals to use. In order to bound our error, we need to find a bound for the fourth derivative. To that end, define N(x)=24(5x410x2+1)N(x) = 24(5x^4-10x^2+1). Then N(x)=24(20x320x)=480x(x21)N'(x) = 24(20x^3-20x)= 480x(x^2-1), which is positive over the interval [1,2][1,2]. So, N(x)N(2)=24(5241022+1)=984N(x) \leq N(2)=24(5\cdot 2^4 - 10\cdot 2^2+1)=984 when 1x21 \leq x \leq 2. Furthermore, let D(x)=(x2+1)5D(x)=(x^2+1)^5. If 1x21 \leq x \leq 2, then D(x)25D(x) \geq 2^5. Now we can find a reasonable value of LL:

f(4)(x)=24(5x410x2+1)(x2+1)5=N(x)D(x)98425=1234=30.75\begin{align*} |f^{(4)}(x)|&=\left|\frac{24(5x^4-10x^2+1)}{(x^2+1)^5}\right| = \left|\frac{N(x)}{D(x)}\right| \leq \frac{984}{2^5} = \frac{123}{4} = 30.75 \end{align*}

So, we take L=30.75L=30.75.

We want [π4+Aε,π4+A+ε]\left[\dfrac{\pi}{4}+A-\varepsilon ,\, \dfrac{\pi}{4}+A+\varepsilon \right] to look something like [π4+0.321,π4+0.323]\left[\dfrac{\pi}{4}+0.321,\, \dfrac{\pi}{4}+0.323\right]. Note ε\varepsilon is half the length of the first interval. Half the length of the second interval is 0.001=110000.001 = \frac{1}{1000}. So, we want a value of ε\varepsilon that is no larger than this. Now we can find our nn:

L(ba)5180n41100030.75180n411000n430.75×1000180n3075018043.62\begin{align*} \dfrac{L(b-a)^5}{180\cdot n^4} &\leq \frac{1}{1000}\\ \dfrac{30.75}{180\cdot n^4} &\leq \frac{1}{1000}\\ n^4 & \geq \frac{30.75\times 1000}{180}\\ n & \geq \sqrt[4]{\frac{30750}{180}}\approx 3.62 \end{align*}

So, we choose n=4n=4), and are guaranteed that the absolute error in our approximation will be no more than 30.7518044<0.00067\dfrac{30.75}{180\cdot 4^4} < 0.00067.

Since n=4n=4, then Δx=ban=14\De x = \dfrac{b-a}{n}=\dfrac{1}{4}, so:

x0=1x1=54x2=32x3=74x4=2x_0 = 1 \qquad x_1=\frac{5}{4} \qquad x_2 = \frac{3}{2} \qquad x_3 = \frac{7}{4} \qquad x_4=2

Now we can find our Simpson's rule approximation AA:

0111+x2 dxΔx3[f(x0)+4f(x1)+2f(x2)+4f(x3)+f(x4)]=1/43[f(1)+4f(5/4)+2f(3/2)+4f(7/4)+f(2)]=112[11+1+425/16+1+29/4+1+449/16+1+14+1]=112[12+41625+16+249+4+41649+16+15]=112[12+6441+813+6465+15]0.321748=A\begin{align*} \int_0^1 \frac{1}{1+x^2}~\dee{x}&\approx \frac{\De x}{3}\big[ f(x_0) + 4f(x_1)+2f(x_2)+4f(x_3)+f(x_4) \big]\\ &=\frac{1/4}{3}\big[ f(1) + 4f(5/4)+2f(3/2)+4f(7/4)+f(2) \big]\\ &=\frac{1}{12}\left[ \frac{1}{1+1} + \frac{4}{25/16+1}+\frac{2}{9/4+1}+\frac{4}{49/16+1}+\frac{1}{4+1} \right]\\ &=\frac{1}{12}\left[ \frac{1}{2} + \frac{4\cdot 16}{25+16}+\frac{2\cdot 4}{9+4}+\frac{4\cdot 16}{49+16}+\frac{1}{5} \right]\\ &=\frac{1}{12}\left[ \frac{1}{2} + \frac{64}{41}+\frac{8}{13}+\frac{64}{65}+\frac{1}{5} \right]\\ &\approx 0.321748=A \end{align*}

As we saw before, the error associated with this approximation is at most 30.7518044<0.00067=ε\dfrac{30.75}{180\cdot 4^4} < 0.00067=\varepsilon. So,

Aε1211+x2 dxA+ε0.3217480.000671211+x2 dx0.321748+0.000670.3210781211+x2 dx0.3224180.3211211+x2 dx0.323π4+0.3211211+x2 dx+π4π4+0.323π4+0.321arctan(2)π4+0.323\begin{alignat*}{5} &A-\varepsilon \quad&&\leq\quad && \int_1^2\frac{1}{1+x^2}~\dee{x} &\leq \quad &A+\varepsilon&\\ \Rightarrow\qquad&0.321748 - 0.00067 \quad&&\leq\quad && \int_1^2\frac{1}{1+x^2}~\dee{x} \quad &\leq \quad &0.321748 + 0.00067&\\ \Rightarrow\qquad&0.321078 &&\leq\quad & &\int_1^2\frac{1}{1+x^2}~\dee{x}\quad &\leq \quad &0.322418&\\ \Rightarrow\qquad&0.321 &&\leq\quad &&\int_1^2\frac{1}{1+x^2}~\dee{x}\quad &\leq \quad &0.323& \\\Rightarrow\qquad&\frac{\pi}{4}+0.321 && \leq\quad &&\int_1^2\frac{1}{1+x^2}~\dee{x}+\frac{\pi}{4}\quad &\leq \quad &\frac{\pi}{4}+0.323& \\\\\Rightarrow\qquad&\frac{\pi}{4}+0.321 && \leq\quad &&\arctan(2) &\leq \quad &\frac{\pi}{4}+0.323& \end{alignat*}

This is precisely what we wanted to show.

My list

nothing marked yet

Loading…

Open the whole list →

Your tutor can open this list with you. It follows your account, so it is there on whichever device you study on.

From the UBC Math 101 open textbook project, © Joel Feldman, Andrew Rechnitzer, Elyse Yeager and others. Licensed CC BY-NC-SA 4.0; this HTML adaptation is released under the same licence. Full attribution.