A^(-1) = ( 1/det(A) ) * adj(A)
Where det = determinant, and
adj = adjoint
There is a trick to getting the Adjoint of a matrix, almost similar to the determinant (except you are computing entries for a new matrix). You then transpose the result of doing so.
Example: Find the adjoint of
[1 0 1]
[2 2 5]
[-1 3 0]
Answer: Your matrix will be the result of finding the determinant after deleting the i-th row and j-th column for enter a[ij]. You will also negate the answer if (i + j) is odd. So you will have
[+ - +] T
[- + -]
[+ - +]
(transpose of the answer)
To find the entry at 1, 1, delete 1st row and 1st column, to get
[2 5]
[3 0]
And find the determinant of that. The result will be your first entry. The determinant of this 2 x 2 matrix is -15.
[-15 - +] T
[- + -]
[+ - +]
To find (1, 2), delete 1st row second column, leaving you with just
[2 5]
[-1 0]
For a determinant of 5. But since the entry is a negative, we negate the 5 to get -5.
[-15 -5 +] T
[- + -]
[+ - +]
If you keep doing this to find the entries, you will eventually get
[-15 -5 8] T
[3 1 -3]
[-2 -3 2]
And you want to transpose this.
[-15 3 -2]
[-5 1 -3]
[8 -3 2]
That means
adjoint of the given matrix is that.
With that said, we can now calculate the inverse of our original matrix,which we will call A.
A = [1 0 1]
. . . [2 2 5]
. . . [-1 3 0]
A^(-1) = ( 1/det(A) ) adj(A)
We evaluate the determimant.
det(A) = 1 * det[2 5] - 0 + 1 * det[2 2]
. . . . . . . . . . . .[3 0] . . . . . . . . [-1 3]
det(A) = 1 * (0 - 15) + 1 * (6 - (-2))
det(A) = 1(-15) + (6 + 2)
det(A) = -15 + 8
det(A) = -7
And we already know that
adj(A) = [-15 3 -2]
. . . . . . .[-5 1 -3]
. . . . . . .[8 -3 2]
So
A^(-1) = ( 1/(-7) ) [-15 3 -2]
. . . . . . . . . . . . .[-5 1 -3]
. . . . . . .. . . . . . .[8 -3 2]
A^(-1) = ( -1/7 ) [-15 3 -2]
. . . . . . . . . . . . .[-5 1 -3]
. . . . . . .. . . . . . .[8 -3 2]
A^(-1) = [ 15/7 -3/7 2/7 ]
. . . . . . [ 5/7 -1/7 3/7 ]
. . . . . . [ -8/7 3/7 -2/7 ]
Barring arithmetic errors, this should be the inverse.
To test, just multiply it with original matrix and see if you get identity.
[1 0 1][ 15/7 -3/7 2/7 ]
[2 2 5] [ 5/7 -1/7 3/7 ]
[-1 3 0] [ -8/7 3/7 -2/7 ]
[1 0 0]
[0 1 0]
[0 0 1]
Yup.