# Finding an integral by evaluating a Riemann Sum

Below is a problem I did. I believe I got the right answer. However, I am not convinced my method is correct. I am hoping somebody here can verify that my solution is correct or tell me where I am wrong.

Problem:

Evaluate the following integral by evaluating its limit as a Riemann sum. $$\int_0^1 3x^2 \mathrm{d}x$$

Here is the definition of a Riemann sum, $$R$$. $$R = \sum_{i = 1}^{n} f( x_i ) \Delta x$$ where $$x_i = a + i \Delta x$$ and $$\Delta x = \frac{b-a}{n}$$ Now we have: \begin{align*} a &= 0 \\ b &= 1 \\ \Delta x &= \frac{1 - 0}{n} = \frac{1}{n} \\ \int_0^1 3x^2 \mathrm{d}x &= \lim_{n \rightarrow \infty } \sum_{i = 1}^{n} f( x_i ) \Delta x \\ &= \lim_{n \rightarrow \infty } \sum_{i = 1}^{n} \frac{ f( x_i ) }{ n } \\ &= \lim_{n \rightarrow \infty } \sum_{i = 1}^{n} \frac{ 3 x_i^2 }{ n } \\ &= \lim_{n \rightarrow \infty } \sum_{i = 1}^{n} \frac{ 3(a + i \Delta x)^2 }{ n }\\ &= \lim_{n \rightarrow \infty } \sum_{i = 1}^{n} \frac{ 3(0 + i \Delta x)^2 }{ n } \\ &= \lim_{n \rightarrow \infty } \sum_{i = 1}^{n} \frac{ 3( i^2 \left( \Delta x\right) ^2 ) }{ n } \\ &= \lim_{n \rightarrow \infty } \sum_{i = 1}^{n} \frac{ 3 i^2 }{ n^3 } \\ &= 3 \lim_{n \rightarrow \infty } \sum_{i = 1}^{n} \frac{ i^2 }{ n^3 } \\ \end{align*} Recall that: $$\sum_{i = 1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}$$ $$\lim_{n \rightarrow \infty } \sum_{i = 1}^{n} f( x_i ) \Delta x = 3 \lim_{n \rightarrow \infty } \frac{ n(n+1)(2n+1) }{ 6n^3 } = \frac{3(2)}{6} = 1.$$
To check my answer, I integrate the function. $$\left. \int_0^1 3x^2 \mathrm{d}x = x^3 \right|_0^1 = 1 - 0 = 1.$$ Therefore, my answer checks.