Calculus of Finite Differences Part-1

Calculus of Finite Differences Part-1

Achyut Bharadwaj, Saee Patil, Valentio Iverson, Danny Li
August 2021
calculus, finite difference, sequences, patterns, polynomials, chain rule

Acknowledgements #

This work was carried out as part of a research project at PROMYS-2021. I am a grateful recipient of the Mehta Fellowship to the PROMYS programs in 2021 and 2022.

Preliminary Definitions #

Finding Patterns #

(1) 1,4,7,10,    ?1,4,7,10,\cdots\;\;?

Here’s a harder one:

(2) 3,4,6,9,13,    ?3,4,6,9,13,\cdots\;\;?

Notations #

(3) Δ(f)(x)=f(x+1)f(x)\Delta\left(f\right)(x)=f(x+1)-f(x)
(4) Δn+1(f)=Δ(Δn(f))\Delta^{n+1}(f)=\Delta\left(\Delta^n(f)\right)

What is Δ(f)\Delta\left(f\right) when ff is 1,4,7,10,1,4,7,10,\cdots?

What is Δ(f)\Delta\left(f\right) when ff is 3,4,6,9,133,4,6,9,13\cdots?

What is Δ2(f)\Delta^2(f) when ff is 3,4,6,9,133,4,6,9,13\cdots?

Some Results #

Δ(f)\Delta\left(f\right) is a polynomial iff ff is a polynomial.

(5) Δn(f)=cΔn+1(f)=0\Delta^n(f)=c\Rightarrow \Delta^{n+1}(f)=0

Let

(6) f(x)=amxm+am1xm1++a1x+a0,am0f(x)=a_mx^m+a_{m-1}x^{m-1}+\cdots+a_1x+a_0,a_m\neq0
The least nn such that Δn(f)=0\Delta^n(f)=0 is m+1m+1.

Δ1\Delta^{-1} #

We define Δ1(f(x))\Delta^{-1}(f(x)) as a function g(x)g(x) such that Δ(g(x))=f(x)\Delta\left(g(x)\right) = f(x).

Patterns again! #

(7) 12+22+32++(n1)2= ?1^2 + 2^2 + 3^2 + \cdots + (n-1)^2 = ~?
What about
(8) 13+23++(n1)3= ?1^3 + 2^3 + \cdots + (n-1)^3 = ~?
Can you find
(9) i=0n1ik\sum_{i=0}^{n-1} i^k
recursively?

Generalizing #

Observe that

(10) i=0n1(i+1)ki=0n1ik=nk\sum_{i=0}^{n-1}(i+1)^k - \sum_{i=0}^{n-1}i^k = n^k
So,
(11) i=0n1(i+1)kik=nk\sum_{i=0}^{n-1}(i+1)^k - i^k = n^k

The above becomes:

(12) i=0n1j=1k(kj)ikj=i=0n1(kik1+j=2k(kj)ikj)=nk\sum_{i=0}^{n-1}\sum_{j=1}^{k}\binom{k}{j}i^{k-j} = \sum_{i=0}^{n-1}(ki^{k-1} + \sum_{j=2}^{k}\binom{k}{j}i^{k-j}) = n^k
using the binomial theorem.

So, we have

(13) nki=0n1(j=2k(kj)ikj)=ki=0n1ikn^k-\sum_{i=0}^{n-1}(\sum_{j=2}^{k}\binom{k}{j}i^{k-j}) = k\sum_{i=0}^{n-1}i^{k}
by rearranging the above.

Hence,

(14) i=0n1ik=nki=0n1(j=2k((kj)ikj))k\sum_{i=0}^{n-1}i^k = \frac{n^k - \sum_{i=0}^{n-1}(\sum_{j=2}^{k}(\binom{k}{j}i^{k-j}))}{k}

Calculus vs Finite Differences #

Addition and multiplication under a finite difference #

(15) Δ(f(x)+g(x))=Δ(f(x))+Δ(g(x))\Delta\left(f(x)+g(x)\right) = \Delta\left(f(x)\right)+\Delta\left(g(x)\right)
(16) Δ(f(x)+g(x))=(f(x+1)+g(x+1))(f(x)+g(x))=(f(x+1)f(x))+g(x+1)g(x)=Δ(f(x))+Δ(g(x))\begin{aligned}\Delta\left(f(x)+g(x)\right) &= (f(x+1)+g(x+1)) - (f(x)+g(x)) \\ &= (f(x+1)-f(x)) + g(x+1) - g(x) \\ &= \Delta\left(f(x)\right) + \Delta\left(g(x)\right)\end{aligned}

Multiplication of finite difference #

We now try to find a generic formula for the product of two functions under a finite difference.

(17) Δ(f(x)g(x))=f(x+1)Δ(g(x))+g(x)Δ(f(x))\Delta\left(f(x)\cdot g(x)\right) = f(x+1)\Delta\left(g(x)\right) + g(x)\Delta\left(f(x)\right)

(18) Δ(f(x)g(x))=f(x+1)g(x+1)f(x)g(x)\Delta\left(f(x)\cdot g(x)\right) = f(x+1)g(x+1) - f(x)g(x)
We add and subtract g(x)f(x+1)g(x)f(x+1) in the above to get:
(19) Δ(fg)=f(x+1)g(x+1)f(x)g(x)+f(x+1)g(x)f(x+1)g(x)=f(x+1)(g(x+1)g(x))+g(x)(f(x+1)f(x))=f(x+1)Δ(g(x))+g(x)Δ(f(x))\begin{aligned} \Delta\left(f\cdot g\right) &= f(x+1)g(x+1) - f(x)g(x) + f(x+1)g(x) - f(x+1)g(x) \\ &= f(x+1)(g(x+1) - g(x)) + g(x)(f(x+1)-f(x)) \\ &= f(x+1)\Delta\left(g(x)\right) + g(x)\Delta\left(f(x)\right) \end{aligned}

Division under a finite difference #

Before trying to find a formula for division, we try to find one for the multiplicative inverse, i.e. finding Δ(1f(x))\Delta\left(\frac{1}{f(x)}\right) in terms of f(x)f(x)

(20) Δ(1f(x))=1f(x+1)1f(x)=f(x)f(x+1)f(x+1)f(x)=Δ(f(x))f(x+1)f(x)\Delta\left(\frac{1}{f(x)}\right) = \frac{1}{f(x+1)} - \frac{1}{f(x)} = \frac{f(x)-f(x+1)}{f(x+1)f(x)} = -\frac{\Delta\left(f(x)\right)}{f(x+1)f(x)}
Now,
(21) Δ(f(x)g(x))=Δ(f(x)1g(x))=f(x+1)Δ(1g(x))+1g(x)Δ(f(x))\Delta\left(\frac{f(x)}{g(x)}\right) = \Delta\left(f(x)\cdot\frac{1}{g(x)}\right) = f(x+1)\Delta\left(\frac{1}{g(x)}\right) + \frac{1}{g(x)}\Delta\left(f(x)\right)
by the product formula. The above can be written as:
(22) f(x+1)Δ(g(x))g(x+1)g(x)+Δ(f(x))g(x)=g(x+1)Δ(f(x))f(x+1)Δ(g(x))g(x+1)g(x)-f(x+1)\frac{\Delta\left(g(x)\right)}{g(x+1)g(x)} + \frac{\Delta\left(f(x)\right)}{g(x)} = \frac{g(x+1)\Delta\left(f(x)\right)-f(x+1)\Delta\left(g(x)\right)}{g(x+1)g(x)}

Chain Rule #

Evaluate Δ(f(x))\Delta\left(f(x)\right) when f(x)=(2x)2f(x)=(2x)^2

(2x)2=4x2(2x)^2 = 4x^2. Now, Δ(4x2)=4Δ(x2)=4(2x+1)=8x+4\Delta\left(4x^2\right) = 4\Delta\left(x^2\right) = 4(2x+1) = 8x+4.

We compare this with the calculus chain rule. Is it possible to let u=2xu=2x, find Δ(f(u))\Delta\left(f(u)\right), and multiply it by Δu\Delta u to get the result as we do in calculus?

(23) f(u)=u2    Δf(u)=2u+1=4x+1f(u)=u^2 \implies \Delta f(u) = 2u + 1 = 4x + 1
Also, Δu=2\Delta u = 2. So,
(24) Δf(u)Δu=(4x+1)×2=8x+28x+4\Delta f(u)\cdot \Delta u = (4x+1)\times2 = 8x + 2 \neq 8x+4
We explore why it does not work in the next few slides.

We think of the function Δ\Delta as finding the slope of a curve between two integral points.

Chain Rule
Fig-1: Chain Rule

So, we can conclude that

(25) Δ((f)(x))=Δ(f(x))Δx\Delta\left((f)(x)\right) = \frac{\Delta\left(f(x)\right)}{\Delta x}

We need

(26) ΔfΔgΔgΔx=f(g(x))Δ(g(x))\frac{\Delta f}{\Delta g}\cdot\frac{\Delta g}{\Delta x} = f(g(x))\Delta\left(g(x)\right)
for the chain rule to work.

We know that

