Maths WorkshopMaths problems with full solutions
Exercise 19Calculus › Single-variable calculus › Integration › Riemann integralHigh schoolAdded 5 Nov 2026

Step functions and their integrals

#step function#partition#integral

Statement

Let f:[0,3]→Rf:[0,3]\to\mathbb{R} be defined by
f(x)={1if 0≤x<1,3if 1≤x<2,−1if 2≤x≤3.f(x)=\begin{cases}1&\text{if }0\le x<1,\\ 3&\text{if }1\le x<2,\\ -1&\text{if }2\le x\le3.\end{cases}
Show that ff is a step function and compute ∫03f(x) dx\int_0^3 f(x)\,dx.

Hint

A step function is constant on the intervals of a partition. Identify the subdivision and sum ∑kck(xk−xk−1)\sum_k c_k(x_k-x_{k-1}).

Show solutionHide solution

Solution

Step function. Take the subdivision σ={0,1,2,3}\sigma=\{0,1,2,3\}. On each open interval ]0,1[]0,1[, ]1,2[]1,2[, ]2,3[]2,3[, ff is constant (1,3,−11,3,-1 respectively). The values at the subdivision points do not matter for the integral, so ff is a step function.

Integral.
∫03f=∑k=13ck(xk−xk−1)=1⋅1+3⋅1+(−1)⋅1=3.\int_0^3 f=\sum_{k=1}^3 c_k(x_k-x_{k-1})=1\cdot1+3\cdot1+(-1)\cdot1=3.

Conclusion. ff is a step function and ∫03f=3\int_0^3 f=3.