Quote:
Originally Posted by PairTheBoard
I don't see the relationship between the derivatives and the differences shown.
I suspect that it was a made up example and that he didn't actually do the work for the specific numbers he gave when he said he worked out the x part. But that doesn't mean that it doesn't actually work.
Let D(f) = f(x+1) - f(x). Notice that this calculate the difference between two consecutive terms in a sequence defined by f. We can quickly calculate that D(f + g) = D(f) + D(g) and D(kf) = kD(f) (where k is a constant), and also calculate D(k) = 0, D(x) = 1, and D(x^2) = 2x + 1. (The +1 is the thing that I'm not sure whether he was doing correctly.)
Consider the function defined by the following points (and assume that the solution is a quadratic polynomial).
Code:
x | 0 | 1 | 2 | 3
f | 23 | 24 | 29 | 38
We can compute the forward differences:
Code:
x | 0 | 1 | 2 | 3
f | 23 | 24 | 29 | 38
Df | 1 | 5 | 9 | --
D^2f | 4 | 4 | ---
By assumption, we have that f(x) = ax^2 + bx + c for some integers a, b, and c.
Notice that D(ax^2 + bx + c) = a(2x + 1) + b, so that D^2(ax^2 + bx + c) = 2a. Since D^2(f)(x) = 4 for all x, we get that a = 2.
We can now substitute back into the equation to get D(f) = 4x + 2 + b. When x = 0, we get D(f)(0) = 1 = 4(0) + 2 + b. This implies b = -1.
Lastly, we see that f(0) = c, which implies that c = 23.