<s>[INST] Limit of $\frac{3}{n} \sum_{k=1}^n \left[\left(\frac{3k}{n}\right)^2 - \left(\frac{3k}{n}\right)\right]$ using Riemann sums I am asked to find the following limit:
$$\lim_{n \rightarrow \infty} \frac{3}{n} \sum_{k=1}^n \left[\left(\frac{3k}{n}\right)^2 - \left(\frac{3k}{n}\right)\right].$$
I am trying to invoke the following rule
$$\int_a^b f(x) dx = \lim_{n \rightarrow \infty } \sum_{k=1}^n f(x+k \Delta x) \Delta x$$
Where $\Delta x = \frac{b-a}{n}$.
So far what I have is that my function $f$ is $f(x)=x^2$ and that $a=1,b=4$. Then I get $$\int_1^4 x^2 dx$$ which is not the correct answer. Can someone help me with where I went wrong? Thanks in advance. Don't necessarily need answer just a hint or someone point out what obvious mistake I am making. Sorry. Also if this is a repeat question I apologize I will take it down, couldn't find one.
 [/INST] Alternative approach:
Hello from the rectangle-happy Anti-Calculus League.

$$\lim_{n \rightarrow \infty} \frac{3}{n} \sum_{k=1}^n \left[\left(\frac{3k}{n}\right)^2 - \left(\frac{3k}{n}\right)\right].$$

$\sum_{r=1}^n r^2 = \frac{1}{3}n^3 + \frac{1}{2}n^2 + \frac{1}{6}n.$
$\sum_{r=1}^n r^1 = \frac{1}{2}n^2 + \frac{1}{2}n.$

$\displaystyle \sum_{k=1}^n (3k)^2 = 9\sum_{k=1}^n k^2 = 
\frac{9}{3}n^3 + \frac{9}{2}n^2 + \frac{9}{6}n.$
Therefore, 
$\displaystyle \sum_{k=1}^{n} \left(\frac{3k}{n}\right)^2 = \frac{1}{n^2} \times \left[\frac{9}{3}n^3 + \frac{9}{2}n^2 + \frac{9}{6}n\right].$
This equals 
$\displaystyle \frac{9n}{3} + \frac{9}{2} + \frac{9}{6n}.$

$\displaystyle \sum_{k=1}^n (3k) = 3\sum_{k=1}^n k = 
\frac{3}{2}n^2 + \frac{3}{2}n.$
Therefore, 
$\displaystyle \sum_{k=1}^{n} \left(\frac{3k}{n}\right) = \frac{1}{n} \times \left[\frac{3}{2}n^2 + \frac{3}{2}n\right].$
This equals 
$\displaystyle \frac{3n}{2} + \frac{3}{2}.$

Therefore, ignoring the leading factor of $\displaystyle \frac{3}{n}$ and ignoring that you are taking a limit, you have the intermediate computation of
$\displaystyle \frac{3n}{2} + 3 + \frac{3}{2n}.$
Applying the leading factor $\displaystyle \frac{3}{n}$ gives
$$\frac{9}{2} + \frac{9}{n} + \frac{9}{2n^2}.\tag1$$
Clearly, when applying the limit, as $n \to \infty$, all but the leftmost term in (1) above go to $0$.
Therefore, the limit is $\displaystyle \left(\frac{9}{2}\right)$.
</s>