Home»Math Guides»Finding Determinant 2 by 2, 3 by 3, and even 5 by 5 matrices
Finding 2×2, 3×3 and even 5×5 Determinants
We’ll show you how to find 2×2 and 3×3 determinants.
Finding 3×3 determinants is just finding multiple 2×2 determinants, so we’ll start with an example of a 2×2 determinant.
We’ll also show you later on how to double check your hand results using MATLAB, which only requires inputting the matrix and using a single built-in function to calculate the determinant.
Example Problem: Find the determinant of \[A = \left[ {\begin{array}{*{20}{c}}1&7\\4&5\end{array}} \right]\]
You just need to subtract the products of the diagonals. Be careful not to do the wrong order by mistake and be wary of arithmetic error.
\[\det (A) = (1)(5) – (4)(7)\]
\[\det (A) = – 23\]
Easy! Now let’s find the determinant of a 3×3 matrix. The method to do so is to find multiple 2×2 determinants.
Example Problem: Find the determinant of \[A = \left[ {\begin{array}{*{20}{c}}1&7&3\\4&5&5\\7&8&5\end{array}} \right]\]
What you need to do, is make a path going through any row or column.
Then for each individual element in the path cover the row and column and find the determinant of the 2×2 matrix left.
Be careful, you need to use the following co-factor matrix, memorize it:
\[\left[ {\begin{array}{*{20}{c}} + & – & + \\ – & + & – \\ + & – & + \end{array}} \right]\]
That sounds wordy, but let’s go across the first row, which has values of 1, 7, and 3.
See the matrix above, the first is added, second subtracted, and third is added again because we need to use the first row in the cofactor matrix that has the positive and negatives.
If we instead used the second row of the 3×3 matrix we’re finding the determinant for, then we’d have to use the second row in the cofactor matrix as well, so instead the first is subtracted, second is added, and third is subtracted.
So just keep this in mind, be careful of your positive and negative signs depending on which row you’re using to get the determinant.
Why would you want to switch rows? The trick is to find a row with 0’s if possible, it significantly reduces the amount of computations you need to perform.
Less computations means less of a chance of making a mistake!
\[\det (A) = 1\det \left( {\left[ {\begin{array}{*{20}{c}}5&5\\8&5\end{array}} \right]} \right) – 7\det \left( {\left[ {\begin{array}{*{20}{c}}4&5\\7&5\end{array}} \right]} \right) + 3\det \left( {\left[ {\begin{array}{*{20}{c}}4&5\\7&8\end{array}} \right]} \right)\]
If you’re confused how we got this, we start with covering the column and row in “1”, so what’s left is that first 2×2 determinant, then we cover up the column and row in “7” and that’s subtracted, then we add the determinant left from covering the row and column of “3”.
As we’ve previously mentioned, it means there are a lot of ways to find the 3×3 determinant of a matrix, you can go across any row or column.
If you use the middle row to find the determinant, you get:
\[\det (A) = – 4\det \left( {\left[ {\begin{array}{*{20}{c}}7&3\\8&5\end{array}} \right]} \right) + 5\det \left( {\left[ {\begin{array}{*{20}{c}}1&3\\7&5\end{array}} \right]} \right) – 5\det \left( {\left[ {\begin{array}{*{20}{c}}1&7\\7&8\end{array}} \right]} \right)\]
That means that if you see a certain part of a matrix has a bunch of zeros, then you can use that to make computations easier.
But for now, let’s solve this using the first row we found earlier:
\[\det (A) = 1\det \left( {\left[ {\begin{array}{*{20}{c}}5&5\\8&5\end{array}} \right]} \right) – 7\det \left( {\left[ {\begin{array}{*{20}{c}}4&5\\7&5\end{array}} \right]} \right) + 3\det \left( {\left[ {\begin{array}{*{20}{c}}4&5\\7&8\end{array}} \right]} \right)\]
\[\begin{array}{l}\det (A) = 1( – 15) – 7( – 15) + 3( – 3)\\\det (A) = 81\end{array}\]
And it’s just that easy.
Let’s do another example that shows how little work you need to do if you take advantage of 0’s in a matrix.
Example problem: Find the determinant. \[A = \left[ {\begin{array}{*{20}{c}}1&7&3\\4&5&0\\7&8&0\end{array}} \right]\]
Be careful of your signs.
\[\det (A) = 3\det \left( {\left[ {\begin{array}{*{20}{c}}4&5\\7&8\end{array}} \right]} \right) – 0\det \left( {\left[ {\begin{array}{*{20}{c}}1&7\\7&8\end{array}} \right]} \right) + 0\det \left( {\left[ {\begin{array}{*{20}{c}}1&7\\4&5\end{array}} \right]} \right)\]
Since we multiply by the number we’re traveling along, we now don’t need to find those two 2×2 determinants. This reduces our work considerably!
You could’ve indeed used any other row or column to get the determinant, but look how much easier to do this!
\[\det (A) = 3( – 3)\]
\[\det (A) = -9\]
It’s possible to find the determinant of a 4×4 matrix by reducing it into smaller 3×3 determinants, just like how we turned a 3×3 determinant into a bunch of 2×2 determinants.
A good tricky question on an exam is for your teacher to give a very high-ordered matrix, which you can only solve within time limits by purposely taking advantage of the 0’s in a matrix.
There was once a 7×7 matrix I was asked to find the determinant of, but let’s do a 5×5 to keep things under control.
To do this determinant under time constraints, you need to spot 0’s and use them!
Don’t forget the plus and minus cofactor matrix!
Example Problem: Find the determinant, \[A = \left[ {\begin{array}{*{20}{c}}1&2&{18}&4&9\\4&6&2&3&0\\3&0&3&2&0\\4&0&8&0&0\\9&0&4&0&0\end{array}} \right]\]
Immediately make use of the last column of 0’s.
Now the determinant of the 5×5 matrix is made up of 4×4 matrices, or 1 4×4 matrix in this case.
\[\det (A) = 9\det \left( {\left[ {\begin{array}{*{20}{c}}4&6&2&3\\3&0&3&2\\4&0&8&0\\9&0&4&0\end{array}} \right]} \right)\]
Now use the second column of 0’s. Remember, you put your hand over the 6’s column and row to get the 3×3 matrix.
Remember the positive and negative cofactor matrix, 6 here is negative.
\[\det (A) = (9)( – 6)\det \left( {\left[ {\begin{array}{*{20}{c}}3&3&2\\4&8&0\\9&4&0\end{array}} \right]} \right)\]
Now we make use of the last row of zeros. 2 here is positive according to the positive/negative cofactor matrix.
\[\det (A) = (9)( – 6)(2)\det \left( {\left[ {\begin{array}{*{20}{c}}4&8\\9&4\end{array}} \right]} \right)\]
\[\det (A) = (9)( – 6)(2)[(4)(4) – (8)(9)]\]
\[\det (A) = 6048\]
And there you have it!
Solving Matrices using MATLAB
Do you need to double check the determinants of your matrices quickly? You can input the matrices into Wolfram, but it’s a little time-consuming and it might not be allowed because Wolfram only allows a certain computation time for free users.
We love using MATLAB, just define the matrices quickly and use its built-in functions easily.
For the first example input:
A=[1 7;
4 5]
det(A)
And you get:
ans =
-23
For the second example input:
A=[1 7 3;
4 5 5;
7 8 5]
det(A)
And you obtain:
ans =
81.0000
For the third example, input:
A= [1 2 18 4 9;
4 6 2 3 0;
3 0 3 2 0;
4 0 8 0 0;
9 0 4 0 0]
det(A)
And you will acquire:
ans =
6.0480e+03
This last output was due to our output settings, MATLAB outputted in scientific notation, but it’s just saying 6048.
So if you ever get a homework assignment and you’re a student, easily double check your answers in MATLAB, it’s very easy to make an arithmetic mistake in linear algebra due to mixing up a sign.
Click here to move on to examples involving the triple-product and cross-product
Or, use these skills solving matrices to find the volume of a parallelpiped