Not Your Father's Calculus

Published on
57 min read––– views

Sometimes when my mom asks me what I'm working on, she'll chide me for the tears shed over rudimentary algebra in 4th or 5th grade, and I'm reminded why "the cool parts of math" weren't availed to me. In a previous post I laid some foundations for bastardizing calculus in ways that were unfathomable to my fragile, weak 10-year-old synapses that were philosophically frustrated by the notion of polynomial long division.

Consider the discrete summation of the triangular numbers:

k=1xk=1+2+3++x\sum_{k=1}^x k =1+ 2+ 3 + \cdots + x

and an arbitrary geometric series:

k=1xrk=r1+r2+r3++rx\sum_{k=1}^x r^k = r^1 + r^2 + r^3 + \cdots + r^x

Both of these summations are convergent for finite xx, so there exists closed formulae for each of them:

k=x(x+1)2rk=r1rx1r\begin{aligned} \sum k &= \frac{x(x+1)}{2} \\ \\ \sum r^k &= r\frac{1-r^x}{1-r} \\ \end{aligned}

Interestingly, whereas the domain of the discrete summations is restricted to whole numbers, we can plug in any number into these formulae. In this post, we're going to ask and answer the question: does there exist a general formula by which we can we extend the domain of any arbitrary function like this?

k=1xf(k)=???\sum_{k=1}^x f(k) = ???

(Spoiler, the answer is no in general, but for a broad class of functions, the answer can be yes). At the same time, we'll brush up against topics covered by the related literature on non-integer sums1,2,3 courtesy of Markus Müller and Dierk Schleicher.

Given some univariate function f(x)f(x), we want to extend the sum of f(k)f(k) from 11 to xx, which is itself a function of xx:

k=1xf(k)=S(x)\sum_{k=1}^x f(k) = S(x)

Since xx is whole, the plot of S(x)S(x) is a discontinuous collection of points. Our goal, then, becomes trying to find a sane, natural, and generalizable way to connect these points. Now, there's no single correct answer. We could just draw straight lines between the dots,

but there are also plenty of better methods of smooth interpolation we could reach for

and cases can be made for any curve which passes through all the points...

To define the line of best fit, we'll restrict the solution space according to properties of S(x)S(x) which we want our continuous approximation of SS to satisfy.

Property the first: recursion

Thus, we observe first that SS is recursively defined:

S(x+1)=f(1)+f(2)++f(x)+f(x+1)=S(x)+f(x+1)\begin{aligned} S(x+1) &= f(1) + f(2) + \cdots + f(x) + f(x+1) \\ &= S(x) + f(x+1) \end{aligned}

so with no other information about SS other than S(1)=f(1)S(1) = f(1) and ff, we can derive all other points of SS.

This also works in reverse: given S(x)S(x), we can compute S(x1)=S(x)f(x)S(x-1) = S(x) - f(x), allowing us to compute S(0)S(0) (which will always be zero), as well as S(1),S(2),...S(-1), S(-2), ...

Noting that the recursive definition has already allowed us to breach containment of the strictly natural domain of our summation indices, we might then suppose that if we could just find some value S(q)S(q) for qQ\Zq \in \mathbb Q\backslash \mathbb Z, we could fin all integer multiples of that point as well:

Property the second: the limit

Second, though we don't yet know how to extend SS near the origin, the asymptotic behavior off towards positive infinity is easier to work with. Just like the reciprocal function f(x)=1xf(x) = \frac{1}{x} whose origin behavior is finicky, we can more intuitively understand the tail behavior:

limxf(x)=0\lim_{x\rightarrow\infty}f(x) = 0

Asymptotically, the reciprocal function behaves like a horizontal line, so for S(n)S(n) and some big, whole value of nn, the amount that we add f(n+1)f(n+1) in order to get S(n+1)S(n+1) will be vanishingly small, so the points near S(n)S(n) will be a horizontal line for our chosen function ff:

Here in the limit where SS behaves like a constant, it would make sense to interpolate not-natural values of of S(n)S(n) as a horizontal line.

However, the limit as our input to SS approaches infinity won't always converge to 00. E.g., for f(x)=lnxf(x) = \ln x, though it doesn't approach zero, it's slope does decrease over time and it gradually starts to "flatten out" towards some constant. So here, the amount that we add near S(n)S(n) for some arbitrarily large, whole value of nn become constant:

So, combining these two observations, how might we generalize to more than two hand-picked functions.

