Matrices and Determinants: Operations, Inverse and Cramer's Rule

A matrix is a rectangular array of numbers arranged in rows and columns, and a determinant is a single number attached to a square matrix. Together they give a compact way to handle systems of linear equations. Entry tests ask for products, transposes, determinant values, properties such as det(kA), inverses and the solution of equations by Cramer's rule, and almost every question is a short calculation once the rules are clear. In this lesson a matrix is written row by row, so [[1, 2], [3, 4]] means the matrix with rows (1, 2) and (3, 4).

Asked in: ECAT, NUST NET, JEE Main, FSc and Class 11-12 boards

Order and types of matrices

A matrix with m rows and n columns has order m × n. The entry in row i and column j is written aᵢⱼ. A matrix with one row is a row matrix, with one column a column matrix, and with m = n a square matrix.

Important square matrices: a diagonal matrix has zeros off the main diagonal; a scalar matrix is diagonal with all diagonal entries equal; the identity matrix I has 1s on the diagonal and 0s elsewhere; an upper (or lower) triangular matrix has only zeros below (or above) the diagonal. The zero matrix O has every entry 0.

Addition, scalar multiples and multiplication

Matrices of the same order are added entry by entry, and kA multiplies every entry by k.

The product AB exists only when the number of columns of A equals the number of rows of B. The entry in row i, column j of AB is found by multiplying row i of A with column j of B term by term and adding. Matrix multiplication is associative, but in general AB ≠ BA, so the order always matters.

Transpose, symmetric and skew-symmetric matrices

The transpose Aᵀ is formed by writing the rows of A as columns, so an m × n matrix becomes n × m.

A square matrix is symmetric if Aᵀ = A (a mirror image across the diagonal) and skew-symmetric if Aᵀ = −A. In a skew-symmetric matrix every diagonal entry must be 0, because aᵢᵢ = −aᵢᵢ. Every square matrix is the sum of a symmetric part (A + Aᵀ)/2 and a skew-symmetric part (A − Aᵀ)/2.

Determinants of order 2 and 3

For a 2 × 2 matrix the determinant is the product of the leading diagonal minus the product of the other diagonal.

For a 3 × 3 matrix, expand along any row or column. The minor Mᵢⱼ is the 2 × 2 determinant left after deleting row i and column j; the cofactor is Cᵢⱼ = (−1) raised to (i + j) times Mᵢⱼ, which gives the sign pattern + − + / − + − / + − +. The determinant is the sum of each entry of the chosen row times its cofactor; choose the row or column with the most zeros.

Properties of determinants

These properties save long calculations. Interchanging two rows changes the sign. If two rows are equal or proportional, or a row is all zeros, the determinant is 0. Adding a multiple of one row to another does not change it. Multiplying one row by k multiplies the determinant by k.

For a triangular or diagonal matrix the determinant is simply the product of the diagonal entries. Since kA multiplies every one of the n rows by k, det(kA) = kⁿ det A for an n × n matrix.

Adjoint and inverse

A square matrix is singular if det A = 0 and non-singular otherwise. Only a non-singular matrix has an inverse A⁻¹, with AA⁻¹ = A⁻¹A = I.

The adjoint adj A is the transpose of the matrix of cofactors. Then A⁻¹ = adj A ÷ det A. For a 2 × 2 matrix this gives a quick rule: swap the diagonal entries, change the signs of the other two, and divide by the determinant.

Linear equations and Cramer's rule

A system such as a₁x + b₁y + c₁z = d₁ (and two more equations) can be written AX = B. If D = det A ≠ 0 the system has exactly one solution, given by Cramer's rule: Dx is D with the x-column replaced by the constants, and similarly for Dy and Dz.

If D = 0 there is no unique solution: the system has either no solution or infinitely many. A homogeneous system (all constants zero) always has the trivial solution x = y = z = 0, and it has a non-zero solution only when D = 0.

