Step 1: Compare entries:
If $A = B$, then each entry of $A$ equals the entry of $B$ in the same place.
The two unknown places give two conditions on $x$.
Step 2: Write the conditions:
From the top right place: $3x = x^2 + 2$.
From the bottom right place: $-6 = x^2 - 5x$.
Both must be true for the same $x$.
Step 3: Solve the first by factoring:
Move all terms to one side to get $x^2 - 3x + 2 = 0$.
Split the middle term: $x^2 - x - 2x + 2 = 0$.
This gives $(x-1)(x-2) = 0$, so $x \in \{1, 2\}$.
Step 4: Test these values in the second condition:
Put $x = 1$: $x^2 - 5x = 1 - 5 = -4$, which is not $-6$.
Put $x = 2$: $x^2 - 5x = 4 - 10 = -6$, which is correct.
So $x = 1$ is rejected and $x = 2$ stays.
Final Answer:
The value is \[ \boxed{x = 2} \]