# integrate step function

let $f$ be a step function, $f:\left[0,2\right]\longrightarrow\mathbb{R} , f\left(x\right)=\begin{cases} 1 & 0\leq x<1\\ 3 & x=1\\ 2 & 1<x\leq2 \end{cases}$

intgerate ${\displaystyle \intop_0^2 f\left(x\right)\,dx}$ using the $U\left(f,P\right),L\left(f,P\right)$ definition.

-
Choose good partitions so that upper and lower sums are close. – GEdgar Apr 20 '12 at 17:04
@GEdgar that's part of the problem, how do you choose good partitions? – sony jimbo Apr 20 '12 at 17:06
Look at your $f$. Where can you get upper and lower sums with terms that are equal? How can you minimize difference for the rest? – GEdgar Apr 20 '12 at 17:10

Look at the graph of the function. Notice that it forms 2 rectangles, one that has width from 0 to 1 and height 0 to 1 and another that has width 1 to 2 and height 0 to 2. The point $f(1)=3$ doesn't it matter since it forms a rectangle with width 0. Choose your partitions so that they align with the steps in the step function. It should be easy to fill in the details from here.