Prove the following by using the principle of mathematical induction for all $n \in N$  $1^2+3^2+5^2+...+(2n-1)^2=\large\frac{n(2n-1)(2n+1)}{3}$

Let the given statement be $P(n)$, i.e.,
$P(n) : 1^2+3^2+5^2+...+(2n-1)^2=\large\frac{n(2n-1)(2n+1)}{3}$
For $n = 1$, we have
$P(1) = 1^2=1 =\large\frac{1(2.1-1)(2.1+1)}{3}$$\large\frac{1.1.3}{3}$$=1$, which is true.
Let $P(k)$ be true for some positive integer $k$, i.e.,
$P(k) : 1^2+3^2+5^2+...+(2k-1)^2=\large\frac{k(2k-1)(2k+1)}{3}$---------(1)
We shall now prove that $P(k+1)$ is true.
Consider
$\{ 1^2+3^2+5^2+...+(2k-1)^2 \}+\{2(k+1)-1 \}^2$
$= \large\frac{k(2k-1)(2k+1)}{3}$$+(2k+2-1)^2\qquad [ Using (1) ] = \large\frac{k(2k-1)(2k+1)}{3}$$(2k+1)^2$
$= \large\frac{k(2k-1)(2k+1)+3(2k+1)^2}{3}$
$= \large\frac{(2k+1) \{k(2k-1)+3(2k+1)\}}{3}$
$= \large\frac{(2k+1) \{2k^2-k+6k+3\}}{3}$
$= \large\frac{(2k+1)\{2k^2+5k+3\}}{3}$
$= \large\frac{(2k+1)\{2k^2+2k+3k+3\}}{3}$
$= \large\frac{(2k+1)\{2k(k+1)+3(k+1)\}}{3}$
$= \large\frac{(2k+1)(k+1)(2k+3)}{3}$
$= \large\frac{(k+1) \{2(k+1)-1\} \{ 2(k+1)+1\}}{3}$
Thus, $P(k+1)$ is true whenever $P(k)$ is true.
Hence, by the principle of mathematical induction, statement $P(n)$ is true for all natural numbers i.e., $n$.