I have difficulty in finding the transformation matrix of two similar matrices.
It is known that matrix $A=\left(\begin{array}{ccc} -2 & -2 & 1 \\ 2 & x & -2 \\ 0 & 0 & -2 \end{array}\right)$ is similar to matrix $B=\left(\begin{array}{lll} 2 & 1 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & y \end{array}\right)$.
I found the specific values of $x$ and $y$ by using the following method:
Aλ = λ*
IdentityMatrix[3] - {{-2, -2, 1}, {2, x, -2}, {0, 0, -2}};
Bλ = λ*
IdentityMatrix[3] - {{2, 1, 0}, {0, -1, 0}, {0, 0, y}};
Control`PCS`SmithForm[Aλ, λ]
Control`PCS`SmithForm[Bλ, λ]
SolveAlways[-(λ + 2) (-λ^2 -
2 λ + λ x + 2 x - 4) == (λ -
2) (λ + 1) (-(y - λ)), λ]
When I want to find an invertible matrix P such that $P^{-1}AP=B$, I have a problem:
eqs = Thread[
Flatten[Inverse[{{x11, x12, x13}, {x21, x22, x23}, {x31, x32,
x33}}].({{-2, -2, 1}, {2, x, -2}, {0, 0, -2}} /.
x -> 3).{{x11, x12, x13}, {x21, x22, x23}, {x31, x32,
x33}}] ==
Flatten[{{2, 1, 0}, {0, -1, 0}, {0, 0, y}} /. y -> -2]];
FindInstance[eqs, {x11, x12, x13, x21, x22, x23, x31, x32,
x33}, Reals]
The above code has been running, unable to return the results, what is a good way to find this matrix $P$?