Interpolating data.

49 Views Asked by At

Consider the following formula

$$_{n}q_x=1-exp[-n\times _{n}m_x-.008 \times n^3 \times _{n}m_x^2]\ldots(1).$$

Page 867 of this book shows values of $_{5}q_x$ associated with $_{5}m_x$ by the above equation. One of the two successive values of $_{5}m_x$ and corresponding $_{5}q_x$ values on the table are given below:

$$ \begin{array}{c|c} _{5}m_x & _{5}q_x \\ \hline .022 & .104 \\ .023 & .109 \end{array} $$

There isn't value of $_{5}q_x$ for $_{5}m_x=.0225(=\frac{.022+.023}{2})$ in the table. I can directly use equation $(1)$ which produces $_{5}q_x=.106$.

Also, if I take the average of $.104$ and $.109$ which are corresponding $_{5}q_x$ values of $_{5}m_x=.022$ and $.023$, I come up with the same $_{5}q_x=.106$.

But equation $(1)$ is a non-linear equation. What is the reason to get the same result of $_{5}q_x$ while taking average?

1

There are 1 best solutions below

7
On

In fact, the answer is not the same, if you watch closely. $$ q(x=0.0225) \approx 0.106~854~922 $$ while $$ \frac{q(x=0.022)+q(x=0.023)}{2} \approx 0.106~852~304 $$ The function is not linear, indeed, but in this very small interval ($x=0.022 \ldots0.023$) the derivative is approximately constant and it's approximately linear.

In general, any analytic function (read: most of the functions that you encounter in day-to-day life) $f(x)$ can be written with the Taylor series $$ \begin{split} f(x) &= \sum_{n=0}^{\infty} \frac{f^{(n)(x_0)}}{n!} (x-x_0)^n \\ &= f(x_0) + f'(x_0)(x-x_0) + \frac{1}{2!}f''(x_0)(x-x_0)^2 + \frac{1}{3!}f'''(x_0)(x-x_0)^3 +\ldots \end{split} $$ $x_0$ is the starting point of the approximation. So what this means that you can approximate any analytic function with this method, by using the Taylor polynomial. And the more terms you use, the more accurate the approximation will be. And we also see that if the second and third (etc) derivatives are small, the function is essentially $$ f(x) \approx f(x_0) + f'(x_0)(x-x_0) $$ The difference is only the remaining terms, or $$ \frac{1}{2!}f''(x_0)(x-x_0)^2 + \frac{1}{3!}f'''(x_0)(x-x_0)^3 +\ldots $$ and these terms, we observed, are small compared to the first two terms. In this case they are small because $x-x_0 = 0.001$, and we raise that to the second and third powers. Let's calculate the values in order to demonstrate this. We have the function and its derivatives (notice that I simplified the equation and the notation)(note: it's easy to obtain the derivative with Wolfram Alpha) $$ q(x) = 1-\exp{\left[-5x-x^2 \right]} $$ $$ q'(x) = (2x+5)\exp{\left[ -5x - x^2 \right]} $$ $$ q''(x) = (4x^2 + 20x + 23) \exp{\left[ -5x - x^2 \right]} $$ $$ q^{(3)}(x) = (8x^3 + 60x^2 +138x+95) \exp{\left[ -5x - 0.6x^2 \right]} $$ and we can plug in $x_0=0.022$, $x=0.023$ to get the following values: \begin{equation} \begin{split} f(x_0) \approx 0.104~599 & \\ f'(x_0) \approx 4.516~401 \Rightarrow & f'(x_0)(x-x_0) \approx 0.004~516 \\ f''(x_0) \approx -20.989~925 \Rightarrow & \frac{1}{2!}f''(x_0)(x-x_0)^2 \approx 0.000~010 \\ f^{(3)}(x_0) \approx 87.807~578 \Rightarrow & \frac{1}{3!}f^{(3)}(x_0)(x-x_0)^3 \approx 0.000~000~015 \\ \end{split} \end{equation} You see how the values are getting smaller and smaller? Indeed we can approximate the function with a linear approximative function $$ q(x) \approx q(0.022) + q'(0.022)(x-0.022) $$ in the vicinity of $x\approx 0.022$, without making a large numerical error.