<s>[INST] Proving $1^3+ 2^3 + \cdots + n^3 = \left(\frac{n(n+1)}{2}\right)^2$ using induction How can I prove that

$$1^3+ 2^3 + \cdots + n^3 = \left(\frac{n(n+1)}{2}\right)^2$$ 

for all $n \in \mathbb{N}$? I am looking for a proof using mathematical induction.
Thanks
 [/INST] $$\ S =\sum_{k=1}^n k^3  $$
\begin{align} 
k^3 =& Ak(k+1)(k+2)+Bk(k+1)+Ck+D \\
k^3= & Ak^3+(3A+B)k^2+(2A+B+C)k+D 
\end{align}
Therefore  $A=1$, $B=-3$, $C=1$, $D=0$ and
\begin{align}
 S =& \sum_{k=1}^n (k(k+1)(k+2)-3k(k+1)+k)\\
 S =&\sum_{k=1}^n k(k+1)(k+2)-3\sum_{k=1}^nk(k+1)+\sum_{k=1}^nk  \\
 S =&\sum_{k=1}^n6\binom{k+2}{3}-3\sum_{k=1}^n2\binom{k+1}{2}+\sum_{k=1}^n\binom{k}{1}\\
S=&6\binom{n+3}{4}-6\binom{n+2}{3}+\binom{n+1}{2}\\
S=&\left\lgroup\frac{n(n+1)}{2}\right\rgroup^2.
\end{align}
</s>