This question has not used the standard notation in expressing these matrices, so I've made certain assumptions. Nevertheless, the method applies as shown.
Let X=
⎡x11 x12⎤
⎣x21 x22⎦
I have assumed that A=
⎡ 9 2⎤
⎣-5 -1⎦
I have assumed that B=
⎡ 8 -7⎤
⎣ 5 1⎦
then AX=B.
A-1A=I where I is the identity matrix:
⎡ 1 0⎤
⎣ 0 1⎦
Let A-1=
⎡a b⎤
⎣c d⎦
So we can write the following 4 equations:
9a-5b=1, 2a-b=0, so b=2a, 9a-10a=1, a=-1, b=-2;
9c-5d=0, 2c-d=1, so d=2c-1, 9c-10c+5=0, c=5, d=9.
A-1=
⎡-1 -2⎤
⎣ 5 9⎦
A-1AX=A-1B,
X=A-1B.
x11=-8-10=-18, x12=7-2=5, x21=40+45=85, x22=-35+9=-26.
X=
⎡-18 5⎤
⎣ 85 -26⎦
CHECK
AX=
⎡ 9 2⎤⎡-18 5⎤
⎣-5 -1⎦⎣ 85 -26⎦=
⎡-162+170 45-52⎤
⎣ 90-85 -25+26⎦=
⎡ 8 -7⎤
⎣ 5 1⎦= B
An alternative method is to bypass the inverse matrix method and simply solve the following be replacing X with:
⎡a b⎤
⎣c d⎦:
9a+2c=8, -5a-c=5⇒a=-18, c=85;
9b+2d=-7, -5b-d=1⇒b=5, d=-26.
If my assumptions about A and B are not as intended by the question then follow the method with the appropriate switching of rows and columns. This will produce X=
⎡-43 0⎤
⎣-79 -1⎦