# OpenStax-CNX

You are here: Home » Content » Analysis of Functions of a Single Variable » Integrals of Step Functions

### Recently Viewed

This feature requires Javascript to be enabled.

Inside Collection (Textbook):

Textbook by: Lawrence Baggett. E-mail the author

# Integrals of Step Functions

Module by: Lawrence Baggett. E-mail the author

Summary: We begin by defining the integral of certain (but not all) bounded, real-valued functions whose domains are closed bounded intervals. Later, we will extend the definition of integral to certain kinds of unbounded complex-valued functions whose domains are still intervals, but which need not be either closed or bounded.

We begin by defining the integral of certain (but not all) bounded, real-valued functions whose domains are closed bounded intervals. Later, we will extend the definition of integral to certain kinds of unbounded complex-valued functions whose domains are still intervals, but which need not be either closed or bounded. First, we recall from (Reference) the following definitions.

Definition 1:

Let [a,b][a,b] be a closed bounded interval of real numbers. By a partition of [a,b][a,b] we mean a finite set P={x0<x1<...<xn}P={x0<x1<...<xn} of n+1n+1 points, where x0=ax0=a and xn=b.xn=b.

The nn intervals {[xi-1,xi]}{[xi-1,xi]} are called the closed subintervals of the partition P,P, and the nn intervals {(xi-1,xi)}{(xi-1,xi)} are called the open subintervals or elements of P.P.

We write PP for the maximum of the numbers (lengths of the subintervals) {xi-xi-1},{xi-xi-1}, and call PP the mesh size of the partition P.P.

If a partition P={xi}P={xi} is contained in another partition Q={yj},Q={yj}, i.e., each xixi equals some yj,yj, then we say that QQ is finer than P.P.

Let ff be a function on an interval [a,b],[a,b], and let P={x0<...<xn}P={x0<...<xn} be a partition of [a,b].[a,b]. Physicists often consider sums of the form

S P , { y i } = i = 1 n f ( y i ) ( x i - x i - 1 ) , S P , { y i } = i = 1 n f ( y i ) ( x i - x i - 1 ) ,
(1)

where yiyi is a point in the subinterval (xi-1,xi).(xi-1,xi). These sums (called Riemann sums) are approximations of physical quantities, and the limit of these sums, as the mesh of the partition becomes smaller and smaller, should represent a precise value of the physical quantity. What precisely is meant by the “ limit” of such sums is already a subtle question, but even having decided on what that definition should be, it is as important and difficult to determine whether or not such a limit exists for many (or even any) functions f.f. We approach this question from a slightly different point of view, but we will revisit Riemann sums in the end.

Again we recall from (Reference) the following.

Definition 2:

Let [a,b][a,b] be a closed bounded interval in R.R. A real-valued function h:[a,b]Rh:[a,b]R is called a step function if there exists a partition P={x0<x1<...<xn}P={x0<x1<...<xn} of [a,b][a,b] such that for each 1in1in there exists a number aiai such that h(x)=aih(x)=ai for all x(xi-1,xi).x(xi-1,xi).

REMARK A step function hh is constant on the open subintervals (or elements) of a certain partition. Of course, the partition is not unique. Indeed, if PP is such a partition, we may add more points to it, making a larger partition having more subintervals, and the function hh will still be constant on these new open subintervals. That is, a given step function can be described using various distinct partitions.

Also, the values of a step function at the partition points themselves is irrelevant. We only require that it be constant on the open subintervals.

## Exercise 1

Let hh be a step function on [a,b],[a,b], and let P={x0<x1<...<xn}P={x0<x1<...<xn} be a partition of [a,b][a,b] such that h(x)=aih(x)=ai on the subinterval (xi-1,xi)(xi-1,xi) determined by P.P.

1. Prove that the range of hh is a finite set. What is an upper bound on the cardinality of this range?
2. Prove that hh is differentiable at all but a finite number of points in [a,b].[a,b]. What is the value of h'h' at such a point?
3. Let ff be a function on [a,b].[a,b]. Prove that ff is a step function if and only if f'(x)f'(x) exists and =0=0 for every x(a,b)x(a,b) except possibly for a finite number of points.
4. What can be said about the values of hh at the endpoints {xi}{xi} of the subintervals of P?P?
5. (e) Let hh be a step function on [a,b],[a,b], and let jj be a function on [a,b][a,b] for which h(x)=j(x)h(x)=j(x) for all x[a,b]x[a,b] except for one point c.c. Show that jj is also a step function.
6. If kk is a function on [a,b][a,b] that agrees with a step function hh except at a finite number of points c1,c2,...,cN,c1,c2,...,cN, show that kk is also a step function.

