Using the identity
(k+1)3−k3=3k2+3k+1, we have
23−13=3⋅12+3⋅1+1, 33−23=3⋅22+3⋅2+1, (n+1)3−n3=3n2+3n+1. Adding these identities, all intermediate terms on the left-hand side cancel, yielding
(n+1)3−1=3(12+22+⋯+n2)+3(1+2+⋯+n)+n. By Toolkit 1,
1+2+⋯+n=2n(n+1). Hence,
3(12+22+⋯+n2)=(n+1)3−1−23n(n+1)−n=2n(n+1)(2n+1). Therefore,
12+22+⋯+n2=6n(n+1)(2n+1).□