Index Ai Academy
Foundation · Foundation mathTransposition of formulas

Matrix equations: multiply by the inverse, on the correct side

About 40 minLooking ahead: some prerequisites aren't done yet

Why this matters

There's no dividing by a matrix. To free X from AX = B, you multiply both sides by A⁻¹, the matrix that undoes A. Since AB and BA are usually different, A⁻¹ has to go on the same side as A. You'll use that move on systems, the eigenvalue equation, a model's best weights and a layer run backward, and check its conditions each time.

  • Free X from AX = B or XA = B by multiplying by A⁻¹ on the side where A is, and show that the other side gives a wrong answer
  • Undo sums and number multiples as usual, and flip the order to undo a product: (AB)⁻¹ = B⁻¹A⁻¹ and (AB)ᵀ = BᵀAᵀ
  • State the conditions: a square matrix, a determinant that isn't 0, and shapes that fit
  • Rearrange Ax = λx into det(A − λI) = 0, and say why that determinant must be 0
  • Solve with np.linalg.solve, check with np.allclose, and turn around the normal equations and a linear layer
Quick check
Have a guess before you start. For numbers, 3x = 12 gives x = 12 ÷ 3. For 2 × 2 matrices, AX = B. What is X?

The math: undo a matrix from the side it's on

Purpose. Free an unknown matrix or vector from a matrix equation, and know when you can.

The inverse A⁻¹ undoes A: A⁻¹A = AA⁻¹ = I (lesson 59). The identity I changes nothing: IX = X (lesson 57). And order matters: AB and BA are usually different (lesson 56).

So there's no dividing by a matrix: "B ÷ A" could mean A⁻¹B or BA⁻¹. Instead, multiply both sides by A⁻¹, on the side where A is:

EquationX on its own
A + X = BX = B − A: take A away
kX = BX = B/k: divide by the number k (k not 0)
AX = BX = A⁻¹B: A⁻¹ on the left, where A is
XA = BX = BA⁻¹: A⁻¹ on the right, where A is
Xᵀ = BX = Bᵀ: transpose both sides

On A's side, A⁻¹ meets A and cancels it: A⁻¹AX = IX = X. On the far side, the two never meet.