# Expressing Riemann sum as an integral

I apologize if this is too trivial, but I have a problem with converting a Riemann sum into an integral when the power of $n$ is different than $1$ or powers of $i$ and $n$ don't match, as in the examples:

1. $$\sum_{i=1}^{n}{\frac{4}{n^2}i\sqrt{1+\frac{4i^2}{n^2}}}$$ Here I can see that ${\Delta x_i=\frac{b-a}{n}}$ is 4 so a=1 and b=5. That would give me ${\Delta x=\frac{4}{n}}$ and the $${x_i=\sqrt{1+x^2}}$$ Does that give me ${f(x)=\sqrt{x^2}}$ ? What about the $\frac{4}{n^2}i$ before the square root? What should I do with the additional $n$ in denominator? $${\int\limits_1^5{\sqrt{x^2}}dx}$$

2.$$\sum\limits_{i=1}^{n}{\frac{i^4}{n^5}}$$ In this example, I suspect that $a=0$ and $b=1$, giving ${\Delta x_i=\frac{1}{n}}$?

So if I change it to: $$\sum\limits_{i=1}^{n}{\frac{i^4}{n^4}\frac{1}{n}}$$ would it simply be $x^4$?

First question: Factoring $\frac{1}{n}$ in front of the summation symbol, when $n \to \infty$:
$$\frac{1}{n}\sum_{i=1}^{n}{4\frac{i}{n}\sqrt{1+4\left(\frac{i}{n}\right)^2}} \ \to \ \int_0^1 4x\sqrt{1+4x^2}dx$$
$$\dfrac{5 \sqrt{5}-1}{3}$$
(hint : 2 changes of variables : $2x = u$, then $u=\tan \alpha$.)
2nd question: the limit, indeed, is $\int_0^1 x^4 dx=\dfrac{1}{5}.$