## Exercise 2

Let [a,b][a,b] be a fixed closed bounded interval in R,R, and let H([a,b])H([a,b]) denote the set of all step functions on [a,b].[a,b].

1. Using Part (c) of Exercise 1, prove that the set H([a,b])H([a,b]) is a vector space of functions; i.e., it is closed under addition and scalar multiplication.
2. Show that H([a,b])H([a,b]) is closed under multiplication; i.e., if h1,h2H([a,b]),h1,h2H([a,b]), then h1h2H([a,b]).h1h2H([a,b]).
3. Show that H([a,b])H([a,b]) is closed under taking maximum and minimum and that it contains all the real-valued constant functions.
4. We call a function χχ an indicator function if it equals 1 on an interval (c,d)(c,d) and is 0 outside [c,d].[c,d]. To be precise, we will denote this indicator function by χ(c,d).χ(c,d). Prove that every indicator function is a step function, and show also that every step function hh is a linear combination of indicator functions:
h=j=1najχ(cj,dj).h=j=1najχ(cj,dj).
(2)
5. Define a function kk on [0,1][0,1] by setting k(x)=0k(x)=0 if xx is a rational number and k(x)=1k(x)=1 if xx is an irrational number. Prove that the range of kk is a finite set, but that kk is not a step function.

Our first theorem in this chapter is a fundamental consistency result about the “area under the graph” of a step function. Of course, the graph of a step function looks like a collection of horizontal line segments, and the region under this graph is just a collection of rectangles. Actually, in this remark, we are implicitly thinking that the values {ai}{ai} of the step function are positive. If some of these values are negative, then we must re-think what we mean by the area under the graph. We first introduce the following bit of notation.

Definition 3:

Let hh be a step function on the closed interval [a,b].[a,b]. Suppose P={x0<x1<...<xn}P={x0<x1<...<xn} is a partition of [a,b][a,b] such that h(x)=aih(x)=ai on the interval (xi-1,xi).(xi-1,xi). Define the weighted average of hhrelative toPP to be the number SP(h)SP(h) defined by

S P ( h ) = i = 1 n a i ( x i - x i - 1 ) . S P ( h ) = i = 1 n a i ( x i - x i - 1 ) .
(3)

REMARK Notice the similarity between the formula for a weighted average and the formula for a Riemann sum. Note also that if the interval is a single point, i.e., a=b,a=b, then the only partition PP of the interval consists of the single point x0=a,x0=a, and every weighted average SP(h)=0.SP(h)=0.

The next theorem is not a surprise, although its proof takes some careful thinking. It is simply the assertion that the weighted averages are independent of the choice of partition.

## Theorem 1

Let hh be a step function on the closed interval [a,b].[a,b]. Suppose P={x0<x1<...<xn}P={x0<x1<...<xn} is a partition of [a,b][a,b] such that h(x)=aih(x)=ai on the interval (xi-1,xi),(xi-1,xi), and suppose Q={y0<y1<...<ym}Q={y0<y1<...<ym} is another partition of [a,b][a,b] such that h(x)=bjh(x)=bj on the interval (yj-1,yj).(yj-1,yj). Then the weighted average of hh relative to PP is the same as the weighted average of hh relative to Q.Q. That is, SP(h)=SQ(h).SP(h)=SQ(h).

### Proof

Suppose first that the partition QQ is obtained from the partition PP by adding one additional point. Then m=n+1,m=n+1, and there exists an i0i0 between 1 and n-1n-1 such that

1. for 0ii00ii0 we have yi=xi.yi=xi.
2.    xi0<yi0+1<xi0+1.xi0<yi0+1<xi0+1.
3. For i0<ini0<in we have xi=yi+1.xi=yi+1.

In other words, yi0+1yi0+1 is the only point of QQ that is not a point of P,P, and yi0+1yi0+1 lies strictly between xi0xi0 and xi0+1.xi0+1.

