Xét trường hợp n chẵn:
\(1^2+2^2+3^2+...+n^2=\left(1^2+3^2+5^2+...+\left(n-1\right)^2\right)+\left(2^2+4^2+6^2+...+n^2\right)\)
\(=\frac{\left(n-1\right).n.\left(n+1\right)+n\left(n+1\right).\left(n+2\right)}{6}\)
\(=\frac{n\left(n+1\right).\left(n-1+n+2\right)}{6}\)
\(=\frac{n\left(n+1\right).\left(2n+1\right)}{6}\)
Tương tự với trường hợp n lẻ . ta có \(\text{ĐPCM}\)
\(A=1^2+2^2+3^2+....+n^2\)
\(=1\left(2-1\right)+2\left(3-1\right)+3\left(4-1\right)+....+n\left[\left(n+1\right)-1\right]\)
\(=1.2-1+2.3-2+3.4-3+...+n\left(n+1\right)-n\)
\(=\left[1.2+2.3+3.4+....+n\left(n+1\right)\right]-\left(1+2+3+....+n\right)\)
Ta có :
\(1.2+2.3+3.4+....+n\left(n+1\right)=\frac{n\left(n+1\right)\left(n+2\right)}{3}\)(cái này tự CM nha)
\(1+2+3+....+n=\frac{n\left(n+1\right)}{2}\)
\(\Rightarrow A=\frac{n\left(n+1\right)\left(n+2\right)}{3}-\frac{n\left(n+1\right)}{2}=\frac{n\left(n+1\right)\left(2n+1\right)}{6}\)(đpcm)