Doubt in finding the integral of $f(x)=x$ using the upper and lower sum definition of the integrals.

If I understand what you are given, you have $$ L(f,P_n)\le\frac{b^2}2\le U(f,P_n) $$ and $$ U(f,P_n)-L(f,P_n)\le\frac{b^2}n $$ That means that $$ \begin{align} L(f,P_n) &\ge U(f,P_n)-\frac{b^2}n\\ &\ge\frac{b^2}2-\frac{b^2}n \end{align} $$ and that $$ \begin{align} U(f,P_n) &\le L(f,P_n)+\frac{b^2}n\\ &\le\frac{b^2}2+\frac{b^2}n \end{align} $$ Therefore, $$ \frac{b^2}2-\frac{b^2}n\le L(f,P_n)\le U(f,P_n)\le\frac{b^2}2+\frac{b^2}n $$ and we can apply the Squeeze Theorem.


Here is the important theorem which may seem obvious but is difficult to prove:

Theorem: If a function $f:[a, b] \to\mathbb{R} $ is bounded on $[a, b] $ then $$\lim_{|P|\to 0}U(f,P)=\inf\,\{U(f,P)\mid P\text{ is a partition of }[a, b] \} $$ and $$\lim_{|P|\to 0}L(f,P)=\sup\,\{L(f,P)\mid P\text{ is a partition of }[a, b] \} $$

Using this theorem the job of finding the supremum of lower sums (or infimum of upper sums) is reduced to finding the limit of corresponding sums as norm of partition tends to $0$. In particular we can take a sequence of partitions which are uniform (all subintervals of equal length) such that number of subintervals tends to $\infty $.

Thus for your example it is sufficient to take the limit of $U(f, P_n) $ and $L(f, P_n) $ as $n\to\infty $. If these limits are equal (as is the case here) the function is Riemann integrable with the common limit ($b^2/2$) as its integral.


However the argument given in your question is almost correct (may be it needs a little more effort) and you shouldn't doubt yourself (not everything in analysis is difficult and even if they are you can't be wrong every time).

Here is a way to add some detail to make it perfect (from almost correct). Start with the observation that every lower sum is less than or equal to any specific upper sum. Thus for any partition $P $ we must have $$L(f, P) \leq U(f, P_n) \tag{1}$$ for all $n$ and letting $n\to\infty $ we have $$L(f, P) \leq \frac{b^2}{2}\tag{2}$$ Why does taking limit as $n\to\infty $ work for us?? Well you should further notice that as $n$ increases $U(f, P_n) $ decreases strictly and thus infimum of all $U(f, P_n) $ equals its limit $b^2/2$. And if it were possible that $L(f, P) > b^2/2$ then by definition of infimum we would have some value of $n$ such that $$b^2/2\leq U(f, P_n) < L(f, P) $$ contradicting that any lower sum can't exceed any upper sum. And thus we must have $L(f, P) \leq b^2/2$ and this justifies the process of taking limits as $n\to\infty $ and deduce equation $(2)$ from $(1)$.

In a similar manner $$U(f, P) \geq L(f, P_n) $$ gives us $$U(f, P) \geq\frac{b^2}{2}$$ Combining all the above this proves that $$L(f, P) \leq \frac{b^2}{2}\leq U(f, P') \tag{3}$$ for any partitions $P, P'$. Notice that from the result $$L(f, P_n) \leq \frac{b^2}{2}\leq U(f, P_n)$$ established in your question we can infer the stronger result $(3)$ above.

Since you have proved that the function is Riemann integrable not more than a single number can lie between all lower and all upper sums (this is also mentioned in your question which means you understand this part). What have we got now on our hands? Well, just that the integral value is $b^2/2$. Done!!


The argument presented above (in second part) can be abstracted out by stripping all details of Riemann integral and partitions to lead to a simple

Lemma: Let $A, B$ be non-empty subsets of $\mathbb{R} $ such that no member of $A$ exceeds any member of $B$. If there exist sets $C, D$ such that $$C\subseteq A, D\subseteq B, \sup C=\inf D$$ then $\sup A=\inf B$.

The sets $C, D$ can also be replaced by some sequences $x_n\in A, y_n\in B$ with $\lim x_n=\lim y_n$.

And now this looks so simple/trivial/obvious and you may easily prove it.