I am reading about Gaussian elimination, and the book gives the equation for the number of multiplications/divisions needed to solve a nXn matrix $$\sum_{2}^{n} (k^2-k)$$
The formula I can understand, but what confuses me is when the book says this:
"Through induction you can show that $$\sum_{2}^{n} (k^2-k)=\frac{n^3-n}{3}$$
Edit: Sorry, I was asking the wrong question. I can se that through induction it is true, but how did they come to $\frac{n^3-n}{3}$ without induction in the first place?
For any polynomial $P$ of degree $d+1$, $P(n)-P(n-1)$ is a polynomial of degree $d$. And if $P(n)$ is a sum up to $n$, then $P(n)-P(n-1)$ is the last term of the sum.
There are several ways to discover $P$. For instance by indeterminate coefficients.
With $$\sum_{k=2}^n(k^2-k)=an^3+bn^2+cn+d,$$
you solve
$$n^2-n=a(n^3-(n-1)^3)+b(n^2-(n-1)^2)+c(n-(n-1)).$$
Also see https://www.codeproject.com/Tips/792255/Faulhaber-made-easy, which can be adapted to any polynomial function.