Discrete Calculus
Discrete Calculus
Gustavo Lau
Discrete calculus
f (x) = x2 un = n2
Derivative and difference
f (x + 1) − f (x)
1
This leads to the discrete version of the derivative. The
difference of a sequence un is defined as:
∆un = un+1 − un
Difference
The difference of a sequence un is:
∆un = un+1 − un
Examples:
n 0 1 2 3 4 5 Sequence type
un 7 7 7 7 7 7 Constant
∆un 0 0 0 0 0 Zero
un 0 6 12 18 24 30 Linear
∆un 6 6 6 6 6 Constant
un 0 1 4 9 16 25 Quadratic
∆un 1 3 5 7 9 Linear
un 1 2 4 8 16 32 Geometric (Exponential)
∆un 1 2 4 8 16 Geometric (Exponential)
∆un = un+1 − un
un = n2
∆un = (n + 1)2 − n2 = 2n + 1
f (x) = x2 =⇒ f 0 (x) = 2x
n2 = n(n − 1)
Then:
un = n2 =⇒ ∆un = (n + 1)2 − n2
= (n + 1)n − n(n − 1)
= 2n
Differences
Worksheet 1
The difference of a sequence un is:
∆un = un+1 − un
nk = n(n − 1) . . . (n − k + 1)
n0 = 1
1
n−k =
(n + 1)(n + 2) . . . (n + k)
Difference of a falling factorial
The falling factorial (power), n to the k falling when k > 0, is:
nk = n(n − 1) . . . (n − k + 1)
If un = nk then:
∆un = (n + 1)k − nk
= (n + 1)n . . . (n − k + 2) − n(n − 1) . . . (n − k + 1)
= n(n − 1) . . . (n − k + 2) n + 1 − (n − k + 1)
= knk−1
Therefore:
un = nk =⇒ ∆un = knk−1
This is the discrete version of:
If un = n−k then:
∆vn un ∆vn
(∆un )vn+1
vn+1
un vn
vn
un ∆un
un+1
Worksheet 2
To evaluate the sum:
X
un
n
n2
n 1
2
nk+1
nk knk−1 , k 6= −1
k+1
cn
cn cn (c − 1)
c−1
n
X 1
n−1 −n−2 Harmonic number Hn = ,
r
r=1
x
1
Z
the discrete version of ln(x) = dr
1 r
Properties of indefinite sums
If un and vn are sequences and c is a constant:
X X X
(un + vn ) = un + vn (Linearity 1)
X X
(cun ) = c un (Linearity 2)
X X
un ∆vn = un vn − vn+1 ∆un (Sum by parts)
Note that the sum and integration by parts formulas come from
the respective product rules.
Definite sum
The fundamental theorem of calculus: If f (x) = F 0 (x) then
Z b b
f (x)dx = F (x) = F (b) − F (a)
a a
Worksheet 3
Fundamental theorem of sum calculus: If ur = ∆Ur then
b
X b+1
ur = Ur = Ub+1 − Ua
a
r=a
Fundamental theorem of sum calculus
If ur = ∆Ur then
b
X b+1
ur = Ur = Ub+1 − Ua
a
r=a
n
X
(2r + 1) = ?
r=0
Ur = r2 =⇒ ∆Ur = (r + 1)2 − r2 = 2r + 1
n
X n+1
∴ (2r + 1) = r2 = (n + 1)2 − 02 = (n + 1)2
0
r=0
Fundamental theorem of sum calculus
If ur = ∆Ur then
b
X b+1
ur = Ur = Ub+1 − Ua
a
r=a
b
X
cr = ?
r=a
cr cr+1 cr
Ur = =⇒ ∆Ur = − = cr
c−1 c−1 c−1
b
b+1
X cr cb+1 − ca
∴ cr = =
c − 1 c−1
r=a a
b
X cb+1
−1
In particular, cr = (Geometric series)
c−1
r=0
Fundamental theorem of sum calculus
If ur = ∆Ur then
b
X b+1
ur = Ur = Ub+1 − Ua
a
r=a
b
X r
=?
r=a
k−1
r
Ur =
k
r+1 r r
∆Ur = − = (Pascal’s rule)
k k k−1
b b+1
X r r b+1 a
∴ = = −
k − 1 k k k
r=a
a
Fundamental theorem of sum calculus
If ur = ∆Ur then
b
X b+1
ur = Ur = Ub+1 − Ua
a
r=a
Xn
rk = ?
r=0
rk+1
Ur = =⇒ ∆Ur = rk
k+1
n+1
n k+1
X r (n + 1)k+1
∴ rk = =
k + 1 k+1
r=0 0
We can use
n
X (n + 1)k+1
rk =
k+1
r=0
n
X (n + 1)k+1
rk =
k+1
r=0
r2 = r(r − 1) = r2 − r
∴ r2 = r2 + r1
n n
X X (n + 1)3 (n + 1)2
r2 = (r2 + r1 ) = +
3 2
r=0 r=0
(n + 1)n(n − 1) (n + 1)n
= +
3 2
n(n + 1)(2n + 1)
=
6
Sums of powers
Worksheet 4
n
X (n + 1)k+1
rk =
k+1
r=0
n n
X X (n + 1)3 (n + 1)2
r2 = (r2 + r1 ) = +
3 2
r=0 r=0
n
X (n + 1)k+1
rk =
k+1
r=0
Worksheet 5
The sum by parts formula for definite sums is:
b
X b
X
ur ∆vr = ub+1 vb+1 − ua va − vr+1 ∆ur
r=a r=a
Vector space
y = A e2x + B e3x un = A 2n + B 3n v = A i + B j
mn+4 = mn
m4 = 1 (Auxiliary equation)
∴ m1 = 1, m2 = −1, m3 = i, m4 = −i (Roots of unity)
n n n n
∴ un = A · 1 + B(−1) + Ci + D(−i) (General solution)
A + B + C + D = 11 (u0 = 11)
A − B + Ci − Di = 1 (u1 = 1)
A+B−C −D =3 (u2 = 3)
A − B − Ci + Di = 1 (u3 = 1)
n n n
∴ un = 4 + 3(−1) + 2i + 2(−i)
Linear difference equations
un = Aαn + Bβ n
Exercise: Using this technique and assuming that the first term
is u0 , find a formula for the periodic sequence:
m2 = 1 (Auxiliary equation)
∴ α = 1, β = −1 (Roots of unity)
n n n
∴ un = A · 1 + B(−1) = A + B(−1) (General solution)
A + B = 20 (u0 = 20)
A − B = 10 (u1 = 10)
∴ A = 15, B = 5
∴ un = 15 + 5(−1)n
Worksheet 6
Assume un = mn and m 6= 0. If the auxiliary equation has
distinct roots α and β then the general solution is:
un = Aαn + Bβ n .
If the roots are the same, α, then the general solution is:
un = (An + B)αn .
Fibonacci sequence
un+2 = un+1 + un
u0 = 0, u1 = 1
Assuming un = mn and n 6= 0, we get:
mn+2 = mn+1 + mn
m2 = m + 1 (Auxiliary equation)
√ √
1+ 5 1− 5
∴α= ,β = (Golden ratio and its conjugate)
2 √ 2 √
1+ 5 n 1− 5 n
∴ un = A +B (General solution)
2 2
A+B =0 (u0 = 0)
√ √
1+ 5 1− 5 2
A +B = 1, A − B = √ (u1 = 1)
2 2 5
√ √
1 1+ 5 n 1 1− 5 n
∴ un = √ − √
5 2 5 2
This closed-form expression is known as Binet’s formula.
Is it all a coincidence?
A more general definition of a difference of a function f is:
∆h f (x) = f (x + h) − f (x)
∆h f (x)
f 0 (x) = lim
h→0 h
This equality explains why the properties of differences and
derivatives are so similar. There is an analogous relationship
between sums and integrals, just check the definition of
Riemann integrals.
Applications and discrete mathematics
Derivative Difference
xk nk
Integral Sum