<s>[INST] $f(x) = x^2$. For each positive integer $n$, let $P_n$ be the partition $P_n = \{0, \frac{1}{n}, \frac{2}{n},..., \frac{n-1}{n},1 \}$ of $[0,1]$. Let $f(x) = x^2$. For each positive integer $n$, let $P_n$ be the partition $P_n = \{0, \frac{1}{n}, \frac{2}{n},..., \frac{n-1}{n},1 \}$  of $[0,1]$.
Show that $S(P)=\frac{1}{3}+\frac{1}{2n}+\frac{1}{6n^2}$ .Find a similar expression for $s(P)$.
I know that $S(P)=\sum_{i=1}^{n}M_j(x_j-x_{j-1})$ where $M_j=\sup_{[x_{j-1},x_j]}f(x)$. I'm not sure how to go from there.
 [/INST] For $j=1,2...n\;$, we have
$$x_j=j\frac{1}{n},$$
$$x_{j}-x_{j-1}=\frac{1}{n},$$
$$\displaystyle{M_j=sup_{x\in[x_{j-1},x_j]}f(x)=f(x_j)=x_j^2=\frac{j^2}{n^2}},$$
since $f$ is increasing.
and
$$S(P)=\sum_{j=1}^n(x_j-x_{j-1})M_j=\frac{1}{n^3}\sum_{j=1}^n j^2$$
$$=\frac{1}{n^3}\frac{n(n+1)(2n+1)}{6}$$
$$=\frac{1}{6n^2}(2n^2+3n+1)$$
$$=\frac{1}{3}+\frac{1}{2n}+\frac{1}{6n^2}.$$
if $n\to+\infty$, $\; S(P)$ goes to
$$\int_0^1 x^2dx=\frac{1}{3}.$$
</s>