4

We are given that for $x_0 = 0.5, x_1 = 0.6$ and $x_2 = 0.7$, we have $f(x_0) = 0.4794, f(x_1) = 0.5646$ and $f(x_2) = 0.6442$. Also $h = 1$.

The forward-difference formula is $f'(x) = \dfrac{f(x_i + h) - f(x_i)}{h}$ and the backward-difference formula is $f'(x) = \dfrac{f(x_i) - f(x_i - h)}{h}$ .

Now, using forward-difference for $f'(0.6)$, I get

$\displaystyle f'(0.6) = \frac{f(0.7) - f(0.6)}{0.1} = \frac{0.6442 - 0.5646}{0.1} = 0.796$.

However, when using backward-difference for $f'(0.6)$, I get

$\displaystyle f'(0.6) = \frac{f(0.6) - f(0.5)}{0.1} = \frac{0.5646 - 0.4794}{0.1} = 0.852$.

Clearly, $0.796$ and $0.852$ are not the same value.

So, what is the value for $f'(0.6)$? The answer in the back of the textbook says that it is $0.852$. Why is it $0.852$ and not $0.796$?

sudeep5221
  • 2,736
Boognish
  • 43
  • 4
  • 1
    You are taking a linear approximation of the derivative, not calculating an actual derivative. Both answers are correct, as both are approximations of the derivative. You will find that the "forward-difference" and "backward-difference" are the same when a function is linear (that is not the only way it will be the same, but it is the only way the differences will always be the same for any choice of points and any $h$). – SlipEternal Apr 13 '20 at 21:46
  • Thank you, now I understand :) – Boognish Apr 13 '20 at 22:27

2 Answers2

1

Each is only an approximate derivative. The textbook happens to assume you use the backward derivative. While neither of these two options has an inherent advantage over the other, $(f(x+h)-f(x-h))/(2h)$ is typically much more accurate than either of them.

J.G.
  • 115,835
0

This is because in general $f(x_0)$ and $f(x_2)$ can take different values.

CyclotomicField
  • 11,018
  • 1
  • 12
  • 29