### Theory:

The square of the difference of two expressions:
${\left(a-b\right)}^{2}={a}^{2}-2\mathit{ab}+{b}^{2}$
The square of the difference of two expressions is equal to the square of the first expression, minus twice the product of the first and the second expression, plus the square of the second expression:

$\begin{array}{l}{\left(a-b\right)}^{2}=\left(a-b\right)\cdot \left(a-b\right)\\ =a\cdot a+a\cdot \left(-b\right)-b\cdot a-b\cdot \left(-b\right)\\ ={a}^{2}-\mathit{ab}-\mathit{ba}+{b}^{2}\\ ={a}^{2}-2\mathit{ab}+{b}^{2}\end{array}$
Application of the formula ${\left(a-b\right)}^{2}={a}^{2}-2\mathit{ab}+{b}^{2}$
Example:
1) According to the formula:

$\begin{array}{l}{\left(x-3\right)}^{2}\\ ={x}^{2}-2\cdot x\cdot 3+{3}^{2}\\ ={x}^{2}-6x+9\end{array}$

Without the formula (multiplying a polynomial by a polynomial):

$\begin{array}{l}{\left(x-3\right)}^{2}=\left(x-3\right)\cdot \left(x-3\right)\\ =x\cdot x+x\cdot \left(-3\right)-3\cdot x-3\cdot \left(-3\right)\\ ={x}^{2}-3x-3x+9\\ ={x}^{2}-6x+9\end{array}$

2) According to the formula:

$\begin{array}{l}{\left(4x-y\right)}^{2}\\ ={\left(4x\right)}^{2}-2\cdot 4x\cdot y+{y}^{2}\\ =16{x}^{2}-8\mathit{xy}+{y}^{2}\end{array}$

Without the formula (multiplying a polynomial by a polynomial):

$\begin{array}{l}{\left(4x-y\right)}^{2}=\left(4x-y\right)\cdot \left(4x-y\right)\\ =4x\cdot 4x+4x\cdot \left(-y\right)-y\cdot 4x-y\cdot \left(-y\right)\\ =16{x}^{2}-4\mathit{xy}-4\mathit{xy}+{y}^{2}\\ =16{x}^{2}-8\mathit{xy}+{y}^{2}\end{array}$

3) According to the formula:

$\begin{array}{l}{\left(6z-9\right)}^{2}\\ ={\left(6z\right)}^{2}-2\cdot 6z\cdot 9+{9}^{2}\\ ={36z}^{2}-108z+81\end{array}$.

Without the formula (multiplying a polynomial by a polynomial):

$\begin{array}{l}{\left(6z-9\right)}^{2}\\ =\left(6z-9\right)\cdot \left(6z-9\right)\\ =6z\cdot 6z+6z\cdot \left(-9\right)-9\cdot 6z-9\cdot \left(-9\right)\\ =36{z}^{2}-54z-54z+81\\ =36{z}^{2}-108z+81\end{array}$