Let's say I want to evaluate the upper and lower Riemann Sums of the function $f(x)=x^2$ for the following partition on $[-1,1]$, $P = \{-1, -\frac{1}{2}, 1\}$
I'll start of with the definitions of upper and lower Riemann Sums, just to show you where I'm coming from, and so that you can see where any misunderstanding on my part would lie.
$$L(f, P) := \sum_{i=1}^{n}m_i(t_i - t_{i-1})$$ $$U(f, P) := \sum_{i=1}^{n}M_i(t_i - t_{i-1})$$ where $$m_i = \inf\{f(x): x \in [t_{i-1}, t_i]\}$$ $$M_i = \sup\{f(x): x \in [t_{i-1}, t_{i}]\}$$
This is what I did :
Since $f$ is continuous on $[-1,1]$, $m_i = \min\{f(x): x \in [t_{i-1}, t_i]\}$ and $M_i = \max\{f(x): x \in [t_{i-1}, t_i]\}$
Lower Sum (Incorrectly Evaluated)
$\min(f(x)) = 0$ and occurs on the sub interval $[-\frac{1}{2}]$, this implies $m_i = 0$. But this has to be incorrect as it then implies $L(x^2, \{-1, -\frac{1}{2}, 1\}) = 0$. The correct answer is $\frac{1}{8}$
Upper Sum (Correctly Evaluated) (EDIT: As it turns out due to a special case of this question)
$\max(f(x)) = 1$ and occurs on the sub-intervals $[-1, -\frac{1}{2}]$ and $[-\frac{1}{2}]$ at $x=-1$ and $x=1$, thus $M_i=1$
$$\begin{align}U(x^2 \{-1, -\frac{1}{2}, 1\}) &= \sum_{i=1}^{n} 1 \cdot (t_{i} - t_{i-1})\\ &= (-\frac{1}{2}-(-1)) + (1-(-\frac{1}{2}))\\ &= 2 \end{align}$$
I seem to have some misunderstanding, with calculating $M_i$ and $m_i$, I'm not sure why.Perhaps it's because I've computed the Riemann Sums with $m_i$ and $M_i$ as constant throughout all sub-intervals?
How would you evaluate the upper and lower Riemann Sums, given this function over the specified interval? Any hints would be appreciated.
Full credit for arriving at this answer must go to @Balarka Sen, who picked up and corrected my misunderstanding over a chat.
The reason why my computation for the lower sum was incorrect and why the upper sum was correct:
I evaluated the minimum of $f$ on $[-1/2, 1]$. But I did not evaluate the minimum on $[-1, -1/2]$. My computation of the upper sum was correct, only because as it turns out the maximum values that $f(x) = x^2$ takes on over the intervals $[-1, -\frac{1}{2}]$ and $[-\frac{1}{2}, 1]$ are both equivalent and equal $1$.
My misunderstanding:
I wrongly believed $m_i$ and $M_i$ to be the minimum and maximum values that $f$ takes on over the whole interval $[a,b]$, and not each $i$-th interval $[t_{i-1}, t_{i}]$. As it turns out that would've been a very crude and meaningless approximation.
So these were my wrong interpretations of the upper and lower Riemann Sums (which I computed when I initially asked this question) as sum of terms of the form:
and
Correct Interpretations
The correct interpretations of the Riemann Sums are the sum of terms of the form: