For a given function over a partition of a given interval, the upper sum is the sum of box areas using the greatest value of the function ) in each subinterval .