Using the definition of a definite integral find $ \int_2^4 (3x^2-2)dx $ Find, with the definition of a definite integral, where $\bar{x}i$ is the right sum of each subinterval.
$$
\int_2^4 (3x^2-2)dx
$$
So I start here...
$$
\Delta xi = 4-2/n = \frac{2}{n}
$$
For the right sum:
$$
\bar{x}i= 1 +i\Delta xi = 1+\frac{2i}{n}
$$
We have:
$$
f(\bar{x}i) = (3x^2-2) = f(\bar{x}i) = (3(1+\frac{2i}{n})^2-2)
$$
$$
f(\bar{x}i) = (\frac{12i^2}{n^2}+\frac{12i}{n}+1)
$$
With the sum of Riemann:
$$
SR= \sum f(\bar{x}i)\Delta xi = \sum (\frac{12i^2}{n^2}+\frac{12i}{n}+1)* \frac{2}{n}
$$
$$
SR = \sum (\frac{24i^2}{n^3}+\frac{24i}{n^2}+\frac{2}{n})
$$
$$
SR= \frac{12}{n^2}\sum i^2 + \frac{12}{n}\sum i + \frac{2}{n}\sum 1
$$
$$
SR= \frac{12}{n^2}(\frac{n(n+1)(2n+1)}{6}) + \frac{12}{n}(\frac{(n(n+1))}{2}) + \frac{2}{n} (n)
$$
$$
SR= \frac{8n^2+8n+4}{n^2} + \frac{12n+12}{n} + 2
$$
$$
SR= \frac{4}{n^2} + \frac{20}{n} + 22
$$
And finally:
$$\lim_{n\rightarrow \infty}\sum f(\bar{x})\Delta xi=\frac{4}{n^2} + \frac{20}{n} + 22 = 22$$ 
This is my answer. But the answer from online calculators are different (52).. Can anyone spot my mistakes? Thank you.
$$$$
Edit: Okay thank you guys! My mistake right at the beginning... where it should have started at 2 and not 1. Thanks again.

\begin{align}
  & f({{x}_{i}})=3{{\left( 2+\frac{2i}{n} \right)}^{2}}-2=12\left( 1+\frac{2i}{n}+\frac{{{i}^{2}}}{{{n}^{2}}} \right)-2=10+\frac{24i}{n}+\frac{12{{i}^{2}}}{{{n}^{2}}} \\ 
 & \Delta x\sum\limits_{i=1}^{n}{f({{x}_{i}})=\frac{2}{n}}\left( 10n+12(n+1)+\frac{2(n+1)(2n+1)}{n} \right) \\ 
 & \underset{n\to \infty }{\mathop{\lim }}\,\Delta x\sum\limits_{i=1}^{n}{f({{x}_{i}})=20+24+}8=52 \\ 
\end{align}
