# How to properly evaluate the Riemann sum for the integral of $x^2$ for $x$ from $0$ to $3$

In my homework we start out with $$\int_{x=0}^3 x^2 \, dx=\lim_{P: \Delta x \to 0} \sum_{i = 1}^n f(x_i) (\Delta x)_i$$ Where I take $$P_i=[\frac{i-1}{n},\frac{i}{n}], x_i=\frac{i}{n}, (\Delta x)_i=\frac{3}{n}$$ So then $$\int_{x=0}^3 x^2 \, dx=\lim_{n \to \infty} \sum_{i = 1}^n \frac{i^2}{n^2} \frac{3}{n}$$ With given in my homework $$\sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6}$$ Makes $$\int_{x=0}^3 x^2 \, dx=\lim_{n \to \infty} \frac{n(n+1)(2n+1)}{2n^3}=\lim_{n \to \infty} \frac{2n^3+3n^2+n}{2n^3}$$ Which leads me to $$\int_{x=0}^3 x^2 \, dx=\lim_{n \to \infty} 1+\frac{3}{2n}+\frac{1}{2n^2}$$

This is not the answer I should be getting... Should I choose $P_i, x_i, (\Delta x)_i$ differently? Am I going wrong somewhere else?

Yes, you have a mismatch in the $P_i, x_i, (\Delta x)_i$.

For, we always have that for $P_i = [r_1,r_2]$, $(\Delta x)_i = r_2 -r_1$. Another problem is that:

$$\bigcup_{i=1}^n P_i = [0,1] \ne [0,3]$$

Can you see how to adjust the $P_i$ and $x_i$ to solve both these issues in one go?

• Ah I see, my $P_i$`s do not add up to the width of the integral and that is because my $P_i$ are not adjusted the same way I adjusted my $(\Delta x)_i$. If I take $r_2-r_1=\frac{3}{n}$ I get $P_i=[\frac{i-3}{n},\frac{i}{n}]$. However, when evaluating the sum, the only factor in it is $(\Delta x)_i$ which stays the same. So Im not getting it completely yet.
– Leo
Jul 5, 2013 at 10:35
• @Leo Are the intervals you chose disjoint? (Note that your sum will change to reflect the adjustment you will make to the $P_i$ to correct that.) Jul 5, 2013 at 11:02
• Thanks, they are not disjoint and now that I check that I also see that the interval P still didnt start at 0. $$P_i=[\frac{3i-3}{n},\frac{3}{n}], (\Delta x)_i=\frac{3}{n}-\frac{3i-3}{n}=\frac{6}{n}-\frac{3i}{n}$$ $$\lim_{P: \Delta x \to 0} \sum_{i = 1}^n x_i^2 (\Delta x)_i=\lim_{n \to \infty} \sum_{i = 1}^n \frac{i^2}{n^2}3(\frac{2}{n}-\frac{i}{n})$$ $$\lim_{n \to \infty} \frac{3}{n}[\frac{2}{n}\sum_{i = 1}^n i^2-\frac{1}{n}\sum_{i = 1}^n i^3]$$ Yes this is it!
– Leo
Jul 5, 2013 at 11:21
• I think you made a typo there, $P_i = [\frac{3i-3}n,\frac{3i}n]$. Jul 5, 2013 at 11:22
• Oh, so that was not it :)
– Leo
Jul 5, 2013 at 11:27