$ \sum{ k^2}\;的公式 $

$ Pf： $

$ 考慮：\;(k+1)^3-k^3=3k^2+3k+1$

$ \sum_{k=1}^{n}{\left [ (k+1)^3-k^3 \right ] }=\sum_{k=1}^{n}{ \left ( 3k^2+3k+1 \right ) }$

$⇒ (2^3-1^3)+(3^3-2^3)+...+[n^3-(n-1)^3]+[(n+1)^3-n^3]$
$\;\;=3\sum_{k=1}^{n}{k^2 } +3\sum_{k=1}^{n}{k }+\sum_{k=1}^{n}{1 }$

$⇒ (n+1)^3-1=3\sum_{k=1}^{n}{ k^2}+3×\frac{n(n+1)}{2} +n$

$⇒ n^3+3n^2+3n=3\sum_{k=1}^{n}{k^2 }+\frac{3n(n+1)}{2}+n $

$⇒3 \sum_{k=1}^{n}{k^2 } =(n^3+3n^2+3n)-\frac{3n^2+5n}{2}=n^3+\frac{3}{2}n^2+\frac{1}{2}n$

$⇒\sum_{k=1}^{n}{ k^2}=\frac{2n^3+3n^2+n}{6}=\frac{n(n+1)(2n+1)}{6}$

n = 1 (slider from 1 to 50, step 1)
Step = 0 (slider from 0 to 7, step 1)
A = (1.26, 5.82)
T1: "$ \sum_{k=1}^{n}{k^2 }=\frac{n(n+1)(2n+1)}{6} $
$\sum_{k=1}^{" + (LaTeX[n]) + "}{ k^2}=" + (LaTeX[If[n ≟ 1, "1^2", If[n ≟ 2, "1^2+2^2", If[n ≟ 3, "1^2+2^2+3^2", "1^2+2^2+..."]]]]) + "" + (LaTeX[If[n < 4, "", "+"]]) + "" + (LaTeX[If[n > 3, n * "²"]]) + "$
$\;\;\;\;\;\;\;\;\;\;=\frac{" + (LaTeX[n]) + "×(" + (LaTeX[n]) + "+1)×(2×" + (LaTeX[n]) + "+1)}{6}$
$\;\;\;\;\;\;\;\;\;\;=\frac{" + (LaTeX[n]) + "×" + (LaTeX[n + 1]) + "×" + (LaTeX[2 * n + 1]) + "}{6}$
$\;\;\;\;\;\;\;\;\;\;=" + (LaTeX[(n * (n + 1) * (2 * n + 1)) / 6]) + "$"