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$? 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?
 A: 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.
A: The second thing is written in a misleading fashion, in part because you aren't thinking about $+C$. A more reasonable formulation of the second identity, in the context of the first, would be $\int_0^x y^3 \,dy = \left ( \int_0^x y \,dy \right )^2$, which does hold.
That said, the first identity implies the one I just wrote, because:
$$\int_0^x y^3 \,dy = \lim_{n \to \infty} \sum_{k=1}^n \frac{x}{n} (kx/n)^3 = \lim_{n \to \infty} \frac{x^4}{n^4} \sum_{k=1}^n k^3$$
while
$$\left ( \int_0^x y \,dy \right )^2 = \left ( \lim_{n \to \infty} \sum_{k=1}^n \frac{x}{n} (kx/n) \right )^2 = \lim_{n \to \infty} \frac{x^4}{n^4} \left ( \sum_{k=1}^n k \right )^2.$$
You can't directly deduce the first identity from this one, though, roughly speaking because the integral only sees the leading term of the sum.
