Darboux sum $\int_{2}^{5}1-x+3x^2dx$ calculate the Darboux sum of
$$\int_{2}^{5}1-x+3x^2dx$$
I think i did the calculation good but I need help in getting my partition more formal please tell me if you see any errors and mis
$P=\{2,2+\frac{1}{n}....5\}$,
$\Delta x_i =\frac{1}{n} $
\begin{align}
&=\int_{2}^{5}1dx-\int_{2}^{5}xdx+\int_{2}^{5}3x^2dx\\
&=\sum_{0}^{n-1}\left(2+\frac{i}{n}\right)\cdot \Delta x_i-\sum_{0}^{n-1}\left(2+\frac{i}{n}\right)\cdot \Delta x_i+\sum_{0}^{n-1}3\left(2+\frac{i}{n}\right)^2\cdot \Delta x_i\\
&=5-2 -\frac{1}{n^2}\sum_{0}^{n-1}\lim_{n\rightarrow\infty}\left(\frac{2}{n}+i\right)+3\cdot\frac{1}{n^3}\cdot\sum_{0}^{n-1} \lim_{n\rightarrow\infty}\left( \frac{2}{n}  + i^2\right)\\
&=3 -\frac{1}{n^2}\sum_{0}^{n-1}i+3\cdot\frac{1}{n^3}\cdot\sum_{0}^{n-1}i^2\\
&=\lim_{n\rightarrow\infty} \left[ \ \ \ \ 3 -\frac{1}{n^2}\cdot\frac{n(n-1)}{2}+3\cdot\frac{1}{n^3}\cdot\frac{n(n-1)(2n-3)}{6}   \ \ \ \ \right]\\
&=3 -\frac{1}{2}+1\\
&=3.5 
\end{align}
what do you think? about my solution?
 A: There are plenty of errors.

*

*Take $x_i=2+\frac3n$, not $x_i=2+\frac1n$. Hence $\Delta x_i=\frac3n$, not $\frac1n$.

*Always keep "lim" in front of your "Darboux" (Riemann) sums because as such, they are not "equal" to your integrals.

*Don't put anything before $\Delta x_i$ inside your first sum (the one which corresponds to $\int_2^51dx$).

*The square inside your third sum (the one which corresponds to $\int_2^53x^2dx$) does not give what you write in the following line.

*Etc.

Here is a correct (and more compact) version:
$$\begin{align}\int_2^5(1-x+3x^2)dx&=\lim_{n\to\infty}\frac3n\sum_0^{n-1}\left(1-(2+3i/n)+3(2+3i/n)^2\right)\\
&=\lim_{n\to\infty}\frac3n\sum_0^{n-1}\left(11+\frac{33}ni+\frac{27}{n^2}i^2\right)\\
&=\lim_{n\to\infty}\frac3n\left(11n+\frac{33(n-1)}2+\frac{9(n-1)(2n-1)}{2n}\right)\\
&=3\left(11+\frac{33}2+9\right)\\
&=\frac{219}2,
\end{align}$$
as you can check by direct integration:
$$\int_2^5(1-x+3x^2)dx=\left[x-\frac{x^2}2+x^3\right]_2^5=3-\frac{21}2+117=\frac{219}2.$$
