Let the matrices of order 2 with the real elements $A$ and $B$ so that $AB={{A}^{2}}{{B}^{2}}-{{\left( AB \right)}^{2}}$ and $\det \left( B \right)=2$.
a)	Prove that the matrix $A$ is not invertible.
b)	 Calculate $\det \left( A+2B \right)-\det \left( B+2A \right)$.
### Part (a): Prove that the matrix \( A \) is not invertible.

Given the equation:
\[ AB = A^2 B^2 - (AB)^2 \]

First, let's analyze the given equation. We can rewrite it as:
\[ AB + (AB)^2 = A^2 B^2 \]

Now, let's take the determinant on both sides of the equation. Recall that for any matrices \( X \) and \( Y \), \(\det(XY) = \det(X) \det(Y)\). Therefore:
\[ \det(AB + (AB)^2) = \det(A^2 B^2) \]

Since \(\det(A^2 B^2) = \det(A^2) \det(B^2)\), and using the property \(\det(X^2) = (\det(X))^2\), we get:
\[ \det(A^2 B^2) = (\det(A))^2 (\det(B))^2 \]

Now, let's consider the left-hand side:
\[ \det(AB + (AB)^2) \]

Since \(\det(AB + (AB)^2)\) is a determinant of a sum of matrices, it is not straightforward to simplify directly. However, we know that if \( A \) were invertible, then \( \det(A) \neq 0 \). Let's assume \( \det(A) \neq 0 \) and see if it leads to a contradiction.

Given \(\det(B) = 2\), we have:
\[ \det(A^2 B^2) = (\det(A))^2 \cdot 2^2 = 4 (\det(A))^2 \]

Now, if \( A \) were invertible, then \(\det(A) \neq 0\), and thus \(\det(A^2 B^2) \neq 0\). However, the equation \( AB + (AB)^2 = A^2 B^2 \) implies that the determinant of the left-hand side must also be non-zero if \( A \) is invertible.

But, if we consider the possibility that \( A \) is not invertible, then \(\det(A) = 0\). In this case:
\[ \det(A^2 B^2) = 0 \]

This would mean that the right-hand side of the equation is zero, which is consistent with the left-hand side being zero if \( A \) is not invertible. Therefore, the assumption that \( A \) is invertible leads to a contradiction, and we conclude that \( A \) must be non-invertible.

\(\blacksquare\)

### Part (b): Calculate \(\det(A + 2B) - \det(B + 2A)\).

Given:
\[ \det(B) = 2 \]
\[ \det(A) = 0 \] (from part (a))

We use the property of determinants for 2x2 matrices. For any 2x2 matrix \( M \), if \( M = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \), then \(\det(M) = ad - bc\).

We need to calculate:
\[ \det(A + 2B) - \det(B + 2A) \]

First, let's consider \(\det(A + 2B)\):
\[ A + 2B = A + 2B \]
Since \(\det(A) = 0\), we can write:
\[ \det(A + 2B) = \det(2B) \]
For a scalar multiple of a matrix, \(\det(kM) = k^n \det(M)\) where \( n \) is the order of the matrix. Here, \( n = 2 \):
\[ \det(2B) = 2^2 \det(B) = 4 \cdot 2 = 8 \]

Next, let's consider \(\det(B + 2A)\):
\[ B + 2A = B + 2A \]
Since \(\det(A) = 0\), we can write:
\[ \det(B + 2A) = \det(B) \]
Given \(\det(B) = 2\):
\[ \det(B + 2A) = 2 \]

Now, we calculate the difference:
\[ \det(A + 2B) - \det(B + 2A) = 8 - 2 = 6 \]

The final answer is \(\boxed{6}\).