General Form for Asymptotically Zero Valued Functions

Suppose that SS can be extended in the vicinity of some ff at a large input nn. In order to find S(x)S(x) for x∉Zx \not\in \mathbb Z, we perform a three step process:

  1. Compute S(n)S(n) where we have a sum extension and can move forward any amount,
  1. Step forward xx units to compute S(n+x)S(n+x)
  1. Step backwards nn units

For this to work, we have to be able to extend SS near nn which, so far, we've only established is possible for the log naturale and reciprocal functions. For now, to extract a general form of this process, let's assume that our step amount xx is an integer.

  1. Computing S(n)S(n) we get S(n)=k=1nf(k)S(n) = \sum_{k=1}^n f(k)
  2. Advancing xx units translates to the iterated application of the recursive formula: +f(n+1)++f(n+2)++f(n+x)=k=1xf(n+k)+ f(n+1) + + f(n+2) + \cdots + f(n+x) = \sum_{k=1}^x f(n+k)
  3. And finally, moving backwards nn units: f(x+n)f(x+n1)f(x+2)f(x+1)=k=1nf(x+k)-f(x+n) -f(x+n-1) - \cdots -f(x+2) -f(x+1) = -\sum_{k=1}^n f(x+k)

So, all together we get a new formula for S(x)S(x):

S(x)=k=1nf(k)+k=1xf(n+k)k=1nf(x+k)\begin{aligned} S(x) &= \sum_{k=1}^n f(k) + \sum_{k=1}^x f(n+k) - \sum_{k=1}^n f(x+k) \end{aligned}

Rearranging terms to group the first and third summations which share the same bounds:

S(x)=k=1nf(k)k=1nf(x+k)+k=1xf(n+k)=k=1n(f(k)f(x+k))+k=1xf(n+k)\begin{aligned} S(x) &= \sum_{k=1}^n f(k) - \sum_{k=1}^n f(x+k) + \sum_{k=1}^x f(n+k) \\ \\ &= \sum_{k=1}^n \Big(f(k)- f(x+k)\Big) + \sum_{k=1}^x f(n+k) \\ \end{aligned}

And this formula will work for any whole-valued, arbitrarily big nn, meaning we also need to take the infinite limit of this definition of SS:

S(x)=limn(k=1n(f(k)f(x+k))+k=1xf(n+k))\begin{aligned} S(x) &= \lim_{n\rightarrow \infty} \Bigg( \sum_{k=1}^n \Big(f(k)- f(x+k)\Big) + \sum_{k=1}^x f(n+k) \Bigg) \end{aligned}

However, it still only works if xx is a whole number due to its usage as an upper bound in the second term. In this second term, though, we've offset the problem of fractional xx by nn in the limit, so hopefully we can infer a value from a well-bounded asymptotic approximation.

Let's see how this deferred evaluation of non-whole xx would work for some functions who's asymptotic behavior we understand.

Suppose that f(x)=0f(x) = 0 as xx tends towards infinity, since we're taking the limit of f(n+k)f(n+k) sums as nn approaches infinity, it means that those terms will go to zero:

limnk=1xf(n+k)  0\lim_{n\rightarrow \infty} \sum_{k=1}^x \underbrace{f(n+k)}_{\rightarrow \; 0}

This implies that the whole summation tends towards zero since xx is finite and the summation of finitely many zero-valued terms vanishes in the limit, problem solved!

limnk=1xf(n+k)  0  0\lim_{n\rightarrow \infty} \underbrace{\sum_{k=1}^x \underbrace{f(n+k)}_{\rightarrow \; 0}}_{\rightarrow \; 0}

So we have

S(x)=limnk=1n(f(k)f(x+k))+k=1xf(n+k)=limnk=1n(f(k)f(x+k))\begin{aligned} S(x) &= \lim_{n \rightarrow \infty}\sum_{k=1}^n \Big(f(k)- f(x+k)\Big) + \sum_{k=1}^x f(n+k)\\ \\ &= \lim_{n \rightarrow \infty}\sum_{k=1}^n \Big(f(k)- f(x+k)\Big) \end{aligned}

which will work for any underlying ff which tends towards zero for sufficiently large nn, since we've removed the only part of the formula which relied on xx being an integer. And we can visualize this "for real" with some Desmos handiwork like so:

N.B. that this only works for p<1p < -1 since the larger that pp is, the slower xpx^p approaches zero, and thus we need to crank the nn slider to pump up the "limit", however even this doesn't work for positive values of pp since that function no longer converges on zero. So we need some way to account for that...

General Form for Asymptotically Constant Valued Functions

What about the case for functions which "flatten" out at some non-zero value, where f(x)cf(x) \rightarrow c as xx \rightarrow \infty ? What does it mean to converge on some constant cc?

Revisiting the example of ln\ln, is there any constant value we can find which this function converges on? No, because ln\ln will eventually grow past it, so we need something less restrictive.

We can say S(x)S(x) flattens out if the limit of the underlying function f(x)f(x) approaches zero, but since SS and ff are not explicitly related in this definition, we first need want leverage the backwards recursive definition of SS:

S(x+1)S(x)=f(x+1)limxS(x+1)S(x)=0    0=limxf(x+1)    0=limxf(x)\begin{aligned} S(x+1) - S(x) &= f(x+1) &\\ \\ \lim_{x\rightarrow \infty} S(x+1) - S(x) = 0 &\iff 0 =\lim_{x\rightarrow \infty} f(x+1) \\ &\iff 0 =\lim_{x\rightarrow \infty} f(x) \\ \end{aligned}

So we can use the left hand side as our definition, claiming that S(x)S(x) flattens out if

limxS(x+1)S(x)=0\lim_{x\rightarrow \infty} S(x+1) - S(x) = 0

For simplicity/generality, we can write this as ff instead of SS since this holds for any function4 and note that

f(x+1)f(x)f(x+1) - f(x)

is called the forward difference of ff at xx, and is familiarly denoted Δf(x)\Delta f(x). So we can say that a function flattens out if:

limxΔf(x)=0\lim_{x\rightarrow \infty} \Delta f(x) = 0

Thus we recover a discrete version of the fundamental theorem of calculus:

ΔS(x)=f(x+1)\Delta S(x) = f(x+1)
fSSΔf\begin{aligned} f \overset\sum\longrightarrow S \\ S \underset\Delta\longleftarrow f \end{aligned}

This discrete derivation can be thought of as the amount of change after taking one step to the right:

f(x+1)=f(x)+Δf(x)f(x+1) = f(x) + \Delta f(x)

And note that this is also recursive. That is, if we have some value f(a)f(a), and we want to compute f(a+b)f(a+b), we simply add forward differences up to Δf(a+b1)\Delta f(a + b - 1) :

And this whole process can be expressed as a sum of forward differences:

f(a+b)=f(a)+Δf(a)+Δf(a+1)+Δf(a+2)++Δf(a+b1)k=0b1Δf(a+k)=f(a)+k=0b1Δf(a+k)\begin{aligned} f(a+b) &= f(a) + \overbrace{\Delta f(a) + \Delta f(a+1) + \Delta f(a+2) + \cdots + \Delta f(a + b -1)}^{\sum^{b-1}_{k=0}\Delta f(a+k)} \\ \\ &= f(a) + \sum_{k=0}^{b-1} \Delta f(a+k) \end{aligned}

So, for some ff who's forward difference converges to zero

limxΔf(x)=0\lim_{x\rightarrow \infty} \Delta f(x) = 0

and who's term inside the problematic summation bounded by xx does not itself converge, but who's forward difference does:

S(x)=limn(k=1nf(k)f(x+k)+k=1xf(n+k))S(x) = \lim_{n\rightarrow \infty} \Big(\sum_{k=1}^n f(k) - f(x + k) + \color{red}\sum_{k=1}^x\color{black} f(n+\color{red}k\color{black}) \Big)

We now use the forward difference formula in terms of f(a+b)f(a +b) after some slight manipulation to reindex its summation, and plug in a=n,b=ka=n, b=\color{red}k\color{black}:

f(a+b)=f(a)+k2=0b1Δf(a+k2)f(n+k)=f(n)+k2=0k1Δf(n+k2)\begin{aligned} f(a+b) &= f(a) + \sum_{k_2=0}^{b-1} \Delta f(a+k_2) \\ \\ f(n+\color{red}k\color{black}) &= f(n) + \sum_{k_2=0}^{\color{red}k\color{black}-1} \Delta f(n+k_2) \\ \end{aligned}

And since this sinistral term as it appears in SS is within a sum, we'll introduce the same sum to both side of our working forward difference equation:

f(n+k)=f(n)+k2=0k1Δf(n+k2)k=1xf(n+k)=k=1x(f(n)+k2=0k1Δf(n+k2))k=1xf(n+k)=k=1xf(n)+k=1xk2=0k1Δf(n+k2)\begin{aligned} f(n+\color{red}k\color{black}) &= f(n) + \sum_{k_2=0}^{\color{red}k\color{black}-1} \Delta f(n+k_2) \\ \\ \sum_{k=1}^x f(n+\color{red}k\color{black}) &= \sum_{k=1}^x\Big(f(n) + \sum_{k_2=0}^{\color{red}k\color{black}-1} \Delta f(n+k_2) \Big)\\ \\ \sum_{k=1}^x f(n+\color{red}k\color{black}) &= \sum_{k=1}^x f(n) + \sum_{k=1}^x\sum_{k_2=0}^{\color{red}k\color{black}-1} \Delta f(n+k_2) \\ \end{aligned}

And now we can substitute the right hand side back into our equation for SS:

S(x)=limn(k=1n(f(k)f(x+k))+k=1xf(n)+k=1xk2=0k1Δf(n+k2))=limn(k=1n(f(k)f(x+k))+k1=1xf(n)+k1=1xk2=0k11Δf(n+k2))\begin{aligned} S(x) &= \lim_{n\rightarrow \infty} \Big(\sum_{k=1}^n \big(f(k) - f(x + k)\big) + \sum_{k=1}^x f(n) + \sum_{k=1}^x\sum_{k_2=0}^{\color{red}k\color{black}-1} \Delta f(n+k_2)\Big) \\ &= \lim_{n\rightarrow \infty} \Big(\sum_{k=1}^n \big(f(k) - f(x + k)\big) + \sum_{k_1=1}^x f(n) + \sum_{k_1=1}^x\sum_{k_2=0}^{k_1-1} \Delta f(n+k_2)\Big) \end{aligned}

And note as the use of subscripts on kk rather than color coding. So what we've done is replace the problematic, non-vanishing term from earlier with a double sum of forward differences – and since the forward difference approaches zero in the limit AND since the double summation sums finitely many terms, neither of which are bounded by nn \rightarrow \infty, this term also goes to zero.

S(x)=limn(k=1n(f(k)f(x+k))+k1=1xf(n)+k1=1xk2=0k11Δf(n+k2)  0  0)\begin{aligned} S(x) &= \lim_{n\rightarrow \infty} \Big(\sum_{k=1}^n \big(f(k) - f(x + k)\big) + \sum_{k_1=1}^x f(n) + \underbrace{\sum_{k_1=1}^x\sum_{k_2=0}^{k_1-1} \underbrace{\Delta f(n+k_2)}_{\rightarrow \; 0}}_{\rightarrow \; 0}\Big) \end{aligned}

Get vanished, bozo! so we can actually drop the whole double-sum term, leaving us with just a singular summation of f(n)f(n) which we can express as xf(n)xf(n), and not it doesn't matter whether or not xx is wholly valued or not:

S(x)=limn(k=1n(f(k)f(x+k))+k1=1xf(n))=limn(k=1n(f(k)f(x+k))+xf(n))\begin{aligned} S(x) &= \lim_{n\rightarrow \infty} \Big(\sum_{k=1}^n \big(f(k) - f(x + k)\big) + \sum_{k_1=1}^x f(n) \Big) \\ &= \lim_{n\rightarrow \infty} \Big(\sum_{k=1}^n \big(f(k) - f(x + k)\big) + x f(n) \Big) \end{aligned}

We can see this formulation in action in Desmos again, where all we have to do is add this new xf(n)xf(n) term to our definition of SS, without which we would've needed nn to be on the order of millions instead of hundreds to resemble a half-decent approximation even at this scale:

Once again, though, this fails to be a faithful approximation for any nn if p>1p>1 because f(x)f(x) no longer flattens out.

Reviewing what we've accomplished so far, we can brainstorm how we might extend the sum of functions parameterized by p>1p > 1.

For the first class of summations, it was sufficient if f(x)f(x) converged to zero as does f(x)=1/xf(x) = 1/x:

limxf(x)=0\begin{aligned} \lim_{x\rightarrow\infty} f(x) &= 0 \\ \end{aligned}

For the second class, it was sufficient if the forward difference converged to zero, meaning that the function flattened out at some point:

limxΔf(x)=0\begin{aligned} \lim_{x\rightarrow\infty} \Delta f(x) &= 0 \\ \end{aligned}

So what if we iterate the forward difference, defined the way we'd expect it to be, where

Δf(x)=f(x+1)f(x)    ΔΔf(x)=Δf(x+1)Δf(x)=Δ2f(x)    ΔΔΔf(x)=Δ2f(x+1)Δ2f(x)=Δ3f(x)    Δnf(x)=Δn1f(x+1)Δn1f(x)\begin{aligned} \Delta f(x) &= f(x+1) - f(x) \\ \implies\Delta\Delta f(x) &= \Delta f(x+1) - \Delta f(x) =\Delta^2f(x) \\ \implies\Delta\Delta\Delta f(x) &= \Delta^2 f(x+1) - \Delta^2 f(x) =\Delta^3f(x) \\ &\vdots\\ \implies\Delta^n f(x) &= \Delta^{n-1} f(x+1) - \Delta^{n-1} f(x)\\ \end{aligned}

And to generalize for any polynomial growth function,

Δ0f(a+b)=Δ0f(a)+k=0b1Δ1f(a+k)Δnf(a+b)=Δnf(a)+k=0b1Δn+1f(a+k)\begin{aligned} \Delta^0 f(a+b) &= \Delta^0f(a) + \sum_{k=0}^{b-1} \Delta^1f(a +k) \\ &\vdots \\ \Delta^n f(a+b) &= \Delta^{n}f(a) + \sum_{k=0}^{b-1} \Delta^{n+1}f(a +k) \end{aligned}

to apply this to our formula for SS, we'll first make some notational tweaks for readability. First, we'll reindex nn1n \rightarrow n-1 which is arbitrary in the limit:

S(x)=limn(k=1n1(f(k)f(x+k))+k=1xf(n1+k))S(x) = \lim_{n\rightarrow\infty}\Bigg(\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) + \sum_{k=1}^x f(n-1+k)\Bigg)

s.t.

k=1xf(n1+k)=k=0x1f(n+k)=k=0x1Δ0f(n+k)=k1=0x1Δ0f(n+k1)\begin{aligned} \sum_{k=1}^{\color{red}x\color{black}} f(n\color{red}-1\color{black}+k) &= \sum_{k=0}^{\color{red}x-1\color{black}} f(n+k) \\ &= \sum_{k=0}^{x-1} \Delta^0 f(n+k) \\ &= \sum_{k_1=0}^{x-1} \Delta^0 f(n+k_1) \end{aligned}

For this derivation, let's take for example a function who's first and second forward differences do not converge to zero, but who's third order forward difference does:

limxΔ3f(x)=0\lim_{x\rightarrow \infty} \Delta^3 f(x) = 0

to demonstrate how this form works in general for all polynomials.

S(x)=limnk=1n1(f(k)f(x+k))+k1=0x1Δ0f(n+k1)Δ0f(a+b)=Δ0f(a)+k2=0b1Δ1f(a+k2)\begin{aligned} S(x) &= \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) + \sum_{k_1=0}^{x-1} \Delta^0 f(n+k_1) \\ \\ \Delta^0 f(a+b) &= \Delta^0f(a) + \sum_{k_2=0}^{b-1} \Delta^1f(a +k_2) \\ \end{aligned}

and for values of a=n,b=k1a=n, b=k_1 as is the case for the last term in the S(x)S(x) definition, we get:

Δ0f(a+b)=Δ0f(a)+k2=0b1Δ1f(a+k2)Δ0f(n+k1)=Δ0f(n)+k2=0k11Δ1f(n+k2)\begin{aligned} \Delta^0 f(a+b) &= \Delta^0f(a) + \sum_{k_2=0}^{b-1} \Delta^1f(a +k_2) \\ \\ \Delta^0 f(n+k_1) &= \Delta^0f(n) + \sum_{k_2=0}^{k_1-1} \Delta^1f(n +k_2) \\ \end{aligned}

And just like before, we introduce an additional sum on both sides so that our forward difference here matches the term in the definition of SS:

k1=0x1Δ0f(n+k1)=k1=0x1(Δ0f(n)+k2=0k11Δ1f(n+k2))=k1=0x1Δ0f(n)+k1=0x1k2=0k11Δ1f(n+k2)\begin{aligned} \sum_{k_1=0}^{x-1}\Delta^0 f(n+k_1) &= \sum_{k_1=0}^{x-1} \Bigg(\Delta^0f(n) + \sum_{k_2=0}^{k_1-1} \Delta^1f(n +k_2) \Bigg) \\ \\ &= \sum_{k_1=0}^{x-1}\Delta^0f(n) + \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1} \Delta^1f(n +k_2) \end{aligned}

And now we can substitute the resultant term back into our definition of SS,

S(x)=limnk=1n1(f(k)f(x+k))+k1=0x1Δ0f(n+k1)=limnk=1n1(f(k)f(x+k))+k1=0x1Δ0f(n)+k1=0x1k2=0k11Δ1f(n+k2)\begin{aligned} S(x) &= \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) + \color{red}\sum_{k_1=0}^{x-1} \Delta^0 f(n+k_1)\color{black} \\ \\ &= \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) + \color{red}\sum_{k_1=0}^{x-1}\Delta^0f(n) + \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1} \Delta^1f(n +k_2) \\ \end{aligned}

and this time –since the first order forward difference Δ1\Delta^1 doesn't necessarily converge to zero, we can't disappear it. Instead, we repeat this process for Δ1f(n+k2)\Delta^1 f(n + k_2), starting with the first order forward difference formula:

Δ1f(a+b)=Δ1f(a)+k3=0b1Δ2f(a+k3)Δ1f(n+k2)=Δ1f(n)+k3=0k21Δ2f(n+k3)\begin{aligned} \Delta^1 f(a+b) &= \Delta^1f(a) + \sum_{k_3=0}^{b-1} \Delta^2f(a +k_3) \\ \\ \Delta^1 f(n+k_2) &= \Delta^1f(n) + \sum_{k_3=0}^{k_2-1} \Delta^2f(n +k_3) \\ \end{aligned}

And this time we have to introduce the double sum over k1,k2k_1,k_2 to get this equation to match:

Δ1f(n+k2)=Δ1f(n)+k3=0k21Δ2f(n+k3)k1=0x1k2=0k11Δ1f(n+k2)=k1=0x1k2=0k11(Δ1f(n)+k3=0k21Δ2f(n+k3))=k1=0x1k2=0k11Δ1f(n)+k1=0x1k2=0k11k3=0k21Δ2f(n+k3)\begin{aligned} \Delta^1 f(n+k_2) &= \Delta^1f(n) + \sum_{k_3=0}^{k_2-1} \Delta^2f(n +k_3) \\ \\ \color{red}\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\color{black} \Delta^1 f(n+k_2) &= \color{red}\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\color{black} \Bigg(\Delta^1f(n) + \sum_{k_3=0}^{k_2-1} \Delta^2f(n +k_3)\Bigg) \\ \\ &= \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\Delta^1f(n) + \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1} \Delta^2f(n +k_3) \\ \end{aligned}

And now we can substitute this back in for the problematic term in SS:

S(x)=limnk=1n1(f(k)f(x+k))+k1=0x1Δ0f(n+k1)=limnk=1n1(f(k)f(x+k))+k1=0x1Δ0f(n)+k1=0x1k2=0k11Δ1f(n+k2)=limnk=1n1(f(k)f(x+k))+k1=0x1Δ0f(n)+k1=0x1k2=0k11Δ1f(n)+k1=0x1k2=0k11k3=0k21Δ2f(n+k3)\begin{aligned} S(x) &= \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) + \color{red}\sum_{k_1=0}^{x-1} \Delta^0 f(n+k_1)\color{black} \\ \\ &= \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) + \sum_{k_1=0}^{x-1}\Delta^0f(n) + \color{red}\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1} \Delta^1f(n +k_2) \\ \\ &= \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) + \sum_{k_1=0}^{x-1}\Delta^0f(n) + \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\Delta^1f(n) + \color{red}\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1} \Delta^2f(n +k_3)\color{black} \\ \end{aligned}

and repeat once more for the vanishing third order forward difference:

Δ2f(n+k3)=Δ2f(n)+k4=0k31Δ3f(n+k4)k1=0x1k2=0k11k3=0k21Δ2f(n+k3)=k1=0x1k2=0k11k3=0k21(Δ2f(n)+k4=0k31Δ3f(n+k4))=k1=0x1k2=0k11k3=0k21Δ2f(n)+k1=0x1k2=0k11k3=0k21k4=0k31Δ3f(n+k4)\begin{aligned} \Delta^2 f(n+k_3) &= \Delta^2f(n) + \sum_{k_4=0}^{k_3-1} \Delta^3f(n +k_4) \\ \\ \color{red}\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1}\color{black}\Delta^2 f(n+k_3) &= \color{red}\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1}\color{black} \Bigg(\Delta^2f(n) + \sum_{k_4=0}^{k_3-1} \Delta^3f(n +k_4)\Bigg) \\ \\ &= \color{red}\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1}\color{black} \Delta^2f(n) + \color{red}\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1}\color{black}\sum_{k_4=0}^{k_3-1} \Delta^3f(n +k_4) \\ \end{aligned}
    S(x)=limnk=1n1(f(k)f(x+k))+k1=0x1Δ0f(n)+k1=0x1k2=0k11Δ1f(n)+k1=0x1k2=0k11k3=0k21Δ2f(n)+k1=0x1k2=0k11k3=0k21k4=0k31Δ3f(n+k4)\begin{aligned} \implies S(x) = \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) &+ \sum_{k_1=0}^{x-1}\Delta^0f(n) \\ &+ \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\Delta^1f(n) \\ &+ \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1} \Delta^2f(n) \\ &+ \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1}\sum_{k_4=0}^{k_3-1} \Delta^3f(n +k_4) \end{aligned}

and finally this is the summation of a term that goes to zero, so therefore so too will the quadruple sum of this term since, again, we're only summing finitely many terms bounded by xx, which cascades down the summation stack, so we can drop this whole quadruple sum too:

S(x)=limnk=1n1(f(k)f(x+k))+k1=0x1Δ0f(n)+k1=0x1k2=0k11Δ1f(n)+k1=0x1k2=0k11k3=0k21Δ2f(n)+k1=0x1k2=0k11k3=0k21k4=0k31Δ3f(n+k4)  0  0\begin{aligned} S(x) = \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) &+ \sum_{k_1=0}^{x-1}\Delta^0f(n) \\ &+ \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\Delta^1f(n) \\ &+ \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1} \Delta^2f(n) \\ &+ \underbrace{\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1}\sum_{k_4=0}^{k_3-1} \underbrace{\Delta^3f(n +k_4)}_{\rightarrow \; 0}}_{\rightarrow \; 0} \end{aligned}
=limnk=1n1(f(k)f(x+k))+k1=0x1Δ0f(n)+k1=0x1k2=0k11Δ1f(n)+k1=0x1k2=0k11k3=0k21Δ2f(n)\begin{aligned} = \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) &+ \sum_{k_1=0}^{x-1}\Delta^0f(n) \\ &+ \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\Delta^1f(n) \\ &+ \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1} \Delta^2f(n) \end{aligned}

Is this actually useful though? Our resultant expression contains several nested, dependent sums which all still rely on xx being a whole number... To make this expression tractable for non-whole xx, we can observe that the terms we're summing over aren't dependent on ff or nn, so they're constant relative to the sum, so we can factor them out:

S(x)=limnk=1n1(f(k)f(x+k))+Δ0f(n)k1=0x11+Δ1f(n)k1=0x1k2=0k111+Δ2f(n)k1=0x1k2=0k11k3=0k211\begin{aligned} S(x) = \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) &+ \Delta^0f(n) \sum_{k_1=0}^{x-1} 1 \\ &+ \Delta^1f(n) \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1} 1 \\ &+ \Delta^2f(n)\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1} 1 \end{aligned}

So now we have a bunch of nested sums of 11 which might look familiar to students of combinatorics. Consider just the triply-nested sum:

k1=0x1k2=0k11k3=0k211\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1} 1

and now consider what happens to the innermost sum when the bound of the enveloping summation, k2k_2, is 0:

k3=0k21=k3=001\sum_{k_3 = 0}^{k_2-1} = \sum_{k_3 = 0}^{0-1}

which is a no op since the lower bound of 00 is initialized to a value greater than the upper bound! So we can skip the step when k2k_2 is 0 and just start at k2=1k_2 = 1:

k1=0x1k2=1k11k3=0k211\sum_{k_1=0}^{x-1}\sum_{\color{red}k_2=1\color{black}}^{k_1-1}\sum_{k_3=0}^{k_2-1} 1

Similarly, we can look at the middle summation when k1=0,1k_1 =0,1 and notice that no summing happens till k12k_1 \geq 2, so we can skip those indices and initialize k1k_1 to 22:

k1=2x1k2=1k11k3=0k211\sum_{\color{red}k_1=2}^{x-1}\sum_{k_2=1}^{k_1-1}\sum_{k_3=0}^{k_2-1} 1

