EXPLORE
MATHEMATICS

Staircase math

The Fundamental Theorem of Finite Calculus says something remarkably simple:

On a staircase,the step heights you climb add up to your elevation gain.lower floorupper floorelevationgain

Believe it or not, this Fundamental Theorem will 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.

... groundupstairs01234

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

... ground0149

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

...

As special cases of the General Staircase, we have 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.

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^{\htmlClass{minus}{-}}(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.

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.

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:

Thus the Fundamental Theorem is written algebraically as

$$\htmlClass{left-sum left-sum-3}{f^-(a)+f^-(a+1)+\dots+f^-(b-1)}$$
$$=\htmlClass{right-difference}{f(b)-f(a)}$$

or more elegantly as $$\htmlClass{left-sum left-sum-4}{\sum_{n=a}^{b-1}f^-(n)} = \htmlClass{right-difference}{f(n){\Large\vert}^b_a}$$ upon adopting new notations $\Sigma$ and $\vert$. Here we read

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$$

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:

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

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.$$ So
$$\sum_{n=0}^{50-1}(2n+1)=n^2{\Large\vert}^{50}_0$$
$$=50^2-0^2=2500.$$

Finite calculus

The staircase math we've been talking about is more commonly called finite calculus, and it essentially involves reinterpreting addition and subtraction geometrically.

Subtraction as change in height

In terms of geometry, subtraction just means computing the step height as the difference in height between two adjacent rectangles.

Addition as signed area

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

Start with flat land.

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

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

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 negative heights (for holes).

SIGNEDAREAheight 0height 2height 1height 0= 0 + 2 + 1 + 0 + 0 = 3height -1= 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 example has 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.

= 0 + 1 + 0 + -1 + 0 = 0

Visualizing sums as signed areas is clutch because simple shapes have simple areas.

100100100101Flippedcopy1 + 2 + 3 + ··· + 99 + 100 =AREA=12AREA=12× 100 × 101

This is the same way the area of a triangle is found.

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.

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$.

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)$$

$$\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, often written with $a=0$.
Example. Applying summation to $n=\tfrac{1}{2}(2n+1)-\tfrac{1}{2}\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*} $$ 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 infinitesimal calculus works.