In this guide
← Maths AI guides

Number & algebra · AI HL

Matrices and simultaneous equations

Read matrix dimensions, multiply in the correct order, find inverses and use matrix equations to represent a linear system.

Course focus: AI HL · First-assessment-2021 course. The sections distinguish the mathematical idea, the calculation and its interpretation.

Before you start: Linear equations, arithmetic with negative numbers and ordered coordinates.

Start with a small example

Build it from the beginning

HL content

A matrix organises numbers into rows and columns. Multiplication forms each new entry by pairing a row with a column. For a transformation, a matrix can mix the input coordinates; multiplication order therefore matters.

A first walkthrough

Multiply \(A=\begin{pmatrix}2&1\\0&3\end{pmatrix}\) by the column vector \((4,2)\).

  1. The first row gives \(2(4)+1(2)=10\).
  2. The second row gives \(0(4)+3(2)=6\).
  3. The output vector is (10,6). It is not an element-by-element product.
Try the practice ladder after learning the methods ↓

The foundations behind the method

Understand what the symbols mean

A matrix can represent data or a transformation. Its interpretation comes from the meaning assigned to its rows and columns. A column vector records a state; multiplying it by a compatible matrix creates another state through weighted combinations. Dimensions act like a structural check before you calculate any entries.

How the ideas connect

Matrix multiplication is composition. With column vectors, AB means B acts first and A acts second. An inverse reverses a transformation only if distinct input directions remain distinguishable. This links algebraic determinants, geometric area changes and the existence of a unique solution to a linear system.

01

Start with the idea

Build your understanding

Dimensions

Rows count outputs and columns count compatible inputs when a matrix acts on a column vector.

Reversibility

A nonsingular square matrix preserves enough independent information to recover the input; singularity destroys uniqueness.

Compare the approaches

Choose by the information in the question, rather than the formula you recognise first.

Inverse method

When it helpsUse it for a square system with a verified nonzero determinant.

Check before using itA failed inversion does not tell you whether a system has no solutions or infinitely many.

Direct elimination

When it helpsUse equation operations to inspect dependencies or find a solution.

Check before using itPreserve all equations and avoid dividing by a possibly zero parameter without considering that case.

Your method plan

  1. Fix the variable and coefficient order.
  2. Check dimensions and whether the required inverse exists.
  3. Calculate, then recover the original right-hand side as a check.
02

Learn the methods

Learn step by step

1. A matrix records an organised operation

A matrix is an array with rows and columns. Its dimensions are rows by columns: a 2 by 3 matrix has six entries and can act on a three-component column vector to produce a two-component output. An entry \(a_{ij}\) identifies row i and column j. Before calculating, state what each row and column represents, especially in a contextual table. A matrix of prices and quantities needs compatible ordering, not just compatible dimensions.

2. Addition and scalar multiplication

Add matrices entry by entry only when their dimensions agree. Multiplication by a scalar scales every entry. A zero matrix has the relevant shape; it is not automatically interchangeable with the scalar zero in every expression. The identity matrix has ones on its diagonal and zeros elsewhere, and leaves a compatible vector unchanged. Subtraction reverses signs entry by entry. These operations are useful for combining data but should not be confused with matrix multiplication.

3. Multiplication is row against column

For \(AB\), the number of columns of A must equal the number of rows of B. Each output entry is a dot product: multiply corresponding entries of one row of A and one column of B, then add. The result has A’s row count and B’s column count. Matrix multiplication is generally not commutative: swapping order may give a different result or make the product undefined. Read an operation on column vectors from right to left.

Each matrix row produces one output

123421410×=First row: 1×2 + 2×1 = 4Second row: 3×2 + 4×1 = 10
The matrix with rows (1,2) and (3,4) acts on the column vector (2,1). Row-column sums give output (4,10). Matching two input entries to two columns is what makes this product defined.

Matrix product entry

Why this formula works

The jth column of B gives an intermediate vector for the jth input direction. Multiplication by A forms each output component from a weighted sum of that vector. This composition explains both row-column multiplication and the requirement that the inner dimensions agree.

The formula

\((AB)_{ij}=\sum_k a_{ik}b_{kj}\).

Quick example

\(\begin{pmatrix}1&2\\3&4\end{pmatrix}\begin{pmatrix}2\\1\end{pmatrix}=\begin{pmatrix}4\\10\end{pmatrix}\). Each row makes one weighted sum.

