Skip to main content

Exercises 2.5 Exercises

1.
Modify the code in Section 2.2 to verify numerically that the approximation of \(f'(x_0)\) given by the formula
\begin{equation*} \frac{f(x_0-2h)-8f(x_0-h)+8f(x_0+h)-f(x_0+2h)}{12h} \end{equation*}
is of order 4, namely the truncation error goes to zero as \(h^4\text{.}\)
2.
Determine how many terms of the Taylor series of \(\log x\) (natural logarithm) at \(x=e\) one has to sum in order to evaluate \(\log 3\) with an error not larger than \(10^{-4}\text{.}\)
3.
Write the Taylor series of the function \(\cos(x)\) at \(x_0=0\) up to order 3. Use your result to evaluate \(\cos(0.3)\text{.}\) Then use the truncation error formula in Theorem 2.1.1 to estimate an upper bound for the error and verify with Python or a calculator that the upper bound is indeed not smaller than the actual error.