Solved examples

  1. If A = [[2, 1], [3, 4]] and B = [[1, −2], [0, 5]], find 2A − B and AB.
    1. 2A = [[4, 2], [6, 8]], so 2A − B = [[4 − 1, 2 + 2], [6 − 0, 8 − 5]] = [[3, 4], [6, 3]].
    2. Row 1 of AB: (2)(1) + (1)(0) = 2 and (2)(−2) + (1)(5) = 1.
    3. Row 2 of AB: (3)(1) + (4)(0) = 3 and (3)(−2) + (4)(5) = 14.
    Answer: 2A − B = [[3, 4], [6, 3]]; AB = [[2, 1], [3, 14]]
  2. Evaluate det [[2, 1, 3], [0, 4, −1], [5, −2, 1]].
    1. Expand along the first row with signs + − +.
    2. 2 × (4 × 1 − (−1)(−2)) = 2 × (4 − 2) = 4.
    3. −1 × (0 × 1 − (−1)(5)) = −1 × 5 = −5.
    4. +3 × (0 × (−2) − 4 × 5) = 3 × (−20) = −60.
    5. Total: 4 − 5 − 60 = −61.
    Answer: −61
  3. Find the inverse of A = [[3, 5], [1, 2]] and check the answer.
    1. det A = 3 × 2 − 5 × 1 = 1, which is non-zero, so A⁻¹ exists.
    2. Swap the diagonal entries 3 and 2, and change the signs of 5 and 1: [[2, −5], [−1, 3]].
    3. Divide by det A = 1: A⁻¹ = [[2, −5], [−1, 3]].
    4. Check: AA⁻¹ = [[6 − 5, −15 + 15], [2 − 2, −5 + 6]] = [[1, 0], [0, 1]] = I.
    Answer: A⁻¹ = [[2, −5], [−1, 3]]
  4. Find the inverse of A = [[1, 1, 0], [0, 1, 1], [1, 0, 1]].
    1. det A = 1(1 × 1 − 1 × 0) − 1(0 × 1 − 1 × 1) + 0 = 1 + 1 = 2.
    2. Cofactors of row 1: C₁₁ = 1, C₁₂ = −(0 − 1) = 1, C₁₃ = 0 − 1 = −1.
    3. Row 2: C₂₁ = −(1 − 0) = −1, C₂₂ = 1 − 0 = 1, C₂₃ = −(0 − 1) = 1. Row 3: C₃₁ = 1 − 0 = 1, C₃₂ = −(1 − 0) = −1, C₃₃ = 1 − 0 = 1.
    4. adj A is the transpose of the cofactor matrix: [[1, −1, 1], [1, 1, −1], [−1, 1, 1]].
    5. A⁻¹ = adj A ÷ 2.
    Answer: A⁻¹ = (1/2)[[1, −1, 1], [1, 1, −1], [−1, 1, 1]]
  5. Solve by Cramer's rule: x + y + z = 6, 2x − y + z = 3, x + 2y − z = 2.
    1. D = det [[1, 1, 1], [2, −1, 1], [1, 2, −1]] = 1(1 − 2) − 1(−2 − 1) + 1(4 + 1) = −1 + 3 + 5 = 7.
    2. Dx = det [[6, 1, 1], [3, −1, 1], [2, 2, −1]] = 6(1 − 2) − 1(−3 − 2) + 1(6 + 2) = −6 + 5 + 8 = 7.
    3. Dy = det [[1, 6, 1], [2, 3, 1], [1, 2, −1]] = 1(−3 − 2) − 6(−2 − 1) + 1(4 − 3) = −5 + 18 + 1 = 14.
    4. Dz = det [[1, 1, 6], [2, −1, 3], [1, 2, 2]] = 1(−2 − 6) − 1(4 − 3) + 6(4 + 1) = −8 − 1 + 30 = 21.
    5. x = 7/7 = 1, y = 14/7 = 2, z = 21/7 = 3. Check in the first equation: 1 + 2 + 3 = 6.
    Answer: x = 1, y = 2, z = 3
  6. A is a 3 × 3 matrix with det A = 4. Find det(2A), det(Aᵀ), det(A⁻¹) and det(adj A).
    1. det(2A) = 2³ × det A = 8 × 4 = 32, because each of the three rows is doubled.
    2. det(Aᵀ) = det A = 4.
    3. det(A⁻¹) = 1/det A = 1/4.
    4. det(adj A) = (det A)ⁿ⁻¹ = 4² = 16 for n = 3.
    Answer: 32, 4, 1/4 and 16

Exam shortcuts

Common mistakes

Practice MCQs

  1. If A is of order 2 × 3 and B is of order 3 × 4, the order of AB is:
    A) 2 × 4
    B) 3 × 3
    C) 4 × 2
    D) AB is not defined
    Answer: A) 2 × 4 — The inner orders match (3 and 3), so AB exists, and its order is given by the outer numbers: 2 × 4. Note that BA is not defined, since 4 ≠ 2.
  2. The value of det [[4, −3], [2, 5]] is:
    A) 26
    B) 14
    C) −26
    D) 23
    Answer: A) 26 — ad − bc = 4 × 5 − (−3)(2) = 20 + 6 = 26. Getting 14 comes from treating −3 × 2 as +6 and subtracting it.
  3. The transpose of [[1, 2, 3], [4, 5, 6]] is:
    A) [[1, 2], [3, 4], [5, 6]]
    B) [[4, 5, 6], [1, 2, 3]]
    C) [[3, 6], [2, 5], [1, 4]]
    D) [[1, 4], [2, 5], [3, 6]]
    Answer: D) [[1, 4], [2, 5], [3, 6]] — Rows become columns: the first row (1, 2, 3) becomes the first column, giving rows (1, 4), (2, 5), (3, 6). Simply regrouping the numbers in pairs gives the wrong option [[1, 2], [3, 4], [5, 6]].
  4. If A = [[2, 0], [1, 3]] and B = [[1, 4], [0, 2]], then AB equals:
    A) [[6, 12], [2, 6]]
    B) [[2, 0], [0, 6]]
    C) [[2, 8], [1, 10]]
    D) [[2, 8], [1, 6]]
    Answer: C) [[2, 8], [1, 10]] — Row 1: (2)(1) + (0)(0) = 2 and (2)(4) + (0)(2) = 8. Row 2: (1)(1) + (3)(0) = 1 and (1)(4) + (3)(2) = 10. [[6, 12], [2, 6]] is BA, and [[2, 0], [0, 6]] multiplies matching entries, which is not matrix multiplication.
  5. Which of the following matrices is skew-symmetric?
    A) [[0, 3], [3, 0]]
    B) [[0, 3], [−3, 0]]
    C) [[1, 3], [−3, 1]]
    D) [[0, −3], [−3, 0]]
    Answer: B) [[0, 3], [−3, 0]] — A skew-symmetric matrix has Aᵀ = −A: zero diagonal and aⱼᵢ = −aᵢⱼ. [[0, 3], [3, 0]] and [[0, −3], [−3, 0]] are symmetric, and [[1, 3], [−3, 1]] has a non-zero diagonal.
  6. The value of det [[1, 2, 3], [0, 4, 5], [0, 0, 6]] is:
    A) 11
    B) 0
    C) 6
    D) 24
    Answer: D) 24 — The matrix is upper triangular, so its determinant is the product of the diagonal entries: 1 × 4 × 6 = 24. Adding the diagonal gives 11, which is the trace, not the determinant.
  7. The inverse of [[4, 7], [2, 4]] is:
    A) (1/2)[[4, −2], [−7, 4]]
    B) (1/2)[[4, −7], [−2, 4]]
    C) (1/2)[[−4, 7], [2, −4]]
    D) [[4, −7], [−2, 4]]
    Answer: B) (1/2)[[4, −7], [−2, 4]] — det = 16 − 14 = 2. Swap the diagonal (4 and 4), negate the others (−7 and −2), and divide by 2. Forgetting to divide by the determinant gives [[4, −7], [−2, 4]].
  8. For which values of x is the matrix [[x, 2], [3, x − 5]] singular?
    A) x = −6 or x = 1
    B) x = 2 or x = 3
    C) x = 6 or x = −1
    D) x = 5 or x = 6
    Answer: C) x = 6 or x = −1 — Singular means det = 0: x(x − 5) − 6 = 0, so x² − 5x − 6 = (x − 6)(x + 1) = 0, giving x = 6 or x = −1.
  9. If A is a 3 × 3 matrix with det A = 5, then det(3A) equals:
    A) 15
    B) 135
    C) 45
    D) 125
    Answer: B) 135 — det(kA) = kⁿ det A, so det(3A) = 3³ × 5 = 27 × 5 = 135. The answer 15 forgets that all three rows are multiplied by 3.
  10. If A is a 3 × 3 matrix with det A = 4, then det(adj A) is:
    A) 16
    B) 4
    C) 64
    D) 1/4
    Answer: A) 16 — det(adj A) = (det A)ⁿ⁻¹ = 4² = 16 for n = 3. 64 uses the power n instead of n − 1, and 1/4 is det(A⁻¹).
  11. For non-singular square matrices A and B of the same order, (AB)⁻¹ equals:
    A) A⁻¹B⁻¹
    B) BA
    C) B⁻¹A⁻¹
    D) A⁻¹ + B⁻¹
    Answer: C) B⁻¹A⁻¹ — (AB)(B⁻¹A⁻¹) = A(BB⁻¹)A⁻¹ = AA⁻¹ = I, so the inverse of a product is the product of inverses in reverse order. A⁻¹B⁻¹ is wrong because AB ≠ BA in general.
  12. For the system 3x + 2y = 12 and x − y = −1, Cramer's rule gives D and Dx as:
    A) D = −5, Dx = −15
    B) D = 5, Dx = −10
    C) D = −5, Dx = −10
    D) D = −1, Dx = −2
    Answer: C) D = −5, Dx = −10 — D = det [[3, 2], [1, −1]] = −3 − 2 = −5. Dx replaces the x-column by the constants: det [[12, 2], [−1, −1]] = −12 + 2 = −10. So x = −10/−5 = 2 (and y = 3). Dy = −15, so the option "D = −5, Dx = −15" has used Dy in place of Dx.
  13. For what value of k does the system kx + 2y = 5, 3x + 6y = 7 have no unique solution?
    A) k = 1
    B) k = 3
    C) k = −1
    D) k = 2
    Answer: A) k = 1 — No unique solution means D = 0: 6k − 2 × 3 = 0, so k = 1. Then the lines x + 2y = 5 and 3x + 6y = 7 are parallel and the system has no solution at all.
  14. The system x + 2y + z = 0, 2x + y + 3z = 0, x + ky + 2z = 0 has a non-zero solution when k equals:
    A) 1
    B) −1
    C) 0
    D) 3
    Answer: B) −1 — A homogeneous system has a non-trivial solution only when D = 0. D = 1(2 − 3k) − 2(4 − 3) + 1(2k − 1) = −k − 1, so k = −1. Losing the minus sign on the middle term gives k = 1.
  15. If A = [[3, 1], [−1, 2]], then A² − 5A equals:
    A) 7I
    B) −5I
    C) the zero matrix O
    D) −7I
    Answer: D) −7I — A² = [[9 − 1, 3 + 2], [−3 − 2, −1 + 4]] = [[8, 5], [−5, 3]] and 5A = [[15, 5], [−5, 10]]. The difference is [[−7, 0], [0, −7]] = −7I. (This matches A² − (trace)A + (det)I = O, with trace 5 and det 7.)

Questions

What is the difference between a matrix and a determinant?

A matrix is an arrangement of numbers and has no single value; it can be of any order m × n. A determinant is a number calculated from a square matrix only. For example [[1, 2], [3, 4]] is a matrix, and its determinant is 1 × 4 − 2 × 3 = −2.

When does a matrix have no inverse?

When its determinant is 0. Such a matrix is called singular. The formula A⁻¹ = adj A ÷ det A would then need division by zero.

Should I use Cramer's rule or the matrix inverse to solve equations?

Both give the same answer when D ≠ 0. In MCQs Cramer's rule is usually quicker if only one unknown is asked, since you need just D and one more determinant. If D = 0 neither method works and the system has no solution or infinitely many.

Is det(A + B) equal to det A + det B?

No. Determinants behave well with products, det(AB) = det A × det B, but not with sums. A quick check with A = B = I₂ gives det(2I) = 4, while det I + det I = 2.