Because hh is constant on the interval (xi0,xi0+1)=(yi0,yi0+2),(xi0,xi0+1)=(yi0,yi0+2), it follows that

1. For 1ii0,1ii0,ai=bi.ai=bi.
2.    bi0+1=bi0+2=ai0+1.bi0+1=bi0+2=ai0+1.
3. For i0+1in,i0+1in,ai=bi+1.ai=bi+1.

So,

S P ( h ) = i = 1 n a i ( x i - x i - 1 ) = i = 1 i 0 a i ( x i - x i - 1 ) + a i 0 + 1 ( x i 0 + 1 - x i 0 ) + i = i 0 + 2 n a i ( x i - x i - 1 ) = i = 1 i 0 b i ( y i - y i - 1 ) + a i 0 + 1 ( y i 0 + 2 - y i 0 ) + i = i 0 + 2 n b i + 1 ( y i + 1 - y i ) = i = 1 i 0 b i ( y i - y i - 1 ) + a i 0 + 1 ( y i 0 + 2 - y i 0 + 1 + y i 0 + 1 - y i 0 ) + i = i 0 + 3 n + 1 b i ( y i - y i - 1 ) = i = 1 i 0 b i ( y i - y i - 1 ) + b i 0 + 1 ( y i 0 + 1 - y i 0 ) + b i 0 + 2 ( y i 0 + 2 - y i 0 + 1 ) + i = i 0 + 3 m b i ( y i - y i - 1 ) = i = 1 m b i ( y i - y i - 1 ) = S Q ( h ) , S P ( h ) = i = 1 n a i ( x i - x i - 1 ) = i = 1 i 0 a i ( x i - x i - 1 ) + a i 0 + 1 ( x i 0 + 1 - x i 0 ) + i = i 0 + 2 n a i ( x i - x i - 1 ) = i = 1 i 0 b i ( y i - y i - 1 ) + a i 0 + 1 ( y i 0 + 2 - y i 0 ) + i = i 0 + 2 n b i + 1 ( y i + 1 - y i ) = i = 1 i 0 b i ( y i - y i - 1 ) + a i 0 + 1 ( y i 0 + 2 - y i 0 + 1 + y i 0 + 1 - y i 0 ) + i = i 0 + 3 n + 1 b i ( y i - y i - 1 ) = i = 1 i 0 b i ( y i - y i - 1 ) + b i 0 + 1 ( y i 0 + 1 - y i 0 ) + b i 0 + 2 ( y i 0 + 2 - y i 0 + 1 ) + i = i 0 + 3 m b i ( y i - y i - 1 ) = i = 1 m b i ( y i - y i - 1 ) = S Q ( h ) ,
(4)

which proves the theorem in this special case where QQ is obtained from PP by adding just one more point.

It follows easily now by induction that if QQ is obtained from PP by adding any finite number of additional points, then hh is constant on each of the open subintervals determined by Q,Q, and SQ(h)=SP(h).SQ(h)=SP(h).

Finally, let Q={y0<y1<...<ym}Q={y0<y1<...<ym} be an arbitrary partition of [a,b],[a,b], for which hh is constant on each of the open subintervals (yj-1,yj)(yj-1,yj) determined by Q.Q. Define RR to be the partition of [a,b][a,b] obtained by taking the union of the partition points {xi}{xi} and {yj}.{yj}. Then RR is a partition of [a,b][a,b] that is obtained by adding a finite number of points to the partition P,P, whence SR(h)=SP(h).SR(h)=SP(h). Likewise, RR is obtained from the partition QQ by adding a finite number of points, whence SR(h)=SQ(h),SR(h)=SQ(h), and this proves that SQ(h)=SP(h),SQ(h)=SP(h), as desired.

Definition 4:

Let [a,b][a,b] be a fixed closed bounded interval in R.R. We define the integral of a step function hh on [a,b],[a,b], and denote it by h,h, as follows: If P={x0<x1<...<xn}P={x0<x1<...<xn} is a partition of [a,b],[a,b], for which h(x)=aih(x)=ai for all x(xi-1,xi),x(xi-1,xi), then

h = S P ( h ) = i = 1 n a i ( x i - x i - 1 ) . h = S P ( h ) = i = 1 n a i ( x i - x i - 1 ) .
(5)

REMARK The integral of a step function hh is defined to be the weighted average of hh relative to a partition PP of [a,b].[a,b]. Notice that the preceding theorem is crucial in order that this definition of hh be unambiguously defined. The integral of a step function should not depend on which partition is used. Theorem 1 asserts precisely this fact.

Note also that if the interval is a single point, i.e., a=b,a=b, then the integral of every step function hh is 0.

We use a variety of notations for the integral of h:h:

h = a b h = a b h ( t ) d t . h = a b h = a b h ( t ) d t .
(6)

The following exercise provides a very useful way of describing the integral of a step function. Not only does it show that the integral of a step function looks like a Riemann sum, but it provides a description of the integral that makes certain calculations easier. See, for example, the proof of the next theorem.

## Exercise 3

Suppose hh is a step function on [a,b][a,b] and that R={z0<z1<...<zn}R={z0<z1<...<zn} is a partition of [a,b][a,b] for which hh is constant on each subinterval (zi-1,zi)(zi-1,zi) of R.R.

1. Prove that
h=SR(h)=i=1nh(wi)(zi-zi-1),h=SR(h)=i=1nh(wi)(zi-zi-1),
(7)
where, for each 1in,1in,wiwi is any point in (zi-1,zi).(zi-1,zi). (Note then that the integral of a step function takes the form of a Riemann sum.)
2. Show that hh is independent of the values of hh at the points {zi}{zi} of the partition R.R.

## Exercise 4

Let h1h1 and h2h2 be two step functions on [a,b].[a,b].

1. Suppose that h1(x)=h2(x)h1(x)=h2(x) for all x[a,b]x[a,b] except for one point c.c. Prove that h1=h2.h1=h2. HINT: Let PP be a partition of [a,b],[a,b], for which both h1h1 and h2h2 are constant on its open subintervals, and for which cc is one of the points of P.P. Now use the preceding exercise to calculate the two integrals.
2. Suppose h1(x)=h2(x)h1(x)=h2(x) for all but a finite number of points c1,...,cN[a,b].c1,...,cN[a,b]. Prove that h1=h2.h1=h2.

We have used the terminology “weighted average” of a step function relative to a partition P.P. The next exercise shows how the integral of a step function can be related to an actual average value of the function.

## Exercise 5

Let hh be a step function on the closed interval [a,b],[a,b], and let P={x0<x1<...<xn}P={x0<x1<...<xn} be a partition of [a,b][a,b] for which h(x)=aih(x)=ai on the interval (xi-1,xi).(xi-1,xi). Let us think of the interval [a,b][a,b] as an interval of time, and suppose that the function hh assumes the value aiai for the interval of time between xi-1xi-1 and xi.xi. Show that the average value A(h)A(h) taken on by hh throughout the entire interval ([a,b][a,b]) of time is given by

A ( h ) = h b - a . A ( h ) = h b - a .
(8)

## Theorem 2

Let H([a,b])H([a,b]) denote the vector space of all step functions on the closed interval [a,b].[a,b]. Then the assignment hhhh of H([a,b])H([a,b]) into RR has the following properties:

1.  (Linearity)  H([a,b])H([a,b]) is a vector space. Furthermore, (h1+h2)=h1+h2,(h1+h2)=h1+h2, and ch=chch=ch for all h1,h2,hH([a,b]),h1,h2,hH([a,b]), and for all real numbers c.c.
2. If h=i=1naiχ(ci,di)h=i=1naiχ(ci,di) is a linear combination of indicator functions (See part (d) of Exercise 2), then h=i=1nai(di-ci).h=i=1nai(di-ci).
3.  (Positivity) If h(x)0h(x)0 for all x[a,b],x[a,b], then h0.h0.
4.  (Order-preserving) If h1h1 and h2h2 are step functions for which h1(x)h2(x)h1(x)h2(x) for all x[a,b],x[a,b], then h1h2.h1h2.

### Proof

