EXPLORE
MATHEMATICS

Staircase
Calculus

Much of the intuition behind the calculus you see in school actually comes from understanding how staircases work. Compared to school calculus, the mathematics of staircases—more commonly known as finite calculusOther names for finite calculus: discrete calculus, sequence calculus, calculus of finite differences. —is much simpler. In fact, here is what the Fundamental Theorem of Finite Calculus tells us.

Fundamental Theorem of Finite Calculus: On a staircase, the step heights you climb add up to your elevation gain.FUNDAMENTAL THEOREM OF FINITE CALCULUSOn a staircase,the step heights you climb add up to your elevation gain.lower floorupper floorelevationgain

Surprisingly, this Fundamental Theorem can help us compute complicated sums. To do this, we first need our staircases to follow some pattern.

The simplest pattern is the Natural Numbers Staircase, where the first rectangle has height 1, the second rectangle has height 2, and so on. Everything we discuss here also works if we replace the natural numbers by the integers, resulting in the Integer Staircase that extends both leftward and rightward: Integers Staircase: As you walk right, the staircase goes up with step heights 1, 2, 3, and so on. As you walk left, the staircase goes down to the basement with step heights -1, -2, -3, and so on.-2-101234

Natural Numbers Staircase... ground01234upstairs

The Square Numbers Staircase is built from rectangles whose heights are square numbers: the first rectangle has height $1^2=1\times1=1$, the second has height $2^2=2\times2=4$, the third has height $3^2=3\times3=9$, and so on.

Square Numbers Staircase... ground0149

Finally, the General Staircase is built from rectangles of height $f(n)$ where $f$ is a function with natural numbers inputs $n$.

General Staircase...

As special cases of the General Staircase, we get back the Natural Numbers Staircase when $f(n)=n$ and the Square Numbers Staircase when $f(n)=n^2$.

Subtract rectangle heights to get step heights

Clearly the step heights in the Natural Numbers Staircase are all $1$. The Square Numbers Staircase is more interesting—as you walk right, its step heights are increasing odd numbers.

Step heights of the Natural Numbers Staircase, the Square Numbers Staircase, and the General Staircase are depicted by vertical arrows that start from the previous rectangle to the next rectangle. In the Square Numbers Staircase, the rectangle heights are 0, 1, 4, 9, 16, …, so the step heights are the successive differences 1-0=1, 4-1=3, 9-4=5, 16-9=7,….

In general, the $n$th step height is the difference in height between the $n$th rectangle and the $(n+1)$st rectangle. So in the General Staircase, the $n$th step height is $$f^{\htmlId{hMinus1}{-}}(n)=f(n+1)-f(n).$$ We introduce this handy superscript minus sign notation to remind us to subtract. Therefore the $n$th step height of the Natural Numbers Staircase and the Square Numbers Staircase can also be calculated algebraically as follows.

$\boldsymbol n$th step height
General Staircase
$$f^-(n)$$
$$=f(n+1)-f(n)$$
Natural Numbers Staircase
$\small f(n)=n$
$$(n)^-$$
$$=(n+1)-n$$
$$=1$$
Square Numbers Staircase
$\small f(n)=n^2$
$$(n^2)^-$$
$$=(n+1)^2-n^2$$
$$=2n+1$$
$$=\text{odd number}$$

Add step heights to get elevation gain

Recall that the Fundamental Theorem of Finite Calculus says that the step heights you have taken add up to your elevation gain.

With the Natural Numbers Staircase, this means that the difference of two numbers is a sum of that many $1$'s.

In the Natural Numbers Staircase, walking from the rectangle of height 1 to the rectangle of height 4 results in an elevation gain of 4-1=3. Or we can write this as 1+1+1 if we add up the intermediate step heights.step heights add up to elevation gain1 + 1 + 1 = 4 - 1

With the Square Numbers Staircase, this means that the difference of two square numbers is a sum of consecutive odd numbers.

In the Square Numbers Staircase, walking from the ground (height 0) to the rectangle of height 9 results in an elevation gain of 9-0=9. Or we can write this as 1+3+5 if we add up the intermediate step heights.step heights add up to elevation gain1 + 3 + 5 = 9 - 0

Now consider the General Staircase whose $n$th rectangle height is $f(n)$. If we walk from its $a$th rectangle up to its $b$th rectangle, the resulting picture looks like this:

The step heights of the General Staircase at n=a, n=a+1, …, n=b-1, add up to f(b)-f(a)

Thus the Fundamental Theorem is written algebraically as

$$\htmlId{hLeftSum1}{f^-(a)+f^-(a+1)+\dots+f^-(b-1)}$$
$$=\htmlId{hRightDifference1}{f(b)-f(a)}$$
$$\htmlId{hLeftSum1}{f^-(a)+f^-(a+1)\,+}$$
$$\htmlId{hLeftSum3}{\dots+f^-(b-1)}$$
$$=\htmlId{hRightDifference1}{f(b)-f(a)}$$

or more elegantly as $$\htmlId{hLeftSum2}{\sum_{n=a}^{b-1}f^-(n)} = \htmlId{hRightDifference2}{f(n){\Large\vert}^b_a}$$ upon adopting new notations $\Sigma$ and $\vert$. Here we read

  • $\displaystyle\sum_{n=a}^{b-1}f^-(n)$ as $f^-(n)$ summed from $a$ to $b-1$, and
  • $f(n){\Large\vert}^b_a$ as $f(n)$ evaluated from $a$ to $b$.

The evaluation bar notation $f(n){\large\vert}^b_a=f(b)-f(a)$ simply performs subtraction. The summation notation $\Sigma$ is way more awesome since it shortens a sum like $$1^2+2^2+3^2+4^2+\cdots+98^2+99^2+100^2$$ $$\begin{split}1^2+2^2&+3^2+4^2+\cdots\\&+98^2+99^2+100^2\end{split}$$ to just $\displaystyle\sum_{n=1}^{100}n^2.$

Here is what the Fundamental Theorem looks like for the Natural Numbers Staircase, the Square Numbers Staircase, and what we will call the Exponential Staircase.

Step heightsFundamental Theorem
General Staircase
$$f^-(n)$$
$$=f(n+1)-f(n)$$
$$\sum_{n=a}^{b-1}f^-(n)$$
$$=f(n){\Large\vert}^b_a$$
$$=f(b)-f(a)$$
Natural Numbers Staircase
$\small f(n)=n$
$$(n)^-=1$$
$$\sum_{n=a}^{b-1}1$$
$$=n{\Large\vert}^b_a$$
$$=b-a$$
Square Numbers Staircase
$\small f(n)=n^2$
$$(n^2)^-$$
$$=2n+1$$
$$\sum_{n=a}^{b-1}(2n+1)$$
$$=n^2{\Large\vert}^b_a$$
$$=b^2-a^2$$
Exponential Staircase
$\small f(n)=r^n$
$$(r^n)^-$$
$$=r^{n+1}-r^n$$
$$=(r-1)r^n$$
$$\sum_{n=a}^{b-1}(r-1)r^n$$
$$=r^n{\Large\vert}^b_a$$
$$=r^b-r^a$$
Step heights /
Fundamental Theorem
General Staircase
$$f^-(n)$$
$$=f(n+1)$$
$$-f(n)$$
$$\sum_{n=a}^{b-1}f^-(n)$$
$$=f(n){\Large\vert}^b_a$$
$$=f(b)-f(a)$$
Natural Numbers Staircase
$\small f(n)=n$
$$(n)^-=1$$
$$\sum_{n=a}^{b-1}1$$
$$=n{\Large\vert}^b_a$$
$$=b-a$$
Square Numbers Staircase
$\small f(n)=n^2$
$$(n^2)^-=2n+1$$
$$\sum_{n=a}^{b-1}(2n+1)$$
$$=n^2{\Large\vert}^b_a$$
$$=b^2-a^2$$
Exponential Staircase
$\small f(n)=r^n$
$$(r^n)^-$$
$$=r^{n+1}-r^n$$
$$=(r-1)r^n$$
$$\sum_{n=a}^{b-1}(r-1)r^n$$
$$=r^n{\Large\vert}^b_a$$
$$=r^b-r^a$$

In these examples, notice that subtraction formulas reverse into summation formulas. Ignoring subscripts and superscripts:

  • $(n)^-=1$ reverses into $\sum 1=n$, and
  • $(n^2)^-=2n+1$ reverses into $\sum (2n+1)=n^2$.

In other words, the Fundamental Theorem gives us a strategy to compute a sum $\sum g(n)$:

  • First recognize $g(n)$ as the differences $f^-(n)$ of some $f(n)$.
  • Next apply the Fundamental Theorem to conclude$$\sum_{n=a}^{b-1}g(n)=f(b)-f(a).$$
Example. To compute the sum
$$\sum_{n=0}^{49}(2n+1)=$$
$$1+3+5+7+9+\dots+99,$$
we recognize $2n+1$ as the differences of $n^2$ since $$(n^2)^-=2n+1.$$ Therefore,
$$\sum_{n=0}^{50-1}(2n+1)=n^2{\Large\vert}^{50}_0$$
$$=50^2-0^2=2500.$$

Finite calculus

There is actually a bit more to finite calculus.

We already saw how subtraction gets interpreted geometrically—take two adjacent rectangles and subtract their heights to get the step height.

The difference in height of two adjacent rectangles of heights f(n) and f(+1) is f(n+1)-f(n) and denoted by f^-(n).

With addition though, the preferred geometric interpretation in finite calculus is in terms of signed areas. Here is how this works.

Add rectangle heights to get signed area

Start with flat land.

Flat land

If we build a square mound, we gain one square of dirt.

Flat land with one square mound on top

If we dig a square hole, we lose one square of dirt.

Flat land with one square hole in it

Overall, the signed area of a shape is how much dirt we gain or lose compared to the barren, flat land we started with—it is the sum of the positive heights (for mounds) and the negative heights (for holes).

Upper picture: Land with a rectangular mound of height 2 and a rectangular mound of height 1. Its signed area is 3 units. Lower picture: Land with two square holes each of height -1. Its signed area is -2..SIGNEDAREAheight 0height 2height 1height 0height -1= 0 + 2 + 1 + 0 + 0 = 3= 0 + -1 + -1 + 0 + 0 = -2

We use the term signed area because mounds are assigned positive areas, while holes are assigned negative areas.

The next picture shows a signed area of zero due to cancellations between positive and negative areas. So this landscape has the same amount of dirt as the original flat land.

Signed area of land with a square mound and a square hole has the same area as the original flat land.= 0 + 1 + 0 + -1 + 0 = 0

Visualizing sums as signed areas is pretty nifty because simple shapes have simple areas. For instance, in the same way that we find the area of a triangle, we can also compute the sum

The sum 1+2+3+…+99+100 is equal to the area underneath the Natural Numbers Staircase from the first step to the hundredth step. This staircase is a jagged right triangle of width 100 and height 100. Its area is half the area of the rectangle obtained by piecing an upside down copy of this triangle to itself. The rectangle has width 100 and height 101. Therefore the original sum 1+2+3+…+99+100 equals (1/2) × 100 × 101.100100100101Flippedcopy1 + 2 + 3 + ··· + 99 + 100 =AREA=12AREA=12× 100 × 101

Basic rules

Some basic rules about summation formulas fall out naturally from our new geometric interpretation.

When we add two functions $f$ and $g$, the graph of $f+g$ is just the graphs of $f$ and $g$ stacked together. When we draw this out, the signed areas of these graphs clearly add together. The same is true for their height differences.

Stacking of two graphs of functions

Likewise, multiplying a function $f(n)$ by a constant $c$ stretches its graph vertically by $c$. Again, the signed area and height differences also scale by the same factor $c$.

The graph of a function stretched vertically by a factor of 2.

In symbols, the subtraction rules are then $$ \begin{align*} (f+g)^-(n)&=f^-(n)+g^-(n)\\[2ex] (c\cdot f)^-(n)&=c\cdot f^-(n) \end{align*} $$ and the summation rules are $$\sum_{n=a}^{b}\left[f(n)+g(n)\right]=\sum_{n=a}^{b}f(n)+\sum_{n=a}^{b}g(n)$$ $$ \begin{split} \sum_{n=a}^{b}[f&(n)+g(n)]\\ &=\sum_{n=a}^{b}f(n)+\sum_{n=a}^{b}g(n) \end{split} $$ $$\sum_{n=a}^{b}c\cdot f(n) = c\, \sum_{n=a}^{b}f(n)$$

Example. Applying the last rule to the Exponential Staircase gives
$$\sum_{n=a}^{b-1}(r-1)\,r^n=r^n{\Large\vert}^b_a\quad$$
$$\xRightarrow{\displaystyle\times \frac{1}{r-1}}\quad$$
$$\sum_{n=a}^{b-1}r^n=\left.\frac{r^n}{r-1}\right\rvert_a^b$$
This is the geometric series formula from high school algebra. You have probably seen it in the special case $a=0$ like this:
$$1+r+r^2+\cdots+r^{b-1}$$
$$=\frac{r^b-1}{r-1}$$
Example. Applying summation to $n=\tfrac12(2n+1)-\tfrac12\cdot 1$ gives
$$\begin{align*} \sum^{b-1}_{n=a} n &= \tfrac{1}{2}\sum^{b-1}_{n=a}(2n+1)-\tfrac{1}{2}\sum^{b-1}_{n=a}1\\[4ex] &= \tfrac{1}{2}(b^2-a^2)-\tfrac{1}{2}(b-a) \end{align*}$$
$$\begin{align*} &\phantom{=} \sum^{b-1}_{n=a} n\\[4ex] &= \tfrac{1}{2}\sum^{b-1}_{n=a}(2n+1)-\tfrac{1}{2}\sum^{b-1}_{n=a}1\\[4ex] &= \tfrac{1}{2}(b^2-a^2)-\tfrac{1}{2}(b-a) \end{align*}$$
This last equality follows from our Square Numbers Staircase and Natural Numbers Staircase examples. Letting $a=1$ and $b=101$, we once again find
$$1+2+3+\dots+99+100$$
$$=\tfrac{1}{2}(101^2-1)-\tfrac{1}{2}(101-1)$$
$$=5050$$

We can find fancier sums by developing finite calculus further, but we'll stop here. Let's now see how school calculus, aka infinitesimal calculus, works.