How to calculate Upper/Low sums of an arbitrary partition?

541 Views Asked by At

If I'm given a function $f$ that is continuous on $[a,b]$ and asked to find the Upper sum $U(f,P)$ and Lower sum $L(f,P)$ where $P$ is an arbitrary partition of of a given interval $I$; $P$ = $\{x_i\}_{i=0}^n$.

$$U(f,P) = \sum_{i=1}^n M_i (x_i - x_{i-1}) \; \text{where} \; M_i = \sup\{f(x):p_0 ,..., p_{i-1}\}$$ $$L(f,P) = \sum_{i=1}^n m_i (x_i - x_{i-1}) \; \text{where} \; m_i = \inf\{f(x):p_0 ,..., p_{i-1}\}$$

How would I calculate the upper/lower sums of arbitrary partition $P$ = $\{x_i\}_{i=0}^n$ since I do not know my $n$ value?

If the function is is either increasing or decreasing over $I$, would I just choose the right or left endpoint of $I$ as my $M_i$ or $m_i$ value and simplify $(x_i - x_{i-1})$ to $(b-a)$?

If my function isn't either increasing or decreasing over $I$, how would I calculate my sums with no given partition?