We split [2, 4] into [tex]n[/tex] subintervals of length [tex]\dfrac{4-2}n=\dfrac2n[/tex],
[tex][2,4]=\left[2,2+\dfrac2n\right]\cup\left[2+\dfrac2n,2+\dfrac4n\right]\cup\left[2+\dfrac4n,2+\dfrac6n\right]\cup\cdots\cup\left[2+\dfrac{2(n-1)}n,4\right][/tex]
so that the right endpoints are given by the sequence
[tex]x_i=2+\dfrac{2i}n=\dfrac{2(n+i)}n[/tex]
for [tex]1\le i\le n[/tex]. Then the Riemann sum approximating
[tex]\displaystyle\int_2^42x\,\mathrm dx[/tex]
is
[tex]\displaystyle\sum_{i=1}^nf(x_i)\dfrac{4-2}n=\frac8{n^2}\sum_{i=1}^n(n+i)=\frac8{n^2}\left(n^2+\frac{n(n+1)}2\right)=\frac{12n+4}n[/tex]
The integral is given exactly as [tex]n\to\infty[/tex], for which we get
[tex]\displaystyle\int_2^42x\,\mathrm dx=\lim_{n\to\infty}\frac{12n+4}n=12[/tex]
To check: we have
[tex]\displaystyle\int_2^42x\,\mathrm dx=x^2\bigg|_2^4=4^2-2^2=16-4=12[/tex]