So, in this way, while the index of the variable in our upper bound increases, so to does the the initial value of the lower bound. To understand this programmatically, what we have here is a triply-nested loop where k3<k2<k1k_3 < k_2 < k_1:

x = 10
total = 0
for k1 in range(2, x):
	for k2 in range(1, k1):
		for k3 in range(0, k2):
			total += 1
# total = 120

If we were to visualize this, we'd see how each of our loop indices effectively enumerates each way to choose 3 elements from x=10x=10, which we can express mathematically as (x3)x \choose 3 . So, our nested summation is equivalent to the binomial coefficients parameterized by n=xn = x, where kk is the number of summations:

k1x1k2k11k3k21kmkm11m summations1=(xm)\begin{aligned} \underbrace{\sum_{k_1}^{x-1}\sum_{k_2}^{k_1-1}\sum_{k_3}^{k_2-1} \cdots\sum_{k_m}^{k_{m-1}-1}}_{m \text{ summations}}1 = {x \choose m} \end{aligned}

where the binomial coefficientformula is derived from:

# ways to choose from n items w/removal# orderings of k items\frac{\text{\# ways to choose from } n \text{ items w/removal}}{\text{\# orderings of } k \text{ items}}

e.g. for (x3)x \choose 3, initially we have xx items to choose from, then we have x1x-1 items to choose from, and then x2x-2, but if order doesn't matter for our combination (it doesn't) then we've over counted and have to divide by the number of orders we could've selected one from xx, from x1x-1, and then from x2x-2 which is 3!3!:

x(x1)(x2)3!=(x3)\frac{x(x-1)(x-2)}{3!} = {x \choose 3}

which does not require xZx \in \mathbb Z! So returning to our definition of SS, we can replace each of the summations with the binomial coefficients they correspond to:

S(x)=limnk=1n1(f(k)f(x+k))+Δ0f(n)k1=0x11+Δ1f(n)k1=0x1k2=0k111+Δ2f(n)k1=0x1k2=0k11k3=0k211=limnk=1n1(f(k)f(x+k))+Δ0f(n)(x1)+Δ1f(n)(x2)+Δ2f(n)(x3)\begin{aligned} S(x) = \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) &+ \Delta^0f(n) \sum_{k_1=0}^{x-1} 1 \\ &+ \Delta^1f(n) \sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1} 1 \\ &+ \Delta^2f(n)\sum_{k_1=0}^{x-1}\sum_{k_2=0}^{k_1-1}\sum_{k_3=0}^{k_2-1} 1\\ \\ = \lim_{n\rightarrow\infty}\sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) &+ \Delta^0f(n) {x \choose 1} \\ &+ \Delta^1f(n) {x \choose 2} \\ &+ \Delta^2f(n) {x \choose 3} \end{aligned}

and this we can generalize for the mmth forward difference:

limxΔmf(x)=0    S(x)=limnk=1n1(f(k)f(x+k))+k=0mΔk1f(n)(xk)\begin{aligned} \lim_{x\rightarrow \infty} \Delta^m f(x) &= 0 \\ \\ \implies S(x) &= \lim_{n\rightarrow \infty} \sum_{k=1}^{n-1} \Big(f(k) - f(x+k)\Big) + \sum^m_{k=0} \Delta^{k-1}f(n) {x \choose k} \end{aligned}

And this works for any ff with a polynomial growth rate (i.e. an ff for which the mmth forward differences converges to zero). This means we can extend summation for these functions to fractional, irrational, and even complex terms, provide that the limit of the mmth forward difference does actually converge, as does the limit of the summation itself (e.g. summation over 1-periodic functions will not converge womp womp).

Footnotes

Footnotes

  1. Markus Müller and Dierk Schleicher. "Fractional Sums and Euler-like Identities." arXiv, 2005.

  2. Markus Müller and Dierk Schleicher. "How to add a non-integer number of terms, and how to produce unusual infinite summations." Journal of Computational and Applied Mathematics, 2005. https://doi.org/10.1016/j.cam.2004.08.009

  3. Markus Müller and Dierk Schleicher. "How to Add a Noninteger Number of Terms: From Axioms to New Identities." arXiv, 2010.

  4. Not quite, it wrongly identifies 1-periodic functions (those for which the equality f(x+1)=f(x)f(x+1) = f(x)) as "flattening out," but 1-periodic functions are unproblematic.