\(S=1^2+2^2+3^2+...+n^2\)
\(=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)\)
Theo dạng tổng quát: \(1.2+2.3+3.4+...+n\left(n+1\right)=\frac{n\left(n+1\right)\left(n+2\right)}{3}\)
\(\Rightarrow S=\frac{n\left(n+1\right)\left(n+2\right)}{3}-\frac{n\left(n+1\right)}{2}\)
\(=\frac{2n\left(n+1\right)\left(n+2\right)}{6}-\frac{3n\left(n+1\right)}{6}\)
\(=\frac{2n\left(n+1\right)\left(n+2\right)-3n\left(n+1\right)}{6}\)
\(=\frac{n\left(n+1\right).\left[2\left(n+2\right)-3\right]}{6}=\frac{n\left(n+1\right)\left(2n+1\right)}{6}\)
Vậy \(S=\frac{n\left(n+1\right)\left(2n+1\right)}{6}\)
Ta có : \(S=1^2+2^2+3^2+...+\)\(n^2\)
\(\Rightarrow S=\frac{n.\left(n+1\right)\left(n+2\right)}{2}\)
Xin lỗi mình nhớ nhầm công thức : \(S=\frac{n\left(n+1\right)\left(2n+1\right)}{6}\)