For A = [[2, 1], [0, 3]] and B = [[4, 2], [5, 1]], the first entry of AB is:
2 × 4 + 1 × 5 = 13.
To find (AB)ᵢⱼ, use row i of A and column j of B. Multiply matching entries, then add: (AB)ᵢⱼ = Σₖ₌₁ⁿ AᵢₖBₖⱼ. The n columns of A must match the n rows of B. Keep the order AB.
Undo a two-by-two matrix
For A = [[1, 2], [3, 7]], the determinant is 1 × 7 − 2 × 3 = 1.
A⁻¹ = [[7, −2], [−3, 1]].
For A = [[a, b], [c, d]], use A⁻¹ = [[d, −b], [−c, a]]/(ad − bc). Swap the diagonal entries, change the signs of the other two, then divide every entry by the determinant. This works only when ad − bc ≠ 0. A zero determinant means there is no inverse.
Subtract the diagonal products
For A = [[2, 1], [3, 6]]:
det(A) = 2 × 6 − 1 × 3 = 9.
For rows (a, b) and (c, d), the rule is det(A) = ad − bc. Multiply down the main diagonal, then subtract the other diagonal’s product. Keep each entry’s sign when multiplying. The determinant can be negative or zero.
Try a few examples
Real practice. Real progress.
Example 1 of 3
complete the matrix product entry formula
A and B have conformable finite dimensions and k indexes their shared dimension from 1 through n.