Worked example: Order is part of the operation

Compare AB and BA for \(A=\begin{pmatrix}1&1\\0&1\end{pmatrix}\) and \(B=\begin{pmatrix}2&0\\0&1\end{pmatrix}\).

  1. Row-column multiplication gives \(AB=\begin{pmatrix}2&1\\0&1\end{pmatrix}\).
  2. The reversed order gives \(BA=\begin{pmatrix}2&2\\0&1\end{pmatrix}\).
  3. The difference is in the top-right entry, so the matrices are not equal.
  4. Applied to (0,1), the first gives (1,1) and the second (2,1), providing a geometric check on noncommutativity.

4. Determinant and reversibility

For a square 2 by 2 matrix, the determinant is \(ad-bc\). A nonzero determinant means the transformation has an inverse and its two output directions do not collapse into one line. A zero determinant means unique reversal is impossible. The determinant’s magnitude gives an area scale factor for a planar linear transformation; its sign indicates orientation preservation or reversal. It does not directly give a length scale factor.

Two by two inverse

Why this formula works

Multiplying the original matrix by the numerator matrix gives the determinant times the identity: off-diagonal entries cancel and diagonal entries become ad-bc. Dividing by that nonzero determinant produces an operation that exactly undoes A. A zero determinant prevents this normalization.

The formula

\(A^{-1}=\frac1{ad-bc}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}\), for \(ad-bc\ne0\).

Quick example

For \(A=\begin{pmatrix}2&1\\1&1\end{pmatrix}\), the determinant is 1 and \(A^{-1}=\begin{pmatrix}1&-1\\-1&2\end{pmatrix}\).

5. Solve Ax=b

A system of linear equations becomes \(A\mathbf{x}=\mathbf{b}\) when coefficients, unknowns and constants are ordered consistently. If A is invertible, left-multiply by its inverse to get \(\mathbf{x}=A^{-1}\mathbf{b}\). Do not write division by A as scalar division. If A is singular, the system can be inconsistent or have infinitely many solutions; examine the original equations. Use a numerical matrix tool for larger systems, keeping the mathematical setup visible.

Worked example: Solve a resource system

Solve \(2x+y=7\) and \(x+y=4\) using matrix form.

  1. Write \(A=\begin{pmatrix}2&1\\1&1\end{pmatrix}\), \(\mathbf b=\begin{pmatrix}7\\4\end{pmatrix}\).
  2. The determinant is 1, so the inverse exists.
  3. Multiply: \(\mathbf x=\begin{pmatrix}1&-1\\-1&2\end{pmatrix}\begin{pmatrix}7\\4\end{pmatrix}=\begin{pmatrix}3\\1\end{pmatrix}\).
  4. Check: 2(3)+1=7 and 3+1=4. The unknown ordering must match the coefficient columns.
Worked example: Undo a diagonal transformation

Let \(A=\begin{pmatrix}2&0\\0&-1\end{pmatrix}\). Recover the input whose output is (6,−4).

  1. The determinant is −2, so A is invertible.
  2. Its inverse has diagonal entries \(1/2\) and −1.
  3. Apply the inverse to get \((3,4)^T\).
  4. Check the forward output: the first coordinate doubles and the second changes sign, producing (6,−4).

6. Check the interpretation and numerical stability

Substitute the solution into the original equations or multiply A by the reported solution to recover b. A small determinant relative to the scale of entries can warn that inversion is sensitive, but the bare determinant alone is not a scale-independent condition measure. Small input changes can then move the result substantially. Retain full precision during inversion. Units and row meanings tell you whether a negative or fractional solution is physically possible.

Quick formula reference

For revision once you understand the methods above. Check the conditions before using a formula.

Matrix product entry

\((AB)_{ij}=\sum_k a_{ik}b_{kj}\).

Return to the explanation →

Two by two inverse

\(A^{-1}=\frac1{ad-bc}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}\), for \(ad-bc\ne0\).

Return to the explanation →

Learn to diagnose an error

Spot the mistake

The statement below is incorrect. Identify the missing condition or reasoning before opening the explanation.

Incorrect reasoning

Because multiplication of numbers commutes, AB=BA for square matrices.

Explain and repair the mistake

Square dimensions allow both products but do not make them equal. Compute or interpret each order. A shear followed by a stretch changes coordinates differently from the stretch followed by the shear; the worked example gives a direct counterexample.

03

Connect and apply

Put the ideas together

A more demanding application of this guide’s methods. This is a learning stage; any additional HL content is labelled separately.

Worked application

A singular system needs a separate decision

Consider \(x+y=3\) and \(2x+2y=6\). What does a zero determinant mean here?

  1. The second coefficient row is twice the first, so the determinant is zero.
  2. Its constant is also twice the first constant; the second equation adds no restriction.
  3. Write \(y=t\), giving \(x=3-t\), with real t.
  4. This system has infinitely many solutions, not none. Replacing 6 by 7 would instead create a contradiction.
Pause and explain

What calculation distinguishes the two outcomes?

Check your reasoning

Compare the constants after applying the same row relation as the coefficients. A true identity is redundant; a false constant equality is inconsistent.

Common mistakes and how to avoid them

  • Square dimensions allow both products but do not make them equal. Compute or interpret each order. A shear followed by a stretch changes coordinates differently from the stretch followed by the shear; the worked example gives a direct counterexample.
  • A failed inversion does not tell you whether a system has no solutions or infinitely many.
  • Preserve all equations and avoid dividing by a possibly zero parameter without considering that case.
04

Practise independently

Build confidence, then apply it

Try each question before opening its hint or solution. If a method is new, return to the walkthrough, then try again. These learning stages describe the practice sequence; additional HL content is labelled separately.

  1. 1

    Build confidence

    HL extension

    Apply the same matrix to (1,3).

    Need a starting point?

    Take a row-column product for each output.

    Show the worked solution
    1. The outputs are \(2(1)+3=5\) and \(3(3)=9\).
    2. The image is (5,9).
  2. 2

    Apply and explain

    HL extension

    Find the determinant of A and decide whether it is invertible.

    Need a starting point?

    Use ad-bc for a 2 by 2 matrix.

    Show the worked solution
    1. \(\det A=2(3)-1(0)=6\).
    2. The nonzero determinant means A is invertible.
  3. 3

    Check your understanding

    Is \(\begin{pmatrix}1&2\\2&4\end{pmatrix}\) invertible?

    Show the worked solution

    No: its determinant is \(1(4)-2(2)=0\). Its rows are dependent. A linear system using it may have no solution or infinitely many; its constants must also be examined.

  4. 4

    Use the method

    What is the output shape when a 3 by 2 matrix multiplies a 2 by 4 matrix?

    Show the worked solution

    The product is 3 by 4: the matching inner dimension 2 makes multiplication possible, and the outer dimensions give the result. Reversing these two matrices is undefined because 4 does not match 3.

Finished? Use the linked question bank below to practise selecting the method without a guide telling you which rule to use.

Using these methods in exam questions

AI Paper 1

GDC required

Short-response questions still need mathematical setup and interpretation. Choose the correct tool, enter the model or data carefully, and check units and rounding.

AI Paper 2

GDC required

Extended-response questions connect several steps. Keep intermediate values at full precision and explain how each result answers the context.

For this topic: Keep algebraic transformations visible. State restrictions before cancelling or taking logarithms, and check whether the question needs an exact expression or a rounded value.

HL only · GDC required

Paper 3: build a connected argument

Both AA HL and AI HL Paper 3 contain two extended problem-solving questions. A question develops a theme, so keep useful earlier results, test small cases and explain any proposed general rule. A calculator pattern can suggest a result; your mathematical reasoning must support it.

  1. Identify what the first part establishes and record the conditions under which it holds.
  2. When a later part introduces a new definition or model, connect it to methods you already know rather than assuming a new formula must have been memorised.
  3. Check the conclusion against an earlier numerical case and explain its meaning or limitation.

For the first-assessment-2021 courses. IB assessment reference ↗

Find a specific method or formula

Now practise the method

If you opened this guide from a question, return to that tab and try the method without looking at the example. Your answer stays in the question tab.

Practise this subtopic →

Want a broader practice session? Explore IB Maths AI HL practice questions →Try free IB Maths exam-style questions and worked solutions →

Original Arc Practice teaching notes for Maths AI. Core and HL sections are distinguished above. These notes follow the first-assessment-2021 course and are not an official IB publication or a complete syllabus checklist. IB course reference. Report a correction.