In the Warm-up we saw that \(n^2\) and \(n^3\) can be used as lower and upper bounds for the value of \(\displaystyle\sum_{r=1}^{n} r^2\): \[n^2 ≤ \displaystyle\sum_{r=1}^{n} r^2 ≤ n^3\]

We can use the diagrams below to find a different way to bound \(\displaystyle\sum_{r=1}^{n} r^2\).

  • Which of the areas represented in the two diagrams is bigger?
  • Does this result generalise?

The first diagram is a representation of the sum of the first \(8\) square numbers, where each bar has width \(1\) and height \(r^2\). The second diagram has a shaded area which can represented by the integral \(\int_0^8 x^2 \, dx\).

Which of these areas is bigger? We could numerically compute the areas but a simple way to compare them is to draw the two images on the same axes.

y = x squared drawn on top of the bars representing the square numbers. The curve goes through the top right corners of the bars

We can see that \(\int_0^8 x^2 \, dx < \sum_{r=1}^{8} r^2\), but we can also generalise this result from the diagram and say that

\[\int_0^n x^2 \, dx < \sum_{r=1}^{n} r^2.\]

Use this information to provide either an upper or lower bound for the value of \(\displaystyle\sum_{r=1}^{n} r^2\).

Calculating the value of the integral, we have \(\int_0^n x^2 \, dx = \frac{1}{3}n^3\), so we can provide a lower bound for \(\sum_{r=1}^{n} r^2\),

\[\dfrac{1}{3}n^3 < \sum_{r=1}^n r^2.\]

How does what we’ve done here, using an integral to estimate a summation, compare to what you’ve done before using integrals and sums?

Can you find a function that bounds the graphical representation of \(\displaystyle\sum_{r=1}^{n} r^2\) on the other side?

Use this function to provide a second bound for \(\displaystyle\sum_{r=1}^{n} r^2\).

Now we know that we are looking to find an upper bound. We can find a function that gives an overestimate of the area by using a transformation of \(y = x^2\).

Bars representing the sum of squares drawn with the curve y = x plus 1 all squared

Therefore the integral \(\int_0^n (x+1)^2 \, dx\) provides an upper bound to \(\sum_{r=1}^{n} r^2\). It evaluates to \(\int_0^n (x+1)^2 \, dx = \frac{1}{3}n^3 + n^2 + n\), so we have the following bounds for \(\sum_1^n r^2\):

\[\dfrac{1}{3}n^3 < \sum_1^n r^2 < \dfrac{1}{3}n^3 + n^2 + n.\]

Our result shows that \(\sum_1^n r^2 \approx \frac{1}{3}n^3\). Does this seem reasonable? Why might we have expected this result?

There is more than one way we can approximate an upper bound for \(\sum_1^n r^2\). A different approach involves the following diagram.

bars that represent the square numbers from 0 to n minus 1 drawn with the curve y = x squared

We can use this to write the inequality \[\displaystyle\sum_0^{n-1} r^2 < \dfrac{1}{3}n^3.\]

If we add \(n^2\) to both sides of the inequality we get \[\displaystyle\sum_0^{n-1} r^2 + n^2 < \dfrac{1}{3}n^3 + n^2,\]

which can be simplified to

\[\displaystyle\sum_0^{n} r^2 < \dfrac{1}{3}n^3 + n^2.\]

How does this compare to the upper bound found above? Does it matter that the limits are slightly different?

To find the exact value of \(\sum_1^n r^2\) you might like to try the review question R6143.