That H([a,b])H([a,b]) is a vector space was proved in part (a) of Exercise 2. Suppose P={x0<x1<...<xn}P={x0<x1<...<xn} is a partition of [a,b][a,b] such that h1(x)h1(x) is constant for all x(xi-1,xi),x(xi-1,xi), and suppose Q={y0<y1<...<ym}Q={y0<y1<...<ym} is a partition of [a,b][a,b] such that h2(x)h2(x) is constant for all x(yj-1,yj).x(yj-1,yj). Let R={z0<z1<...<zr}R={z0<z1<...<zr} be the partition of [a,b][a,b] obtained by taking the union of the xixi's and the yjyj's. Then h1h1 and h2h2 are both constant on each open subinterval of R,R, since each such subinterval is contained in some open subinterval of PP and also is contained in some open subinterval of Q.Q. Therefore, h1+h2h1+h2 is constant on each open subinterval of R.R. Now, using Exercise 3, we have that

( h 1 + h 2 ) = k = 1 r ( ( h 1 + h 2 ) ( w k ) ) ( z k - z k - 1 ) = k = 1 r h 1 ( w k ) ( z k - z k - 1 ) + k = 1 r h 2 ( w k ) ( z k - z k - 1 ) = h 1 + h 2 . ( h 1 + h 2 ) = k = 1 r ( ( h 1 + h 2 ) ( w k ) ) ( z k - z k - 1 ) = k = 1 r h 1 ( w k ) ( z k - z k - 1 ) + k = 1 r h 2 ( w k ) ( z k - z k - 1 ) = h 1 + h 2 .
(9)

This proves the first assertion of part (1).

Next, let P={x0<x1<...<xn}P={x0<x1<...<xn} be a partition of [a,b][a,b] such that h(x)h(x) is constant on each open subinterval of P.P. Then ch(x)ch(x) is constant on each open subinterval of P,P, and using Exercise 3 again, we have that

( c h ) = i = 1 n c h ( w i ) ( x i - x i - 1 ) = c i = 1 n h ( w i ) ( x i - x i - 1 ) = c h , ( c h ) = i = 1 n c h ( w i ) ( x i - x i - 1 ) = c i = 1 n h ( w i ) ( x i - x i - 1 ) = c h ,
(10)

which completes the proof of the other half of part (1).

To see part (2), we need only verify that χ(ci,di)=di-ci,χ(ci,di)=di-ci, for then part (2) will follow from part (1). But χ(ci,di)χ(ci,di) is just a step function determined by the four point partition {a,ci,di,b}{a,ci,di,b} and values 0 on (a,ci)(a,ci) and (di,b)(di,b) and 1 on (ci,di).(ci,di). Therefore, we have that χ(ci,di)=di-ci.χ(ci,di)=di-ci.

If h(x)0h(x)0 for all x,x, and P={x0<x1<...<xn}P={x0<x1<...<xn} is as above, then

h = i = 1 n h ( w i ) ( x i - x i - 1 ) 0 , h = i = 1 n h ( w i ) ( x i - x i - 1 ) 0 ,
(11)

and this proves part (3).

Finally, suppose h1(x)h2(x)h1(x)h2(x) for all x[a,b].x[a,b]. By Exercise 2, we know that the function h3=h2-h1h3=h2-h1 is a step function on [a,b].[a,b]. Also, h3(x)0h3(x)0 for all x[a,b].x[a,b]. So, by part (3), h30.h30. Then, by part (1),

0 h 3 = ( h 2 - h 1 ) = h 2 - h 1 , 0 h 3 = ( h 2 - h 1 ) = h 2 - h 1 ,
(12)

which implies that h1h2,h1h2, as desired.

## Exercise 6

1. Let hh be the constant function cc on [a,b].[a,b]. Show that h=c(b-a).h=c(b-a).
2. Let a<c<d<ba<c<d<b be real numbers, and let hh be the step function on [a,b][a,b] that equals rr for c<x<dc<x<d and 0 otherwise. Prove that abh(t)dt=r(d-c).abh(t)dt=r(d-c).
3. Let hh be a step function on [a,b].[a,b]. Prove that |h||h| is a step function, and that |h||h|.|h||h|. HINT: Note that -|h|(x)h(x)|h|(x).-|h|(x)h(x)|h|(x). Now use the preceding theorem.
4. Suppose hh is a step function on [a,b][a,b] and that cc is a constant for which |h(x)|c|h(x)|c for all x[a,b].x[a,b]. Prove that |h|c(b-a).|h|c(b-a).

## Content actions

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

#### Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

#### Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks