How to calculate $\int_a^bx^2 dx$ using summation? So for this case, we divide it to $n$ partitions and so the width of each partition is $\frac{b-a}{n}$ and the height is $f(x)$.  
\begin{align}
x_0&=a\\
x_1&=a+\frac{b-a}{n}\\
&\ldots\\
x_{i-1}&=a+(i-1)\frac{b-a}{n}\\
x_i&=a+i\frac{b-a}{n}
\end{align} 
So I pick left point, which is $x_{i-1}$
I start with 
\begin{align}
\sum\limits_{i=1}^{n} \frac{b-a}{n}f\left(a+\frac{(i-1)(b-a)}{n}\right)
&=\frac{b-a}{n}\sum\limits_{i=1}^{n} \left(a+\frac{(i-1)(b-a)}{n}\right)^2\\ 
&=\frac{b-a}{n}\left(na^2+ \frac{2a(b-a)}{n}\sum\limits_{i=1}^{n}(i-1)+\frac{(b-a)^2}{n^2} \sum\limits_{i=1}^{n}(i-1)^2\right)
\end{align}
Here I am stuck because I don't know what$ \sum\limits_{i=1}^{n}(i-1)^2$is (feel like it diverges). Could someone help?

Hint: $$\sum_{i=1}^{n}(i-1)^2 = \sum_{i=1}^{n}(i^2-2i+1) = \sum_{i=1}^{n}i^2 - 2\sum_{i=1}^{n}i + \sum_{i=1}^{n}1$$
You should be able to take it from here.
