# Propagation of Error in Evaluating Functions

Let $y = f(x)$ be a single variable function, and suppose that we wanted to evaluate $f$ at $x_A$ instead of $x_T$ possibly because: evaluating $f(x_T)$ could be difficult; we may not actually know $x_T$ but rather know that $x_A$ is close to $x_T$ with some error; or evaluating $f(x_A)$ may be more practical. We will now examine the error and relative error of using $f(x_A)$ to approximate $f(x_T)$.

Suppose that $f$ is differentiable for $x \in [a, b]$ and suppose that $x_A, x_T \in [a, b]$. Then for some $\xi$ between $x_T$ and $x_A$ we have that:

(1)Multiplying both sides of the equation by $x_T - x_A$ and we get that:

(2)If $x_T \approx x_A$ ($x_T$ is very close to $x_A$) then we have that $\xi$ will be very close to both $x_T$ and $x_A$ (since $\xi$ is between $x_T$ and $x_A$ by the Mean Value Theorem), and so:

(3)Thus we have the following approximations for the error between $f(x_A)$ and $f(x_T)$.

(4)We can also derive a formula to approximate the relative error between $f(x_A)$ and $f(x_T)$. Noting that $\mathrm{Error} (f(x_A)) \approx f'(x_T) (x_T - x_A)$, then we have that:

(5)Let's look at some examples of applying the formulas above.

## Example 1

**Let $f(x) = 2\sqrt{x} + x^2$. Let $x_A = 2.995$ and $x_T = 3$. Approximate the error of using $f(2.995)$ to approximate $f(3)$.**

If we differentiate $f(x)$ we get that $f'(x) = \frac{1}{\sqrt{x}} + 2x$. Applying the first error formula by letting $\xi = x_T$ and we get that:

(6)Applying the second error formula by letting $\xi = x_A$ and we get that:

(7)The values above tell us the approximate errors associated with using $f(x_A)$ to approximate $f(x_T)$ with $\xi = x_T$ and $\xi = x_A$ respectively.