Tutorials › Calculus I › Step Functions and Jump Discontinuities

Riemann Sums and the Integral · Tutorial 959 of 1495

Step Functions and Jump Discontinuities

Use tagged sums to compute the integral of a step function and control the contributions from subintervals that cross its jumps.

Intermediate 10 min read

What You'll Learn

  • Define a step function using a finite subdivision and constant values on its open subintervals.
  • Write a tagged Riemann sum and identify the partition mesh.
  • Compute a step function’s integral as a finite sum of constant values times interval lengths.
  • Bound the effect of partition intervals that contain a subdivision point.
  • Explain why tagged sums converge even when no partition point is a jump.
  • Recognize why a jump value or a crossing interval cannot be treated as an entire segment’s contribution.

Why a Jump Does Not Prevent Integration

A step function stays constant between certain points and may change value abruptly at those points. Such a jump can affect a tagged Riemann sum: if a partition interval crosses the jump, the tag selects a function value from one location, and that value is multiplied by the width of the whole interval.

The key is that only a small number of partition intervals can cross the finitely many jumps. As the largest interval width shrinks, the total contribution of those crossing intervals shrinks too. We will use this fact to compute the integral directly from tagged sums, without requiring every partition to include every jump.

Step Functions and Tagged Sums

Definition: A function \(f:[a,b]\to\mathbb R\) is a step function if there is a finite subdivision \(a=c_0<c_1<\cdots<c_k=b\) such that, for each \(j=1,\ldots,k\), \(f\) is constant on the open interval \((c_{j-1},c_j)\). The values of \(f\) at the subdivision points may be specified separately.

The finite subdivision is essential: its open intervals cover the whole domain apart from the finitely many subdivision points. A function merely constant on some open intervals need not be a step function if its values elsewhere are unrestricted.

For a partition \(P\) of \([a,b]\), write \(a=x_0<x_1<\cdots<x_n=b\). Choose a tag \(\xi_i\in[x_{i-1},x_i]\) for each subinterval. The tagged Riemann sum is

$$ S(P,f)=\sum_{i=1}^{n} f(\xi_i)(x_i-x_{i-1}). $$

The mesh of the partition is the width of its largest subinterval:

$$ \|P\|=\max_{1\leq i\leq n}(x_i-x_{i-1}). $$

To show that \(f\) is Riemann integrable, it is enough to show that all tagged sums approach the same limit as the mesh approaches zero. In particular, the tags may be chosen independently for each partition.

The Integral Formula

Let \(d_j\) be the constant value of \(f\) on \((c_{j-1},c_j)\). The candidate integral is the sum of each constant value times the length of the interval on which it applies.

Theorem: If \(f\) is a step function on the finite subdivision \(a=c_0<c_1<\cdots<c_k=b\), with value \(d_j\) on \((c_{j-1},c_j)\), then \(f\) is Riemann integrable and
$$ \int_a^b f(x)\,dx = \sum_{j=1}^{k}d_j(c_j-c_{j-1}). $$

The values assigned at the subdivision points do not appear as separate terms in this formula. The proof below explains why their possible influence on tagged sums disappears as the mesh shrinks.

Why the Formula Works

Because there are only finitely many constant values and subdivision-point values, \(f\) is bounded. Choose \(M\geq 0\) such that \(|f(x)|\leq M\) for every \(x\in[a,b]\). Let \(T\) denote the proposed finite sum in the theorem.

For any partition interval \(I=[x_{i-1},x_i]\), define its target contribution to be the sum of the constant values multiplied by the lengths of the portions of \(I\) lying in the corresponding open segments. Endpoints have length zero, so they contribute nothing to this target. Adding the target contributions over all partition intervals gives exactly \(T\).

Call a partition interval exceptional if it contains at least one subdivision point \(c_j\). Every interval that is not exceptional lies entirely inside one open segment. On such an interval, the function is constant, so its tagged contribution is exactly its target contribution, whatever tag is chosen.

Only exceptional intervals can create an error. Each tagged contribution on an exceptional interval of width \(w\) has absolute value at most \(Mw\). Its target contribution also has absolute value at most \(Mw\), since every constant value has absolute value at most \(M\) and the lengths of the portions add to at most \(w\). Thus the discrepancy on that interval is at most \(2Mw\).

