0

I have be given a set of points $(-3.0, -2.8, -2.6, -2.4, -2.2, -2.0)$ and a function $f(x)=e^{x/3} + x^2$ and asked to find the bound for the error in each case. I already find $f'(x)$ for each point but I don't know how we should find the bound for the error

(a) Determine as accurately as possible approximations for each entry in the following table. (hint: employ the formulas for numerical differentiation) $$\begin{array}{ccc}\hline x & f(x) & f'(x)\\\hline -3.0 & 9.3678 & \\ -2.8 & 8.2332 & \\ -2.6 & 7.1803 & \\ -2.4 & 6.2093 & \\ -2.2 & 5.3203 & \\ -2.0 & 4.5134 & \\\hline \end{array}$$ (b) Given that $f(x)=e^{x/3}+x^2$ find the bound for the error in each case.

GO VEGAN
  • 429
  • 3
  • 12
  • 1
    Depends what the differentiation scheme is, but they are basically all based on Taylor's theorem with Lagrange remainder when dealing with smooth functions. – Ian Jan 16 '21 at 17:28
  • As the function is given explicitly is part (b), we can calculate the exact values of derivatives and calculate the error in each case. – Houssam Jan 16 '21 at 17:40

1 Answers1

0

If you want to keep the error $O(h^2)$, you have presumably used centered finite differences for the inner points and something like $$ f'_i \approx \dfrac{\mp (3 f_i - 4 f_{i\pm 1} + f_{i\pm2})}{2h} $$ for the first and last points. In this case, since you are given the exact expression for $f$, you can compute the exact value of the error.

The result, using the process I described is $$ \left( \begin{array}{cccc} -3 & 9.3678 & -5.87725 & 1.2352\times 10^{-4} \\ -2.8 & 8.2332 & -5.46875 & 1.6976\times 10^{-4} \\ -2.6 & 7.1803 & -5.05975 & 1.33205\times 10^{-4} \\ -2.4 & 6.2093 & -4.65 & 2.23679\times 10^{-4} \\ -2.2 & 5.3203 & -4.23975 & 1.48233\times 10^{-4} \\ -2 & 4.5134 & -3.82925 & 3.8904\times 10^{-4} \\ \end{array} \right) $$

If you do not want to depend on the expression of $f$ and want to use informations like $\displaystyle \max_{x\in[-3,-2]}|f'''(x)| < 0.02 $, you get get error bounds, instead of the actual error. For instance, for the interior points $$ \left| f'(x_i)-\dfrac{f(x_{i+1})-f(x_{i-1})}{2h}\right|=\frac{h^2}{6}|f'''(\xi)|< \frac{0.2^2}{6}\times 0.02 = 1.33333\times 10^{-4} $$

The apparent contradiction of having the actual error sometimes larger then the error bound is explained by the fact that the values in the table are not exact.

PierreCarre
  • 20,974
  • 1
  • 18
  • 34