The key to nearly all proofs by induction of expressions similar to this is a 6-step process:
- Define the proposition for $A_r$.
- Prove the base case. This is usually $A_1$.
- Consider the left-hand side of $A_r$ with the inclusion of the additional $(r+1)$-th term.
- Expand out all brackets
- Factorise again. Leverage the factor theorem to find factors one-by-one.
- Remember that you actually know the requisite factors, because you know that the end goal is the right hand side of $A_{r+1}$.
Thus, in your case, as it goes like this:
To Prove:
$$1^3 + 3^3 + ... + (2n + 1)^3 = (n+1)^2(2n^2 + 4n + 1)$$
Proof:
Let $A_r$ be the proposition that
$$1^3 + 3^3 + ... + (2r + 1)^3 = (r+1)^2(2r^2 + 4r + 1) \quad \textrm{...(Eqn 1)}$$
Clearly $A_1$ is true, as lhs = $1^3+3^3 = 28$, and rhs = $(1+1)^2(2+4+1)=28 = $lhs.
Now consider the expression
\begin{align}
& 1^3 + 3^3 + ... + (2r + 1)^3 +(2r+3)^3 \\
& = \left( 1^3 + 3^3 + ... + (2r + 1)^3 \right) +(2r+3)^3 \\
& = (r+1)^2(2r^2 + 4r + 1) + (2r+3)^3 \quad \textrm{(using Eqn 1.)}
\end{align}
Expanding the parentheses, we get:
\begin{align}
& (r^2+2r+1)(2r^2 + 4r + 1) + (8r^3+36r^2+54r+27) \\
& = (r^2+2r+1)(2r^2 + 4r + 1) + (8r^3+36r^2+54r+27) \\
& = (2r^4+8r^3+11r^2+6r+1) + (8r^3+36r^2+54r+27) $$\\
& = 2r^4+16r^3+47r^2+60r+28 \quad \quad \textrm{...(Eqn 2)}
\end{align}
Now let $f(r) = 2r^4+16r^3+47r^2+60r+28 $
Since $f(-2) = 32 - 128 +188-120+28 =0$,
the factor theorem implies that $(r+2)$ is a factor of $f(r)$.
Therefore, $f(r) = (r+2) (2r^3+12r^2+23r+14)$.
Similarly, we note that if $p(r) = (2r^3+12r^2+23r+14)$, then $p(-2) = 0$.
Thus, $(2r^3+12r^2+23r+14) = (r+2) (2r^2+8r+7)$.
Therefore considering Eqn 2 again,
\begin{align}
& 2r^4+16r^3+47r^2+60r+28 = (r+2)^2(2r^2+8r+7) \\
& = (r+2)^2(2r^2+4r+2 + 4r+4 +1 ) \\
& = (r+2)^2(2r^2+4r+2 + 4r+4 +1 ) \\
& = \left( \overline{r+1}+1 \right)^2 \left( 2\overline{r+1}^2 + 4 \overline{r+1} +1 \right) \\
& = \textrm{rhs}
\end{align}
Note
This expression for the sum of odd cubes is slightly unconventional, is this refers to the sum of the first $(n+1)$ cubes. This does not change the induction proof, but readers should be careful when comparing this formula to others that they may find in math books and on the internet, which usually simply gives the formula for the first $n$ odd cubes.