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? 

The integral approach is valid because
(1) The function $\;f(x)=x\;$ is integrable in any finite interval (for example, because it is everywhere continuous), and 
(2) The sum is a very specific Riemann sum of the above function in the interval $\;[0,1]\;$ with respect to a very specific partition of this interval and choosing very specific points within each subinterval in that partition..
By (1), any Riemann sum with respect to any partition will converge to the integral $\;\int_0^1 x\,dx\;$ .
This is just like choosing a very specific subsequence of a sequence that we know beforehand that it is convergent: the subsequence is going to converge and to the same limit that the whole function.
