Looking for an example to understand integrals better

51 Views Asked by At

I'm self-studying Spivak's Calculus and I read about the definition of integral ---

A function $f$ which is bounded on $[a,b]$ is integrable on $[a,b]$ if $\sup\{L(f,P)\} = \inf\{U(f,P)\} $

Where $P$ is any partition of $[a,b]$, $L$ is the lower sum and $U$ is the upper sum.

I know that the definition uses supremum instead of maximum because it could be the case that the supremum is not in the set (same goes for infimum instead of minimum). However, I'm struggling to come up with an example where the integral of an integrable function is the supremum of $\{L(f,P)\}$ but not the maximum. Can you please give me an example?

UPDATE

@Mohit provided a great answer: $f(x) = x$. Then can I have an example where the supremum is in the set that's not a constant function?