I have to find the area under the curve $f(x) = x^2$ in the segment $[-2, 1]$ using Riemann Sum. So here is what I did, but it's wrong and I need some clarification about (see the questions in the end).
So I chose $\Delta x_k = \frac{3}{n}$ and $\xi_k = x_k = k \Delta x_k = \frac{3k}{n}$
So
$$S_n = \sum_{k = 0}^{n-1} f(\xi_k)\Delta x_k = \sum_{k = 0}^{n-1} \left(\frac{3k}{n}\right)^2 \frac{3}{n} = \sum_{k = 0}^{n-1} \frac{27k^2}{n^3} = \frac{27}{n^3} \sum_{k = 0}^{n-1} k^2 = \frac{27}{n^3}\frac{1}{6}(2n^3-3n^2+n)$$
Now $$\lim_{n\to +\infty} S_n = \frac{27}{3}$$
Whereas $$\int_{-2}^1 x^2\text{d}x = \frac{7}{3}$$
Where am I wrong?
Also: here I chose $\xi_k = x_k = k\Delta x_k$ but what would it be if I chose $\xi_k = x_{k+1}$. How would I use this? What would $\xi_k$ be?
I have some confusions about