TITLE: Is there a connection between $\sum_{k=0}^{n}k^3=\left(\sum_{k=0}^{n}k\right)^2$ and $\int_0^x t^3\text{ } dt=\left(\int_0^x t\text{ } dt\right)^2$?
QUESTION [14 upvotes]: My math teacher pointed out to our class that $$\sum_{k=0}^{n}k^3=\left(\sum_{k=0}^{n}k\right)^2$$
and that
$$\int x^3\text{ } dx=\left(\int x\text{ } dx\right)^2$$
Is there an obvious connection between the two? Can you prove one from the other?

REPLY [2 votes]: In the range $[k,k+1)$ you can decompose $x$ as $x=k+\{x\}$, where $\{x\}$ denotes the fractional part.
Then
$$\int_0^{n+1}x^3\,dx=\sum_{k=0}^n\int_k^{k+1}(k+\{x\})^3dx=\sum_{k=0}^n\int_k^{k+1}(k^3+3k^2\{x\}+3k\{x\}^2+\{x\}^3)\,dx\\
=\sum_{k=0}^n(k^3+3k^2I_1+3kI_2+I_3)=\sum_{k=0}^nk^3+\frac32\sum_{k=0}^nk^2+\sum_{k=0}^nk+\frac{n+1}4$$
with $$I_d:=\int_0^1\{x\}^d\,dx=\frac1{d+1}.$$
Similarly
$$\int_0^{n+1}x\,dx=\sum_{k=0}^n\int_k^{k+1}(k+\{x\})\,dx
=\sum_{k=0}^nk+\frac{n+1}2.$$
If you compute $$\int x^3\,dx-\left(\int x \,dx\right)^2,$$ the cancellation of the terms (but the first) seems magical.