Let $A, B \in \mathbb{R}^{3 \times 3}$ be the following matrices: $$ A=\begin{pmatrix} k+1 & 1 & k \\\ 1 & k & 1 \\\ 0 & -1 & 1 \end{pmatrix} $$ $$ B=\begin{pmatrix} 1 & 2 & k \\\ -1 & 1 & k \\\ 1 & 0 & 1 \end{pmatrix} $$
Find, if they exist, all values of $k \in \mathbb{R}$ for which the system admits infinitely many solutions: $$ (A^{2023}B^{2022}-A^{2022}B^{2023})\begin{pmatrix} x_1 \\\ x_2 \\\ x_3 \end{pmatrix}=\begin{pmatrix} 0 \\\ 0\\\ 0 \end{pmatrix} $$
I have no idea how to solve this, I tried using the fact that if the matrices are similar their determinant is equal. Finding that $det(A)=k^2+k$ and $det(B)=k+3$, then for $det(A)=det(B)$ it must happen that $k=±\sqrt3$. However, I don't know what else to do.
First ,since the matrix $M$ is square ,if has non trivial solution for $Mx=0$ ,then set($M$)=$0$. Now, given that $M$=$A^{2022}(A-B)B^{2022}$
From property of determinant, det($M$)=$0$ means either $detA=0$ or $detB=0$,or $det(A-B)=0$
Now, $detA=0$ implies $k=0,-1$
$detB=0$ means $k=-3$
Simply compute $det(A-B)=0$ you will get $det(A-B)=(1-k)(1+k)$ hence, $det(A-B)=0$ for $k=1,-1$
hence, $k=0,-1,1,-3$ are required values.