I am to prove through induction that $$\sum_{k=1}^n (2k-1)^2 = \frac{n(2n-1)(2n+1)}{3}$$
And well, my method seems to be working, but I get stuck when I'm nearly done. First I prove the formula work for $n = 1$.
$$\sum_{k=1}^1 (2k-1)^2 = 1$$ $$f(1)=\frac{(2*1-1)(2*1+1)}{3} = 1$$
I then assume it works for $n = p$ and want to show it works for $n = (p+1)$
$$\frac{n(2n-1)(2n+1)}{3} + (2(n+1)-1)^2 \stackrel{?}{=} \frac{(n+1)(2(n+1)-1)(2(n+1)+1)}{3}$$
$$\frac{n(2n-1)(2n+1)}{3} + (2(n+1)-1)^2 = \frac{(4n^3+12n^2+11n+3)}{3}$$
I didn't show all the steps in the last equation, however, this is where I'm stuck; how can I factor the numerator? I tried using Wolfram | Mathematica, but it just went straight from the current expression into factored form.
Also I suppose I'm wondering if I chose the easiest path to proving the formula through induction.
For $n+1$ step, you don't need to expand them. $$\begin{align}\sum_{k=1}^{n+1}(2k-1)^2&=\sum_{k=1}^{n}(2k-1)^2+\{2(n+1)-1\}^2\\&=\frac{n(2n-1)(2n+1)}{3}+(2n+1)^2\\&=\frac{n(2n-1)\color{red}{(2n+1)}}{\color{red}{3}}+(2n+1)\times \color{red}{(2n+1)}\times \frac{3}{\color{red}{3}}\\&=\color{red}{\frac{2n+1}{3}}\left\{n(2n-1)+3(2n+1)\right\}\\&=\frac{2n+1}{3}(2n^2+5n+3)\\&=\frac{2n+1}{3}(n+1)(2n+3)\\&=\frac{(n+1)\{2(n+1)-1\}\{2(n+1)+1\}}{3}.\end{align}$$