Skip to main content

Section 12.1 Definition of derivative and the order of error

The definition of derivative says:

\begin{equation*} f'(x) = \lim_{h\to 0} \frac{f(x+h)-f(x)}{h} \end{equation*}

This suggests a way to approximate \(f'(x)\text{:}\) take two consecutive values of \(f\text{,}\) subtract, divide by difference of x-values:

\begin{equation} f'(x) \approx \frac{f(x+h)-f(x)}{h}\label{eq-diff-f1}\tag{12.1.1} \end{equation}

Here the value of \(h\) is some concrete number, so the two sides are only approximately equal. One can express this more precisely as

\begin{equation*} \frac{f(x+h)-f(x)}{h} = f'(x) + e(h) \end{equation*}

where the error term \(e\) is a function of \(h\text{.}\) The accuracy of approximation is measured by the order of the error term, which is a number \(d\) such that \(|e(h)|\) is bounded by some multiple of \(|h|^d\text{.}\)

There is a method to determine the order of error of an approximation to some derivative of \(f\text{:}\)

  1. Let \(n= 0\)
  2. Plug \(f(x) = x^n\) into the formula and find the error term.
  3. If the error term is some nonzero multiple of a power of \(h\text{,}\) the exponent of \(h\) is the order of the error term.
  4. If the error term is zero, increase \(n\) by \(1\) and return to step 2.

Find the order of error of the formula (12.1.1).

Solution
  • With \(f(x) = x^0\) we get \(f'(x) = 0\) and \(\frac{f(x+h)-f(x)}{h}=0\text{,}\) so the error term is zero for this function.
  • With \(f(x) = x^1\) we get \(f'(x) = 1\) and \(\frac{f(x+h)-f(x)}{h}=\frac{h}{h}=1\text{,}\) so the error term is zero for this function.
  • With \(f(x) = x^2\) we get \(f'(x) = 2x\) and \(\frac{f(x+h)-f(x)}{h}=\frac{x^2+2xh+h^2-x^2}{h}=2x + h\text{,}\) so the error term for this function is \(h^1\text{.}\)

In conclusion, the formula has order of error 1.

The importance of the order of error can be illustrated by an example. Suppose we want to find \(f'(x)\) with absolute error at most \(10^{-12}\text{.}\)

  • If the error term of our formula is \(h^1\text{,}\) we need to use extremely small \(h\text{;}\) that is \(|h|\le 10^{-12}\text{.}\)
  • If the error term is \(h^2\text{,}\) we need \(|h|\le 10^{-6}\) which is still small but not as extreme.
  • If the error term is \(h^3\text{,}\) we need \(|h|\le 10^{-4}\text{.}\)
  • If the error term is \(h^4\text{,}\) we need \(|h|\le 10^{-3}\text{.}\)

Thus, a higher-order formula should allow us to obtain an accurate result while avoidung extremely small values of \(h\text{.}\) But why do we want to avoid extremely small \(h\text{?}\) This is explained in next section.