Evaluate Integral $\int_{1}^{3}(3x + 2)dx$ as a Riemann Sum I am having difficulties working out this Riemann Sum. 
$$ \Delta x = \frac{2}{n},~~ x_i = 1 + \frac{2i}{n},~~ i = \frac{n(n+1)}{2}$$
where
$$\int_{1}^{3}(3x + 2)dx = \lim_{n\to\infty} \sum_{i=1}^{n} f(x_i) \Delta x $$
$~$
$~$
$$ = \lim_{n\to\infty} \sum_{i=1}^{n} \bigg( \frac{3+6i}{n} + 2 \bigg) \frac{2}{n} = \lim_{n\to\infty} \sum_{i=1}^{n}\bigg(3\big(1 + \frac{2i}{n}\big) + 2\bigg) \frac{2}{n}$$
This is how my teacher answered the problem.  
$$= \lim_{n\to\infty} \frac{2}{n}^{***} \sum_{i=1}^{n} 3 + \frac{6i}{n} + 2 = \lim_{n\to\infty} \frac{2}{n} \sum_{i=1}^{n} 5 + \frac{6i}{n}$$
$$= \lim_{n\to\infty} \frac{2}{n} 5n^{****} + \frac{2}{n} \sum_{i=1}^{n} \frac{6i}{n} = \lim_{n\to\infty} 10 + \frac{12}{n^2}^{*****} \sum_{i=1}^{n}i = 10 + \lim_{n\to\infty} \frac{12}{n^2} \frac{n(n+1)}{2} $$
$$ = 10 + \lim_{n\to\infty} 6(1+\frac{1}{n}) = 10 + 6 = 16$$
I think all of my questions stem from a lack of understanding from my first question:  
*** What property lets you move the $\frac{2}{n}$ before the sum? Is this just the associative property at work here?
**** This is where I get lost, I don't get what step is happening here and why.
***** why is $\frac{2}{n} and \frac{6i}{n}$ allowed to combine without distributing the $\frac{6i}{n}$ over to the 10 as well?
 A: You can pull $n$ in and out like that because for all intents and purposes it's a constant with respect to the summation symbol. $i$ is what's changing. You cannot, however, pull $n$ outside the limit symbol.
The way your teacher did this Riemann sum problem looks very confusing. He has certainly taken too many liberties with the parentheses. In fact, there are no parentheses to speak of at all in his solution. That's probably what has made it very hard to read. Here's a way that's much cleaner:
$$
\begin{align}
\lim_{n\to\infty} \sum_{i=1}^{n}\bigg[3\bigg(1 + \frac{2i}{n}\bigg) + 2\bigg] \frac{2}{n}
&=\lim_{n\to\infty} \sum_{i=1}^{n}\bigg(3 + \frac{6i}{n} + 2\bigg) \frac{2}{n}\\
&=2\lim_{n\to\infty} \sum_{i=1}^{n}\bigg(5 + \frac{6i}{n}\bigg) \frac{1}{n}\\
&=2\lim_{n\to\infty} \sum_{i=1}^{n}\bigg(\frac{5}{n} + \frac{6i}{n^2}\bigg)\\
&=2\lim_{n\to\infty}\bigg(\frac{5}{n}\sum_{i=1}^{n}1 + \frac{6}{n^2}\sum_{i=1}^{n}i\bigg)\\
&=2\lim_{n\to\infty}\bigg(\frac{5}{n}\cdot n + \frac{6}{n^2}\cdot\frac{n(n+1)}{2}\bigg)\\
&=2\lim_{n\to\infty}\bigg(5 + \frac{3+3n}{n}\bigg)\\
&=2\lim_{n\to\infty}\bigg(5 + \frac{3}{n}+3\bigg)\\
&=2\lim_{n\to\infty}\bigg(8 + \frac{3}{n}\bigg)\\
&=2\cdot(8+0)\\
&=2\cdot 8\\
&=16
\end{align}
$$
A: Perhaps this will help: think about a fixed value of $n$, and examine
$$\sum_{i=1}^{n}\bigg(3\big(1 + \frac{2i}{n}\big) + 2\bigg) \frac{2}{n}
= \sum_{i=1}^n \frac{2}{n}\cdot 5 + \sum_{i=1}^n \frac{2}{n}\cdot\frac{6i}{n}
= \sum_{i=1}^n \frac{10}{n} + \sum_{i=1}^n \frac{12}{n^2}\cdot i.$$
Since we are thinking about a fixed $n$, terms involving only $n$ are essentially constants and can be pulled out of the summation, just like a factor of $13$ (for example) could be. So we get
$$\frac{10}{n}\cdot\sum_{i=1}^n 1 + \frac{12}{n^2}\cdot\sum_{i=1}^n i.$$
