Convert Riemann sum to definite integral $ \lim_{n\to\infty}\sum_{i=1}^{n} \frac{21 \cdot \frac{3 i}{n} + 18}{n} $ The limit 
$\quad\quad \displaystyle \lim_{n\to\infty}\sum_{i=1}^{n} \frac{21 \cdot \frac{3 i}{n} + 18}{n} $
is the limit of a Riemann sum for a certain definite integral 
$\quad\quad \displaystyle \int_a^b f(x)\, dx $
a = ?
b = ?
f(x) = ?
Attempt at solution:
So I know:
$ \displaystyle \sum_{i=1}^{n} f(a + i dx) dx $ = $ \int_a^b f(x)\, dx $
and that $x_i = a + i \cdot \frac {b-a}{n}$
So I will try to rewrite my riemann sum as convenient:
$\frac {3}{n} (7 \cdot \frac {3i}{n} + 6) $
so my $dx$ is $\frac {3}{n}$
since +6 is supposed to be my a, b is therefore 9 because $dx = \frac {b-a}{n}$
but that 7 inside the parenthesis spoils everything... so I can't say what's inside the parenthesis is equal to $x_i$
So what's next?
 A: Divide through by 63. We then find that $f(a)=\frac{18}{63}$ by plugging in $i=0$. But then $f(x)=\frac{18}{63}+x$ because $f(a+idx)=f(a)+idx$. Hence $a=0$ and $b=1$. Therefore our integral is $63\int_{0}^{1} x+\frac{18}{63}dx$
A: You were so close with $\frac {3}{n} (7 \cdot \frac {3i}{n} + 6)$. You can simply factor the $7$ outside the sum as follows:
Given the Riemann sum definition of the definite integral,
$$\lim_{n \rightarrow \infty} \sum_{i=1}^{n} f(a + i \, \mathrm{d}x) \, \mathrm{d}x = \int_a^b f(x)\, \mathrm{d}x$$
we manipulate to find $f(x)$: 
\begin{align}
    \lim_{n\to\infty}\sum_{i=1}^{n} \frac{21 \cdot \frac{3 i}{n} + 18}{n} &= \lim_{n\to\infty}\sum_{i=1}^{n} \left(6 + 7 i \cdot\frac{3}{n} \right)\frac{3}{n} \\
&= \lim_{n \rightarrow \infty} \sum_{i=1}^{n} 7\left(\frac{6}{7} + i \cdot\frac{3}{n} \right)\frac{3}{n} \\
&= 7\lim_{n \rightarrow \infty} \sum_{i=1}^{n} \left(\frac{6}{7} + i \cdot\frac{3}{n} \right)\frac{3}{n}.
\end{align}
So, we have $\mathrm{d}x=\frac{3}{n}$, $a=\frac{6}{7}$, $b=3+a=\frac{27}{7}$ and $f(x)=x$.
Hence,
\begin{align}
    \lim_{n\to\infty}\sum_{i=1}^{n} \frac{21 \cdot \frac{3 i}{n} + 18}{n} &=7\lim_{n \rightarrow \infty} \sum_{i=1}^{n} \left(\frac{6}{7} + i \cdot\frac{3}{n} \right)\frac{3}{n} \\
&= 7 \int_{\frac{6}{7}}^{\frac{27}{7}} x \,\mathrm{d}x \\
&= 7 \left[\frac{1}{2} x^2 \right]_{\frac{6}{7}}^{\frac{27}{7}} \\
&= 7 \left[\frac{729}{98} - \frac{36}{98} \right] \\
&= 49.5
\end{align}
A: You don't need to adjust your boundaries for the integral. The easiest way is to choose arbitrarily $a=0$  and $b=1$  so that $\Delta x = 1/n$ and $x^{\ast}$ is $i/n$. See the picture:

