TITLE: How to determine equation for $\sum_{k=1}^n k^3$
QUESTION [27 upvotes]: How do you find an algebraic formula for $\sum_{k=1}^n k^3$? I am able to find one for $\sum_{k=1}^n k^2$, but not $k^3$. Any hints would be appreciated.

REPLY [2 votes]: If you know the teniest bit of calculus, the following method is quite easy to implement:
$$f(x,p)=a_px+p\int_0^xf(t,p-1)dt$$
$$a_p=1-p\int_0^1f(t,p-1)dt$$
$$f(x,0)=x$$
This recursive formula yields the formula $\sum_{k=1}^nk^p=f(n,p)$.
For example,
$$a_1=1-1\cdot\int_0^1t\,dt=1-\frac12=\color{purple}{\frac12}$$
$$f(x,1)=\color{purple}{\frac12}x+\int_0^xt\,dt=\color{#4455aa}{\frac12x+\frac12x^2}$$
$$a_2=1-2\cdot\int_0^1\color{#4455aa}{\frac12t+\frac12t^2}\,dt=1-\frac12-\frac13=\color{green}{\frac16}$$
$$f(x,2)=\color{green}{\frac16}x+2\cdot\int_0^x\color{#4455aa}{\frac12t+\frac12t^2}\,dt=\color{#aa4444}{\frac16x+\frac12x^2+\frac13x^3}$$
$$a_3=1-3\cdot\int_0^1\color{#aa4444}{\frac16t+\frac12t^2+\frac13t^3}\,dt=1-\frac14-\frac12-\frac14=0$$
$$f(x,3)=0x+3\cdot\int_0^x\color{#aa4444}{\frac16t+\frac12t^2+\frac13t^3}\,dt=\frac14x^2+\frac12x^3+\frac14x^4$$


$$\sum_{k=1}^nk^3=\frac14x^2+\frac12x^3+\frac14x^4$$