There are \(k+1\) subdivision points, including the endpoints. Any one point belongs to at most two partition intervals, so the number of exceptional intervals is at most \(2(k+1)\). Each has width at most \(\|P\|\). Therefore

$$ |S(P,f)-T| \leq 2M\bigl(2(k+1)\|P\|\bigr) =4M(k+1)\|P\|. $$

If \(M=0\), the function is zero everywhere and the conclusion is immediate. If \(M>0\), then for any \(\varepsilon>0\), taking \(\|P\|<\varepsilon/[4M(k+1)]\) makes \(|S(P,f)-T|<\varepsilon\), for every choice of tags. This proves that all tagged sums converge to \(T\), establishing both integrability and the stated formula.

1
Separate ordinary intervals from exceptional ones.
On an interval that contains no subdivision point, the function is constant and the tagged contribution is exact.
2
Bound the error near the jumps.
Each exceptional interval contributes an error of at most twice the bound on the function times its width.
3
Let the mesh shrink.
There are only finitely many exceptional intervals, and each becomes short, so their total possible error tends to zero.

Worked Example: A Jump Inside a Tagged Interval

Worked Example: A Jump Inside a Tagged Interval

Define \(f:[0,1]\to\mathbb R\) by \(f(x)=3\) for \(0\leq x<1/2\), \(f(x)=-1\) for \(1/2<x\leq1\), and \(f(1/2)=4\). The two open segments have lengths \(1/2\) and \(1/2\). The formula gives

$$ \int_0^1 f(x)\,dx =3\left(\frac12\right)+(-1)\left(\frac12\right) =\frac32-\frac12 =1. $$

Now take a uniform partition into an odd number \(n=2m+1\) of intervals. Its mesh is \(1/n\), and the jump \(1/2\) lies inside the middle interval. Choose any tags on the other intervals and let \(\xi\) be the tag in the crossing interval.

There are \(m\) intervals entirely to the left of the jump and \(m\) entirely to the right. Their total contributions are \(3m/n\) and \(-m/n\), respectively. The crossing interval contributes \(f(\xi)/n\). Thus

$$ S(P,f)=\frac{3m}{n}-\frac{m}{n}+\frac{f(\xi)}{n} =\frac{2m+f(\xi)}{n}. $$

Since \(2m=n-1\), the difference from the proposed integral is

$$ S(P,f)-1 =\frac{2m+f(\xi)-n}{n} =\frac{f(\xi)-1}{n}. $$

The tag can select a value of \(3\), \(-1\), or \(4\), so the difference can be \(2/n\), \(-2/n\), or \(3/n\). In every case it tends to zero as \(n\) increases. The tagged sums therefore approach \(1\), as the integral formula predicts.

For a direct check, when \(n=3\), the midpoint of the crossing interval is the jump itself. The three contributions are \(3(1/3)=1\), \(4(1/3)=4/3\), and \((-1)(1/3)=-1/3\), giving \(S(P,f)=2\). This is not the integral, but the discrepancy is \(1\), equal to \(3/n\). As the mesh shrinks, the crossing interval’s influence shrinks with it.

Worked Example: Several Constant Segments

Worked Example: Several Constant Segments

On \([-1,2]\), let \(f\) equal \(-2\) on \((-1,0)\), \(5\) on \((0,1)\), and \(1\) on \((1,2)\). Set \(f(0)=7\), \(f(1)=-4\), and assign the endpoint values \(f(-1)=-2\) and \(f(2)=1\). The subdivision points are \(-1,0,1,2\), and each open segment has length \(1\). Therefore

$$ \int_{-1}^{2} f(x)\,dx =(-2)(0-(-1))+5(1-0)+1(2-1) =-2+5+1 =4. $$

Here \(|f(x)|\leq 7\), and there are \(k=3\) open segments. The error estimate proved above gives, for every partition and every choice of tags,

$$ |S(P,f)-4|\leq 4(7)(3+1)\|P\|=112\|P\|. $$

