1

I know that the closed-form of $\sum_{i=1}^n i^2$ is $n(n+1)(2n+1)/6$.

But how to derive the formula through integration? My attempt is

$$ \sum_{i=1}^n i = \frac{n^2+n}{2}\\ \frac{1}{2}\sum_{i=1}^n i^2 = \frac{n^3}{6}+\frac{n^2}{4}\\ \sum_{i=1}^n i^2 = \frac{n^3}{3}+\frac{n^2}{2}\\ $$ My result is obviously not true, but why? Is there a way to derive the formula through integration?

Thank you for your effort!

  • https://math.stackexchange.com/a/2370394/1242 – Hans Lundmark May 15 '21 at 09:37
  • The problem is that the left-hand side is discrete but the right-hand side is continuous. The correct approach would be to use forward differences as mentioned in the link of the comment above. – Toby Mak May 15 '21 at 11:10
  • But isn't it allowed to integrate every single term on the left according to the sum rule of integrals? – ntasosof May 15 '21 at 11:17
  • No. This only applies when the rectangles have an infinitesimal width, or otherwise you would have a Riemann sum which is only an approximation of the integral. The width of the rectangles on the left-hand side is $1$. – Toby Mak May 15 '21 at 11:20

2 Answers2

0

The follwing method involves integrals. It may not be the answer you're looking for though.

Let $ n\in\mathbb{N} $.

Notice that, forall $ k\in\mathbb{N}^{*} $, we have $ \int_{k-1}^{k}{x^{2}\,\mathrm{d}x}=k^{2}-k+\frac{1}{3} $, thus : \begin{aligned}k^{2}&=k-\frac{1}{3}+\int_{k-1}^{k}{x^{2}\,\mathrm{d}x}\\ \Longrightarrow\sum_{k=1}^{n}{k^{2}}&=\sum_{k=1}^{n}{k}-\frac{n}{3}+\int_{0}^{n}{x^{2}\,\mathrm{d}x}\\ &=\frac{n\left(n+1\right)}{2}-\frac{n}{3}+\frac{n^{3}}{3}\\ \sum_{k=1}^{n}{k^{2}}&=\frac{n\left(n+1\right)\left(2n+1\right)}{6}\end{aligned}

CHAMSI
  • 8,333
0

The continuous function $\frac{n(n+1)}{2}$ is not the same as the discrete sum, as shown in the image.


Warning: the steps below are not justified, but they happen to work.

How about differentiating $\sum_{i=1}^n i^3$ ?

$$\sum_{i=1}^n i^3 = \left(\frac{1}{2}n(n+1) \right)^2$$ $$\Rightarrow \frac{d}{dn} \sum_{i=1}^n i^3 = \frac{1}{4}\left((2n+1)(n)(n+1)+n(n+1)(2n+1) \right) \tag{product rule}$$ $$\Rightarrow 3 \sum_{i=1}^n i^2 = \frac{1}{2}(n)(n+1)(2n+1)$$ $$\Rightarrow\sum_{i=1}^n i^2 = \frac{1}{6}(n)(n+1)(2n+1)$$

as if by magic.

Toby Mak
  • 16,827
  • The image is too large to display in the post: https://i.stack.imgur.com/lIlr8.png – Toby Mak May 15 '21 at 11:25
  • And for an instance where this trick fails, try differentiating $\sum_{i=1}^n i^2$. Spoiler: it does not work. – Toby Mak May 15 '21 at 11:26
  • Thank you for your efforts! In the textbook, they used the derivative method to obtain a closed-formula for $\sum_{i=0}^{n-1} ix^i$ from $\sum_{i=0}^{n-1} x^i$. Why is that justified? – ntasosof May 15 '21 at 13:43
  • I recommend you ask that as a new question. If the proof is correct, they must have done something more than take the derivative. – Toby Mak May 16 '21 at 01:33