(27) Δg(x)Δx=Δg(x)\frac{\Delta g(x)}{\Delta x} = \Delta g(x)
from the graph in Fig-1. Hence, we need
(28) Δf(x)Δg(x)=f(g(x))\frac{\Delta f(x)}{\Delta g(x)} = f(g(x))
for the chain rule to work. This however does not hold true for every f(x),g(x)f(x),g(x) as we saw in the example.

In calculus however, the difference is not finite. Hence, the above holds.

Some fun with Δ1\Delta^{-1} #

Find Δ1(x+1)\Delta^{-1}(x + 1). Can you find Δ1(f(x)+g(x))\Delta^{-1}(f(x)+g(x)) in terms of f(x),g(x)f(x),g(x)?

We know

(29) Δ1(2x+1)=x2+c\Delta^{-1}(2x+1) = x^2+c
. Also,
(30) Δ1x=x2x2+c\Delta^{-1}x = \frac{x^2-x}{2}+c
So, one can guess that
(31) Δ1(2x+1)=x2x2x2=x2+x2+c\Delta^{-1}(2x+1) = x^2 - \frac{x^2-x}{2} = \frac{x^2 + x}{2}+c
for some constant cc. Indeed, we can check to see that this is true!   Notice that this is the same as
(32) Δ1(x)+Δ1(1)\Delta^{-1}(x) + \Delta^{-1}(1)
This leads to a proposition.

Addition under Δ1\Delta^{-1} #

(33) Δ1(f+g)=Δ1(f)+Δ1(g)\Delta^{-1}(f+g) = \Delta^{-1}(f)+\Delta^{-1}(g)
for all f,gf,g whose differences are defined.

We know that

(34) Δ(f+g)=Δ(f)+Δ(g)\Delta\left(f'+g'\right) = \Delta\left(f'\right)+\Delta\left(g'\right)
Now,
(35) Δ1(Δ(f+g))=f+g\Delta^{-1}(\Delta\left(f'+g'\right)) = f'+g'
Hence,
(36) Δ1(Δ(f)+Δ(g))=f+g\Delta^{-1}(\Delta\left(f'\right)+\Delta\left(g'\right))=f'+g'

Also,

(37) Δ1(Δ(f))+Δ1(Δ(g))=f+g\Delta^{-1}(\Delta\left(f'\right)) + \Delta^{-1}(\Delta\left(g'\right)) = f' + g'

Equating the LHS of the above two equations, we get:

(38) Δ1(Δ(f)+Δ(g))=Δ1(Δ(f))+Δ1(Δ(g))\Delta^{-1}(\Delta\left(f'\right)+\Delta\left(g'\right))=\Delta^{-1}(\Delta\left(f'\right)) + \Delta^{-1}(\Delta\left(g'\right))
We let
(39) Δ(f)=f,Δ(g)=g\Delta\left(f'\right) = f, \Delta\left(g'\right) = g
Thus,
(40) Δ1(f+g)=Δ1(f)+Δ1(g)\Delta^{-1}(f+g) = \Delta^{-1}(f)+\Delta^{-1}(g)
for all f,gf,g given that f,gf’,g’ exist. That is, ff and gg must have defined differences.

Generalizing #

A motivating question #

We are interested in the following question.

Can we find a polynomial that fits a certain given data?

Let us consider the following example. Can we find a quadratic polynomial ff such that

(41) f(0)=1,f(1)=0,f(2)=5,f(3)=1 ?f(0) = 1, f(1) = 0, f(2) = 5, f(3) = -1~?

A motivating question indeed, and the answer is no. Suppose there exists such quadratic polynomial ff, then

(42) Δ3f(x)=0,xR\Delta^3 f(x) = 0, \forall x \in \mathbb{R}
However, we can check that
(43) Δ3f(0)=f(3)3f(2)+3f(1)f(0)=17\Delta^3 f(0) = f(3) - 3f(2) + 3f(1) - f(0) = -17

Consider a variant of the question before: Can we find a cubic polynomial ff such that

(44) f(0)=1,f(1)=0,f(2)=5,f(3)=1 ?f(0) = 1, f(1) = 0, f(2) = 5, f(3) = -1~?
The answer is yes! The polynomial
(45) 176x3+232x2293x+1-\frac{17}{6}x^3+\frac{23}{2}x^2 - \frac{29}{3}x + 1
works. But how do we find this polynomial?

Since

(46) Δ(Δ2(f(x)))=17\Delta\left(\Delta^2(f(x))\right) = -17
(47) Δ2(f(x))=17x+c\Delta^2(f(x)) = -17x + c
for some constant cc. When x=0x=0,
(48) Δ2(f(x))=6\Delta^2(f(x)) = 6
Hence, c=6c=6. Similarly,
(49) Δ2(f(x))=17x+6    Δ(f(x))=172x2+292x+c\Delta^2(f(x)) = -17x+6 \implies \Delta\left(f(x)\right) = -\frac{17}{2}x^2 + \frac{29}{2}x + c'
for some constant cc’. When x=0x=0, Δ(f(x))=1\Delta\left(f(x)\right) = -1. Hence, c=1c’ = -1. We could check that
(50) Δ(f(x))=172x2+2912x1\Delta\left(f(x)\right) = \frac{17}{2}x^2 + \frac{29}{12}x - 1
, which implies
(51) f(x)=176x3+232x2293x+cf(x) = -\frac{17}{6}x^3 + \frac{23}{2}x^2 - \frac{29}{3}x + c''
When x=0x=0, f(x)=1f(x) = 1. Hence, c’’=1c’’=1. Thus, the cubic polynomial that fits the given data is
(52) 176x3+232x2293x+1-\frac{17}{6}x^3+\frac{23}{2}x^2 - \frac{29}{3}x + 1

Can we generalize this? Therefore, we began to ask the following interesting question:

Given the values of f(0),f(1),,f(n)f(0), f(1), \dots, f(n), can we find a polynomial ff of degree not greater than nn that fits this data? Is this polynomial unique?

And the answer is yes to both questions.

Finding a polynomial that passes through nn points #

Claim. For any n,k,ikn,k, i \le k, we have

(53) Δi(n+kk)=(n+kki)\Delta^i \binom{n + k}{k} = \binom{n + k}{k - i}

We will prove this by induction on ii. Indeed, this is true for i=1i = 1, since

(54) Δ(n+kk)=(n+k+1k)(n+kk)=(n+kk1)\Delta \binom{n + k}{k} = \binom{n +k + 1}{k} - \binom{n + k}{k} = \binom{n + k}{k - 1}
Now, fix n,kn,k. Suppose this result is true for i=<ki = \ell < k, Then we will prove that this is true for i=+1i = \ell + 1.

Indeed,

(55) Δ+1(n+kk)=Δ(Δ(n+kk))=Δ(n+kk)=(n+1+kk)(n+kk)=(n+kk1)\begin{aligned} \Delta^{\ell + 1} \binom{n + k}{k} &= \Delta \left( \Delta^{\ell} \binom{n + k}{k} \right) \\ &= \Delta \binom{n + k}{k - \ell} \\ &= \binom{n + 1 + k}{ k - \ell} - \binom{n + k}{k - \ell} \\ &= \binom{n + k}{k - \ell - 1} \end{aligned}
which proves our assertion.

Every polynomial P(x)P(x) can be uniquely represented as

(56) kak(n+kk)\sum_{k} a_k \binom{n + k}{k}
for reals aka_k.

Using this fact, note that if P(x)0P(x) \not= 0, then

(57) Δ1(P(x))=kakΔ1((n+kk))=kak(n+kk+1)\begin{aligned} \Delta^{-1}(P(x)) &= \sum_k a_k \Delta^{-1} \left( \binom{n + k}{k} \right) = \sum_k a_k \binom{n + k}{k + 1}\end{aligned}

The previous argument proves the existence of such a polynomial passing through f(0),f(1),f(2),,f(n)f(0), f(1), f(2), \dots, f(n), ensuring the degree is not greater than nn. In fact, we claim an even more generalized result.

Let x1,x2,,xnx_1, x_2, \dots, x_n be nn distinct real values and y1,y2,,yny_1, y_2, \dots, y_n be nn real numbers. Then there exists a unique polynomial fR[x]f \in \mathbb{R}[x] of degree less than nn such that f(xi)=yif(x_i) = y_i for 1in1 \le i \le n.

Proof #

Proof. We’ll first prove that there exists such polynomial. Consider the polynomial

(58) f(x)=i=1nyiijxxjxixjf(x) = \sum_{i = 1}^n y_i \cdot \prod_{i \not= j} \frac{x - x_j}{x_i - x_j}
Now, check that f(xi)=yif(x_i) = y_i for every 1in1 \le i \le n, and we are done. Finally, we will prove uniqueness. Indeed, if there exists two working polynomials Q,RQ,R such that
(59) Q(xi)=R(xi)=yiQ(x_i) = R(x_i) = y_i
for 1in1 \le i \le n. Then, either QR=0Q - R = 0, or deg(QR)<n\text{deg} (Q - R) < n. However, if QR0Q - R \not= 0, the polynomial QRQ - R vanishes at nn points, with degree less than nn, which is a contradiction.