How to prove that $g(x)=x^2$ is integrable on $[2,5]$ using regular partitions? So I've been trying to prove that $g(x)=x^2$ is integrable on the interval $[2,5]$ using regular partitions and the theorem that a function is integrable if
$$\lim_{n\to\infty}(U(f,P_n)-L(f,P_n)) = 0.$$
This is what I have so far:
Let
$$g:[2,5]\to \mathbb{R},\quad g(x)=x^2,$$
let $P_n=\{x_0, x_1, x_2,...,x_n\}$ be defined by $\Delta x=\frac{b-a}{n}$, $x_k=x_0+k\Delta x$. Set
$$m_k=\inf\{g(x)\,|\,x\in [x_{k-1}, x_k]\}=x_{k-1}^2$$
and
$$M_k=\sup\{g(x)\,|\,x\in [x_{k-1}, x_k]\}=x_k^2.$$
Then
\begin{align*}
L(g, P_n)
&=\sum_{n=1}^{k} m_k(x_k-x_{k-1}) \\
&=\sum_{n=1}^{k} x_{k-1}^2 \Delta x \\
&= \Delta x \sum_{n=1}^{k} x_{k-1}^2 \\
&= \Delta x \sum_{n=1}^{k} (x_0+(k-1)\Delta x)^2 \\
&= \Delta x\sum_{n=1}^{k} (x_0^2+2x_0\Delta x (k-1) + ((k-1)\Delta x)^2) \\
&= \Delta x\left(nx_0^2+2nx_0\Delta x \sum_{n=1}^{k}(k-1) + \left(n\Delta x\sum_{n=1}^{k}(k-1)\right)^2\right) \\
&= nx_0^2 \frac{3}{n}+2nx_0\frac{9}{n^2}(0+1+2+...+(n-1)) + n\frac{27}{n^3}(0+1+2+...+(n-1))^2 \\
&=3x_0^2+2x_0\frac{9}{n}\frac{n(n-1)}{2} + \frac{27}{n^2}\frac{(n(n-1))^2}{4} \\
&=3x_0^2+x_0{9}(n-1) + \frac{27(n-1)^2}{4} \\
&= 12 + 18(n-1) + \frac{27(n-1)^2}{4}.
\end{align*}
Similarly
$$U(f,P_n)=\sum_{n=1}^{k} M_k(x_k-x_{k-1})=12+18(n+1)+\frac{27(n+1)^2}{4}.$$
Then
$$\lim_{n\to\infty}(U(f,P_n)-L(f,P_n)) = \lim_{n\to\infty}\left(12 + 18(n-1) + \frac{27(n-1)^2}{4}-\left(12+18(n+1)+\frac{27(n+1)^2}{4}\right)\right)$$
And this is where I run into issues because then $\lim_{n\to\infty}(U(f,P_n)-L(f,P_n))$ does not equal zero like it is supposed to. I believe I am running into a computational error somewhere, but I can't seem to find it.
Thanks in advance.
 A: The first error is that you have confused $n$ for $k$ at various points: when you say $\sum_{n=0}^k$, I think you mean $\sum_{k=0}^n$.
The second error, possibly related, is that you have introduced a factor of $n$ (the sum index) in places where the sum remains e.g. $\sum_{n=1}^k c(k-1)=^?nc\sum_{n=1}^k (k-1)$ for some constant $c$.
The third error is that you have confused $\sum_{i=1}^m i^2=\frac{m(m+1)(2m+1)}{6}$ for $\sum_{i=1}^m i^3=\frac{(m(m+1))^2}{4}$.
I believe it should read:
$$
\begin{align*}
L(g, P_n)
&=\cdots \\
&= \Delta x\sum_{k=1}^{n} (x_0^2+2x_0\Delta x (k-1) + ((k-1)\Delta x)^2) \\
&= \Delta x\left(nx_0^2+2x_0\Delta x \sum_{k=1}^{n}(k-1) + \left(\Delta x\sum_{k=1}^{n}(k-1)\right)^2\right) \\
&= nx_0^2 \frac{3}{n}+2x_0\frac{9}{n^2}(0+1+2+...+(n-1)) + \frac{27}{n^3}(0+1+2+...+(n-1))^2 \\
&=3x_0^2+2x_0\frac{9}{n^2}\frac{n(n-1)}{2} + \frac{27}{n^3}\frac{(n-1)\times n\times 2n}{6} \\
&=3x_0^2+x_0{9}\frac{n-1}{n} + 9\frac{n-1}{n} \\
&= 12 + 27\frac{n-1}{n}.
\end{align*}
$$
Indeed, as $n\to\infty$, $L(g,P_n)\to 39$ and $\int_2^5 x^2 dx=39$.
You will need to calculate $U(g,P_n)$ again with this in mind.
