Integral of a Staircase function
Let be a staircase function with respect to the partition
of , and let be such that
for and .
Then the integral of is defined by
Let be a staircase function with respect to the partitions
and of .
Then we have
How to use
-
Visualize the integral of a staircase function
as a sum of signed rectangle areas.
-
Check that the value of the integral does not depend on whether you compute it using partition , partition , or their common refinement.
-
Drag the blue points and on the -axis to choose the integration interval.
- The applet always uses .
-
Use the buttons:
- Z1 [ON/OFF] to show/hide partition ,
- Z2 [ON/OFF] to show/hide partition .
- Turning both on shows their union, i.e. a refinement.
-
The blue staircase is the function (piecewise constant, with jumps).
-
Vertical partition marks indicate the active partition points:
- orange marks: cuts coming from ,
- purple marks: cuts coming from ,
- purple dashed marks: cuts that belong to both partitions (overlap).
-
The shaded rectangles represent the terms :
- rectangles above the -axis contribute positively,
- rectangles below the -axis contribute negatively.
-
The text at the bottom shows the current total:
Partition Z1: I = ..., orPartition Z2: I = ..., orRefinement Z: I = ...(when both are active).
-
Inside each rectangle, a small label shows the numerical value of that sub-interval contribution (after you release the mouse).
-
Turn Z1 ON (and Z2 OFF): observe the rectangles and the displayed total .
-
Turn Z2 ON (and Z1 OFF): observe the new rectangles and the displayed total .
-
Turn both ON: the applet uses the refinement (union of all cuts), producing more (thinner) rectangles.
-
Compare the totals: even though the individual rectangles change when you change partition, the final total stays the same (up to rounding), illustrating
-
Drag and so that the interval crosses a jump of the staircase: notice how the sum changes exactly when the interval includes more (or less) constant pieces.
-
If you turn both partitions OFF, the applet cannot form a sum and shows “Select a partition”.
- Hold Shift + scroll to zoom
- Hold Shift + drag to move
- Points shaped like <> act as sliders
Description
Reference: Lecture Notes Calculus 1 ( May22,2022 )Definition 7.1 page 121 and Theorem7.1 page 123
This applet illustrates the definition of partitions, refinement and integral of a staircase functions.
I selected a staircase function (to be integrated) by prescribed jump points and corresponding constant values on each interval.
const stepJumps = [-4, -1, 2, 5, 8];
const stepValues = [1.5, -2, 2.5, -1];
const phi = makeStepFunction(stepJumps, stepValues);
Two different partitions of the interval are considered: the partition , consisting of all points in that are multiples of , and the partition , consisting of all points in that are multiples of . Since these partitions partially overlap, their combination naturally produces a refinement, which is displayed when both partitions are active.
Toggle buttons allow each partition to be shown independently or simultaneously. When both are active, the applet highlights the refinement obtained by taking the union of their cuts. Vertical lines indicate partition points, while shaded rectangles represent the contribution of each subinterval to the integral.
By dragging the endpoints and , the interval of integration can be modified dynamically. The applet always integrates on , so the order of the two gliders does not matter.
During dragging, the partition cuts and areas are updated continuously; once the drag ends, the sum of each subinterval and their total sum are displayed.
For each subinterval the code picks the midpoint and computes the rectangle contribution , i could reuse the stored values, but i need a mid point to place the sum text.
const mid = (x1 + x2) / 2;
const h = phi(mid);
const subArea = h * (x2 - x1);
total += subArea;
This visual behavior mirrors the proof that the integral of a staircase function is independent of the chosen partition.