This bound is not intended to be sharp; it guarantees convergence. For example, if \(\|P\|<1/112\), then every tagged sum differs from \(4\) by less than \(1\). More generally, making the mesh arbitrarily small makes the difference arbitrarily small. The two jump values, \(7\) and \(-4\), are covered by the bound \(M=7\), so tags at the jumps cause no exception to the argument.

As a check on the computed value, the three signed contributions are \(-2\), \(5\), and \(1\). Their sum is \(4\), which matches the value to which all tagged sums converge.

Worked Example: A Jump at a Nonaligned Point

Worked Example: A Jump at a Nonaligned Point

Define \(g:[0,1]\to\mathbb R\) to be \(0\) on \([0,1/3)\), \(3\) on \((1/3,1]\), and \(2\) at \(1/3\). The formula gives

$$ \int_0^1 g(x)\,dx =0\left(\frac13\right)+3\left(1-\frac13\right) =3\left(\frac23\right) =2. $$

For each positive integer \(m\), use the uniform partition with \(n=3m+1\) intervals and choose the midpoint of every interval as its tag. The interval from \(m/n\) to \((m+1)/n\) crosses \(1/3\): indeed, \(3m<3m+1\) and \(3m+3>3m+1\). Its midpoint is to the right of \(1/3\), since

$$ \frac{2m+1}{2(3m+1)}>\frac13 \quad\Longleftrightarrow\quad 3(2m+1)>2(3m+1) \quad\Longleftrightarrow\quad 6m+3>6m+2. $$

Thus the crossing interval’s tag has value \(3\). There are \(m\) intervals to its left, all with value \(0\), and \(2m\) intervals to its right, all with value \(3\). Including the crossing interval, the tagged sum is

$$ S(P,g) =0\left(\frac{m}{n}\right) +3\left(\frac{2m}{n}\right) +3\left(\frac1n\right) =\frac{6m+3}{3m+1} =2+\frac1{3m+1}. $$

As \(m\) increases, \(1/(3m+1)\) tends to zero, so these tagged sums tend to \(2\). Substituting \(m=1\) gives \(n=4\) and sum \(2+1/4=9/4\), which agrees with the four midpoint contributions: \(0\), \(3/4\), \(3/4\), and \(3/4\). The sequence’s limit agrees with the integral.

A Common Mistake: Treating a Crossing Interval as a Whole Segment

A tag determines the function value used for one rectangle in a tagged sum; it does not say that the entire partition interval belongs to the constant segment containing the tag. For the function in the first example, the midpoint tag at \(1/2\) gives the crossing interval the value \(4\), but that value does not replace the contributions of both constant segments in the integral.

For \(n=3\), the crossing interval has width \(1/3\) and contributes \(4/3\) to the tagged sum. It would be wrong to treat that single contribution as an exact evaluation of the integral, or to conclude that all tagged sums equal the integral. The actual sum is \(2\), while the integral is \(1\). The correction is to account for the crossing interval as an error that is bounded in size and then show that its width tends to zero as the mesh shrinks.

Key takeaway: Subintervals crossing jumps can make individual tagged sums differ from the integral. For a step function, there are only finitely many such intervals, and their total possible effect tends to zero as the partition mesh tends to zero.

Why Step Functions Matter

Step functions provide a direct link between finite sums and definite integrals. Each constant segment contributes its value multiplied by its width, while the tagged-sum argument explains why finitely many jumps do not obstruct convergence.

The distinction between an individual sum and its limit is important. A coarse partition can have a crossing interval wide enough to noticeably affect the sum. Integrability is not a claim that every sum is already equal to the integral; it is a claim that all tagged sums become arbitrarily close to the same value when their mesh is sufficiently small.

Check Your Understanding

Use the definition, formula, and error argument above to answer these questions.

  1. What finite-subdivision condition is required in the definition of a step function?
  2. For a step function with values \(d_j\) on \((c_{j-1},c_j)\), what finite sum gives its integral?
  3. Why do tagged intervals that do not contain subdivision points contribute exactly their target amounts?
  4. Why can only finitely many partition intervals be exceptional for a step function?
  5. What does the first example show about the difference between one tagged sum and the integral?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon