0

Suppose you wish to approximate $\displaystyle \int_{1}^{4} \ln(x)dx$ by using Trapezoidal rule. What value of n would you chose to ensure that the error in your approximation is no more than $10^{-2}$. Using: $$|E_{T}| ≤ \frac{K_{2}(b - a)^{3}}{12n^{2}}$$ Where $K = \max|f^{(2)}(x)|$

My work ,I took the second derivative and got: $f^{(2)}(x) = -1x^{-2}$ Then I figured that the max value that x can take on is 4 so I plugged that into the second derivative and got: $$f^{(2)}(4) = \frac{-1}{16}$$

Then I plugged that into the formula: $$|E_{T}| ≤ \frac{\frac{-1}{16}(4 - 1)^{3}}{12n^{2}}$$

Then I isolated that down to be $-9 <= (64n^{2})(10^{-2})$ Then to $\frac{-9}{64\cdot10^{-2}}$ Solving for $n$ I got: $$\sqrt{\frac{-9}{64\cdot10^{-2}}} = n$$

Is this incorrect, is my method flawed?

Thank you

Alexis Olson
  • 5,414
yre
  • 553
  • You can't take the square root of a negative number. – Simply Beautiful Art Mar 23 '17 at 21:19
  • If $f(x)=\log(x)$, $$K_2 = \max_{x\in[1,4]}\left|f^{(2)}(x)\right|$$ equals $1$, not $-1$. – Jack D'Aurizio Mar 23 '17 at 22:20
  • Anyway, the general error bound can be improved a lot in this specific case: details below. – Jack D'Aurizio Mar 23 '17 at 22:20
  • @JackD'Aurizio simple question I have, how did you know to use 1 and not -1? I am confused by this. Also when choosing the max aren't we suppose to choose to plug in either the lower bound or upper bound? [1.4] here in the this integral, so if we wanted the to find the min we would plug in the lower bound 1, and if for the max the upper bound 4?

    Thank you!

    – yre Mar 24 '17 at 16:07
  • @yre: the definition of $K_2$ is clear: the maximum absolute value of the second derivative on the given interval. Since the absolute value of the second derivative is $\frac{1}{x^2}$, the maximum over the given interval is $1$. There is no guessing, I am just following the very definition of $K_2$. – Jack D'Aurizio Mar 24 '17 at 16:35
  • @JackD'Aurizio I appreciate this, thank you! I am not so good at math sometimes. The interval being the one from 1 to 4, right? So if we choose 4 that would be 1/16 but if we choose 1 that would be 1/1 = 1 therefore, we choose 1 because it offers the highest return. But with the second derivative being negative wouldn't this also be -1? or -1/16 in which case -1/16 would be the higher return? – yre Mar 24 '17 at 16:49
  • @yre: if the second derivative is negative, it does not matter, since we are considering its absolute value. – Jack D'Aurizio Mar 24 '17 at 16:52
  • @JackD'Aurizio Sorry, I should have realized that. Thank you I can see clearly now. – yre Mar 24 '17 at 17:10

1 Answers1

0

$\log(x)$ is a concave function on $\mathbb{R}^+$: if we consider the interval $\left[a,a+\frac{1}{n}\right]$, the area of the region between the graph of $\log(x)$ and the secant line through $(x,\log x)$ for $x\in\left\{a,a+\frac{1}{n}\right\}$ is given by $$ \frac{(2an+1)\log\left(1+\frac{1}{na}\right)-2}{2n}\leq \frac{1}{12 a^2 n^3} $$ so the trapezoid method applied on $3n$ sub-intervals of $[1,4]$ leads to a lower bound for the integral whose error does not exceed $$ \frac{1}{12 n^3}\sum_{k=0}^{3n-1}\frac{1}{\left(1+\frac{k}{3n}\right)^2}\leq \frac{23}{144n^2} $$ hence $12$ intervals are enough to grant an approximation of $8\log(2)-3$ within an error of $10^{-2}$.
Indeed: $$ \frac{1}{4}\left[\frac{\log(4)}{2}+\sum_{k=1}^{11}\log\left(1+\frac{k}{4}\right)\right]=\color{green}{2.54}128169\ldots $$ where: $$ \int_{1}^{4}\log(x)\,dx = 8\log(2)-3 = \color{green}{2.54}517744.$$

Jack D'Aurizio
  • 353,855