Answer
See below.
Work Step by Step
1. For $n=2$, we have $LHS=1(1+1)=2$ and $RHS=\frac{2(2-1)(2+1)}{3}=2=LHS$, thus P(2) is true.
2. Assume P(k) ($k\gt2$) is true, we have:
$\sum_{i=1}^{k-1}=\frac{k(k-1)(k+1)}{3}$
3. For $n=k+1$, we have:
$LHS=\sum_{i=1}^{k-1}+k(k+1)=\frac{k(k-1)(k+1)}{3}+k(k+1)\\
=\frac{k(k-1)(k+1)+3k(k+1)}{3}=\frac{k(k+1)(k-1+3)}{3}=\frac{k(k+1)(k+2)}{3}=RHS$
4. Thus $P(k+1)$ is also true and we have proved the statement by mathematical induction.