I'm asked to find $ \lim_{n\to\infty}a_n = \frac{1}{n^2} \sum_{k=1}^{n} k \cdot e^\frac{k^2}{n^2} $.
We can arrange the sum and we receive that our original limit is $ \frac{1}{n} \sum_{k=1}^{n} \frac{k}{n} \cdot e^\frac{k^2}{n^2} $.
Taking $ x_k = \frac{k}{n} $, that is the Riemann sum of the function $ xe^{x^2} $ on the interval $ [0,1] $. Since that function is continuous and Riemann integrable on $ [0,1] $, the original limit is equal to $ \int_{0}^{1} xe^{x^2} $. By that, the answer to this should be $ 0.5(e-1 )$. However, when looking up larger and larger values of $ n$, the limit tends to $ \frac{1}{2} $.
What is incorrect with my train of thought?