First create a matrix of coefficients for x and y:
( 2 -4 )
( 4 -2 )
The first column contains the x coefficients and the second column the y coefficients.
Now work out the determinant for the matrix:
| 2 -4 |
| 4 -2 |=(2)(-2)-(-4)(4)=-4+16=12.
To evaluate the determinant, multiply diagonally as shown: subtract the products as shown. The determinant, which we’ll call D, has a value of 12. We’ll need this later.
To find x, replace the x column by the column for the constants:
| -18 -4 |
| -30 -2 |
and evaluate this new determinant=(-18)(-2)-(-4)(-30)=36-120=-84.
Divide by D: -84/12=-7, so x=-7.
Now find y the same way.
The determinant for y is:
| 2 -18 |
| 4 -30 |=(2)(-30)-(-18)(4)=-60+72=12. Divide by D: y=12/12=1.
So the solution using Cramer’s Rule is x=-7, y=1.
Check the solution by putting these values of x and y into the original equations:
2×(-7)-4×1=-14-4=-18 OK
4×(-7)-2×1=-28-2=-30 OK solution confirmed.