Can I approximate a series as an integral to find its limit and determine convergence? Find $\lim \limits_{n \to \infty} (a_n)$, where $a_n=\frac{1}{n^2}+\frac{2}{n^2}+\frac{3}{n^2}+...+\frac{n}{n^2}$.
So I can solve it like that $a_n=\frac{1+2+3+...n}{n^2}=\frac{\frac{1}{2}n(n+1)}{n^2}=\frac{1}{2}(1+\frac{1}{n})$. Clearly $\lim \limits_{n \to \infty} (a_n)=\frac{1}{2}$ so the sequence converges to $\frac{1}{2}$.
But can I approximate the series as an integral? 
$$a_n=\sum_{i=1}^n \frac{i}{n^2} \approx\int_{1}^n \frac{x}{n^2}dx=\frac{1}{n^2}\int_{1}^n x \,dx=\frac{1}{2}-\frac{1}{2n^2}$$
Now, when $n$ tends to infinity, $a_n$ tends to $\frac{1}{2}$ so the sequence converges to $\frac{1}{2}$. This produced the same result as using the first method. The only thing I am unsure of is that the final sums are different despite the fact that they both converge to the same number. This is because in the first method we sum only integers but in the second we sum all real $x$'s in the given interval, right?
Is this approach also valid? 

This can be written as 
$$\lim_{n \to \infty}\frac{1}{n} \sum_{r=1}^n {r\over n}$$
This is of the form 
$$\lim_{n \to \infty}\frac{1}{n} \sum_{r=1}^n f\left ({r\over n} \right) $$
So it can be written as
$$\int_0^1 f(x)dx$$ 
$$=\int_0^1x dx$$
$$=\frac{1}{2}$$
