Day 14 — Systems of linear equations (\(2 imes 2\))

Updated

July 30, 2026

Day 14 — Systems of linear equations (\(2\times 2\))

Stage II · concept day
Goal: Solve \(2\times 2\) systems by substitution and elimination; classify unique / none / infinitely many solutions geometrically; use determinant \(ad-bc\); write matrix form \(Ax=b\); apply Cramer’s rule; invert a \(2\times 2\) matrix when \(\det\neq 0\).

Why this matters

Two constraints and two unknowns appear in balancing, circuit equations (idealized), and parameter fitting of lines. Matrices are the language of computer graphics transforms, linear models, and later numerical linear algebra. Determinant zero is “singular / non-invertible.”

Theory

Standard form

A general \(2\times 2\) linear system: \[ \begin{cases} a_{11}x+a_{12}y=b_1\\ a_{21}x+a_{22}y=b_2 \end{cases} \]

Geometric picture

Each equation \(ax+by=c\) (with \((a,b)\neq(0,0)\)) is a line in the plane.

Configuration Solutions
Two lines intersect at one point Unique solution
Parallel distinct lines No solution (inconsistent)
Same line (coincident) Infinitely many solutions

Substitution method

Solve one equation for one variable; substitute into the other; back-substitute.

Elimination method

Multiply equations by constants so that adding/subtracting cancels one variable.

Determinant

For matrix \[A=\begin{pmatrix}a&b\\ c&d\end{pmatrix},\] define \[\det(A)=ad-bc.\]

Theorem (classification via determinant). For the system \(Ax=b\) with \[A=\begin{pmatrix}a&b\\ c&d\end{pmatrix},\quad x=\begin{pmatrix}x\\ y\end{pmatrix},\quad b=\begin{pmatrix}e\\ f\end{pmatrix} \] (using \(e,f\) as RHS):

  • If \(\det(A)\neq 0\), unique solution.
  • If \(\det(A)=0\), either no solution or infinitely many (need further check: whether equations are consistent).

Intuition: \(\det=0\) means rows are scalar multiples (lines parallel or coincident).

Matrix form \(Ax=b\)

Matrix-vector product for \(2\times 2\): \[ \begin{pmatrix}a&b\\ c&d\end{pmatrix} \begin{pmatrix}x\\ y\end{pmatrix} = \begin{pmatrix}ax+by\\ cx+dy\end{pmatrix}. \]

The system is exactly \(Ax=b\).

Cramer’s rule (\(2\times 2\))

If \(\Delta=\det(A)=ad-bc\neq 0\), then \[ x=\frac{\det\begin{pmatrix}e&b\\ f&d\end{pmatrix}}{\Delta}=\frac{ed-bf}{\Delta},\qquad y=\frac{\det\begin{pmatrix}a&e\\ c&f\end{pmatrix}}{\Delta}=\frac{af-ec}{\Delta}. \]

Proof sketch. Solve by elimination algebraically; the formulas match. Or note \(A\,\mathrm{adj}(A)=\det(A)I\) for the adjugate below.

Inverse of a \(2\times 2\) matrix

If \(\Delta=ad-bc\neq 0\), then \[ A^{-1}=\frac{1}{\Delta}\begin{pmatrix}d&-b\\ -c&a\end{pmatrix}. \]

Check: \(A A^{-1}=I=\begin{pmatrix}1&0\\ 0&1\end{pmatrix}\).

Solution via inverse: if \(A\) invertible, \(x=A^{-1}b\).

Theorem. \(A\) is invertible iff \(\det(A)\neq 0\).

Infinite / no solution algebraically

If both equations become \(0=0\) after reduction: infinite (parameterize, e.g. free \(t\), \(x=t\), \(y=\ldots\)).
If \(0=1\) appears: inconsistent, no solution.

Worked examples

Example 1 — Elimination

\(\begin{cases}x+y=5\\ 2x-y=4\end{cases}\). Add: \(3x=9\), \(x=3\), \(y=2\).

Example 2 — Substitution

\(\begin{cases}y=2x+1\\ 3x+2y=20\end{cases}\). \(3x+2(2x+1)=20\). \(7x+2=20\). \(x=\frac{18}{7}\), \(y=\frac{43}{7}\).

Example 3 — Determinant unique

\(A=\begin{pmatrix}2&1\\ 5&3\end{pmatrix}\), \(\det=6-5=1\neq 0\). Unique for any RHS.

Example 4 — Cramer

\(\begin{cases}2x+y=5\\ 5x+3y=13\end{cases}\). \(\Delta=1\), \(x=\det\begin{pmatrix}5&1\\13&3\end{pmatrix}=15-13=2\), \(y=\det\begin{pmatrix}2&5\\5&13\end{pmatrix}=26-25=1\).

Example 5 — Inverse

\(A=\begin{pmatrix}2&1\\5&3\end{pmatrix}\), \(A^{-1}=\begin{pmatrix}3&-1\\ -5&2\end{pmatrix}\).
Check: \(2\cdot 3+1\cdot(-5)=1\), etc.

Example 6 — Solve via inverse

\(b=\begin{pmatrix}5\\13\end{pmatrix}\), \(x=A^{-1}b=\begin{pmatrix}3\cdot5+(-1)\cdot13\\ -5\cdot5+2\cdot13\end{pmatrix}=\begin{pmatrix}2\\1\end{pmatrix}\).

Example 7 — No solution

\(\begin{cases}x+y=1\\ 2x+2y=3\end{cases}\). \(\det=0\). Second is not multiple of first with same RHS ratio. \(2(x+y)=2\neq 3\). Empty.

Example 8 — Infinite

\(\begin{cases}x+y=1\\ 2x+2y=2\end{cases}\). Second \(=2\times\) first. Solutions: \(y=1-x\), \(x=t\) free.

Example 9 — Geometry

\(x-y=0\) and \(x+y=2\) intersect at \((1,1)\). Parallel: \(x+y=1\), \(x+y=2\).

Example 10 — Word system

\(3\) apples + \(2\) bananas \(= \$7\); \(1\) apple + \(4\) bananas \(=\$6\).
\(\begin{cases}3a+2b=7\\ a+4b=6\end{cases}\). From second \(a=6-4b\). \(3(6-4b)+2b=7\). \(18-12b+2b=7\). \(-10b=-11\). \(b=\frac{11}{10}\), \(a=\frac{8}{5}\)? Check carefully: \(18-10b=7\), \(-10b=-11\), \(b=1.1\), \(a=6-4.4=1.6\).

Example 11 — Matrix multiply

\(\begin{pmatrix}1&2\\ 3&4\end{pmatrix}\begin{pmatrix}5\\6\end{pmatrix}=\begin{pmatrix}17\\39\end{pmatrix}\).

Example 12 — det zero rows proportional

\(\begin{pmatrix}2&4\\ 1&2\end{pmatrix}\), \(\det=0\), row2 \(=\frac{1}{2}\) row1.

Example 13 — Parameter

For \(\begin{cases}x+ky=1\\ kx+y=1\end{cases}\), \(\Delta=1-k^2\). Unique if \(k\neq\pm 1\). If \(k=1\): equations \(x+y=1\) twice → infinite. If \(k=-1\): \(x-y=1\) and \(-x+y=1\) i.e. \(x-y=1\) and \(x-y=-1\) → empty.

Example 14 — Verify inverse formula

\(A A^{-1}=\frac{1}{\Delta}\begin{pmatrix}a&b\\c&d\end{pmatrix}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}=\frac{1}{\Delta}\begin{pmatrix}ad-bc&0\\0&ad-bc\end{pmatrix}=I\).

Exercises

Easy

  1. Solve \(\begin{cases}x+y=4\\ x-y=2\end{cases}\) by elimination.
  2. Solve \(\begin{cases}y=3x\\ 2x+y=10\end{cases}\) by substitution.
  3. Compute \(\det\begin{pmatrix}3&1\\ 4&2\end{pmatrix}\).
  4. Write \(\begin{cases}2x-y=3\\ x+4y=1\end{cases}\) as \(Ax=b\).
  5. How many solutions geometrically if two lines are parallel and distinct?

Medium

  1. Solve by Cramer: \(\begin{cases}3x+2y=7\\ x-y=1\end{cases}\).
  2. Find \(A^{-1}\) for \(A=\begin{pmatrix}1&2\\ 3&5\end{pmatrix}\); solve \(Ax=\begin{pmatrix}1\\1\end{pmatrix}\).
  3. Classify and solve: \(\begin{cases}2x+6y=4\\ x+3y=1\end{cases}\).
  4. Classify and solve: \(\begin{cases}2x+6y=4\\ x+3y=2\end{cases}\).
  5. Word: adult tickets \(\$12\), child \(\$5\); \(10\) tickets total cost \(\$78\). How many of each?
  6. Compute \(\begin{pmatrix}0&1\\ 1&0\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}\) and interpret.
  7. For which \(h\) does \(\begin{cases}x+2y=3\\ 2x+hy=6\end{cases}\) have infinite solutions? None? Unique?
  8. Verify Cramer’s formulas by solving Example 4 with elimination.

Hard / proof

  1. Prove that if \(\det(A)\neq 0\), the inverse formula works (\(AA^{-1}=I\)).
  2. Prove: if two lines \(a_1x+b_1y=c_1\) and \(a_2x+b_2y=c_2\) have \(\det\begin{pmatrix}a_1&b_1\\a_2&b_2\end{pmatrix}\neq 0\), they intersect in exactly one point.
  3. Show that row swap multiplies determinant by \(-1\) for \(2\times 2\).
  4. Show \(\det(AB)=\det(A)\det(B)\) for \(2\times 2\) by direct expansion (tedious but finite).
  5. Parameterize all solutions when the system reduces to a single independent equation.
  6. Prove: if \(A\) is invertible and \(Ax=b\), then \(x\) is unique.
  7. Explain why division by \(\det=0\) makes Cramer inapplicable; connect to geometry.

Challenge / CS-flavored

  1. Graphics: \(2\times 2\) scale matrix \(\begin{pmatrix}s&0\\0&t\end{pmatrix}\) applied to \(\begin{pmatrix}x\\y\end{pmatrix}\). Invert if \(s,t\neq 0\).
  2. Linear interpolation constraints: find line through \((0,1)\) and \((2,5)\) by solving system for \(y=mx+c\).
  3. Homogeneous \(Ax=0\) with \(\det\neq 0\): only solution \(x=0\). Why?
  4. Numerical: if \(\det\) is tiny, small RHS noise can swing solutions—conditioning link to Day 9.
  5. Count operations: elimination vs Cramer for \(2\times 2\) (both \(O(1)\); contrast large \(n\) later).

Row operations and equivalence

Elementary operations on the augmented matrix \([A|b]\):

  1. Swap equations
  2. Multiply an equation by nonzero constant
  3. Add multiple of one equation to another

These preserve the solution set. Elimination is systematic row reduction for \(2\times 2\).

Homogeneous systems

\(Ax=0\) always has at least the trivial solution \(x=0\).
If \(\det A\neq 0\), only trivial. If \(\det A=0\), nontrivial solutions exist (free variables).

Geometry of \(\det\)

\(|\det A|\) is the area of the parallelogram spanned by the column vectors of \(A\).
\(\det=0\) means columns are linearly dependent (parallel vectors).

Inverse properties

  • \((A^{-1})^{-1}=A\)
  • \((AB)^{-1}=B^{-1}A^{-1}\) when both invertible
  • \(\det(A^{-1})=1/\det(A)\)

Extra exercises

  1. Solve by row reduction the system \(3x+y=5\), \(2x-y=0\).
  2. For \(A=\begin{pmatrix}a&b\\c&d\end{pmatrix}\), show \(A\,\mathrm{adj}(A)=(\det A)I\) with \(\mathrm{adj}=\begin{pmatrix}d&-b\\-c&a\end{pmatrix}\).
  3. Find all \(k\) so \(\begin{cases}kx+y=1\\ x+ky=1\end{cases}\) has unique / none / infinite solutions.
  4. Interpret \(\begin{pmatrix}\cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\end{pmatrix}\) as rotation; compute \(\det\).
  5. Show that if \(Ax=b\) and \(Ax=c\) both have solutions and \(A\) is invertible, then \(b=c\) whenever \(x\) is the same—tautological check of uniqueness.

CS connection

Matrices encode linear transforms; invertibility means reversible transforms. Systems appear in constraint layouts, simple physics engines, and least squares (overdetermined later). Singular matrices cause solver failures—check \(\det\) or rank.

Common pitfalls

Pitfall What to do instead
Arithmetic sign errors in elimination Multiply carefully; check in both equations
Declaring no solution when \(\det=0\) always Distinguish parallel vs coincident
Wrong inverse signs \(\begin{pmatrix}d&-b\\-c&a\end{pmatrix}/\Delta\)
Cramer when \(\Delta=0\) Use geometry / reduction cases
Forgetting to verify Plug \((x,y)\) into both originals
Mixing row vectors / column vectors Stick to \(Ax=b\) column convention

Fully worked extra examples

E15 — Full Cramer with numbers.
\(\begin{cases}4x+y=6\\ -x+2y=7\end{cases}\). \(\Delta=8-(-1)=9\).
\(x=\frac{\det\begin{pmatrix}6&1\\7&2\end{pmatrix}}{9}=\frac{12-7}{9}=\frac59\).
\(y=\frac{\det\begin{pmatrix}4&6\\ -1&7\end{pmatrix}}{9}=\frac{28-(-6)}{9}=\frac{34}{9}\).

E16 — Inverse multiply.
\(A=\begin{pmatrix}4&1\\ -1&2\end{pmatrix}\), \(\Delta=9\), \(A^{-1}=\frac19\begin{pmatrix}2&-1\\ 1&4\end{pmatrix}\).
\(x=A^{-1}\begin{pmatrix}6\\7\end{pmatrix}=\frac19\begin{pmatrix}12-7\\ 6+28\end{pmatrix}=\begin{pmatrix}5/9\\ 34/9\end{pmatrix}\).

E17 — Infinite family parameter.
\(x+2y=4\) only constraint: \(x=4-2t\), \(y=t\), \(t\in\mathbb{R}\).

E18 — Inconsistent detection.
After elimination: \(0x+0y=5\) appears → empty set immediately.

End-of-day synthesis problems

S1. Solve \(\begin{cases}3x-y=7\\ 2x+3y=1\end{cases}\) by elimination, Cramer, and inverse; compare.

S2. For \(A=\begin{pmatrix}1&2\\ 2&4\end{pmatrix}\) and \(b=\begin{pmatrix}3\\ 6\end{pmatrix}\) vs \(b=\begin{pmatrix}3\\ 5\end{pmatrix}\), classify systems.

S3. Prove \(AA^{-1}=I\) for the general \(2\times 2\) inverse formula when \(\Delta\neq 0\).

S4. Geometry: sketch \(x+y=2\) and \(x+y=3\); conclude solution count.

S5. Word: \(2\) coffees \(+1\) muffin \(=\$7\); \(1\) coffee \(+2\) muffins \(=\$8\). Prices?

S6. Compute \(\det\begin{pmatrix}0&-1\\ 1&0\end{pmatrix}\) and inverse (rotation by \(90^{\circ}\) idea).

S7. Homogeneous \(\begin{cases}x+2y=0\\ 3x+6y=0\end{cases}\): all solutions.

S8. Parameter \(t\): \(\begin{cases}x+ty=1\\ tx+y=1\end{cases}\) solution cases.

Checkpoint

  • Solve \(2\times 2\) by substitution and elimination
  • Classify \(1\) / \(0\) / \(\infty\) solutions with geometry and algebra
  • Compute \(\det\); write \(Ax=b\)
  • Apply Cramer’s rule when \(\det\neq 0\)
  • Invert a \(2\times 2\) matrix and use \(x=A^{-1}b\)
  • One system solved three independent ways (S1)

Write two takeaways in your own words.

Deep dive — \(2\times 2\) systems, det, inverse, Cramer

D1 — One system three ways.
\(\begin{cases}3x-y=7\\ 2x+3y=1\end{cases}\).
Elimination: multiply first by \(3\): \(9x-3y=21\); add to second: \(11x=22\), \(x=2\), then \(y=-1\).
\(\Delta=\det\begin{pmatrix}3&-1\\2&3\end{pmatrix}=9-(-2)=11\).
Cramer: \(x=\frac{\det\begin{pmatrix}7&-1\\1&3\end{pmatrix}}{11}=\frac{21-(-1)}{11}=2\), \(y=\frac{\det\begin{pmatrix}3&7\\2&1\end{pmatrix}}{11}=\frac{3-14}{11}=-1\).
Inverse: \(A^{-1}=\frac{1}{11}\begin{pmatrix}3&1\\ -2&3\end{pmatrix}\), \(A^{-1}\begin{pmatrix}7\\1\end{pmatrix}=\begin{pmatrix}2\\ -1\end{pmatrix}\).

D2 — det zero: infinite vs empty.
\(A=\begin{pmatrix}1&2\\2&4\end{pmatrix}\), \(\det=0\).
With \(b=\begin{pmatrix}3\\6\end{pmatrix}\): second equation is \(2\times\) first → infinite, \(x=3-2t\), \(y=t\).
With \(b=\begin{pmatrix}3\\5\end{pmatrix}\): \(2\times\) left of first is \(6\neq 5\) → inconsistent, empty.

D3 — Parameter family.
\(\begin{cases}x+ty=1\\ tx+y=1\end{cases}\), \(\Delta=1-t^{2}\).
Unique if \(t\neq\pm 1\). If \(t=1\): both \(x+y=1\) → infinite. If \(t=-1\): \(x-y=1\) and \(-x+y=1\)\(x-y=-1\) contradicts → empty.

D4 — Homogeneous.
\(Ax=0\) always has \(x=0\). If \(\det A\neq 0\), only trivial. If \(\det A=0\), a free variable appears (nontrivial kernel in \(2\)D).

D5 — Geometry of det.
\(|\det A|\) = area of parallelogram from column vectors. \(\det=0\) ⇔ columns parallel ⇔ lines normal vectors proportional ⇔ parallel/coincident lines.

D6 — Word system.
\(2\) coffees + \(1\) muffin \(=\$7\); \(1\) coffee + \(2\) muffins \(=\$8\):
\(\begin{cases}2c+m=7\\ c+2m=8\end{cases}\). From second \(c=8-2m\): \(2(8-2m)+m=7\), \(16-4m+m=7\), \(-3m=-9\), \(m=3\), \(c=2\).

Extra practice set

  1. Invert \(A=\begin{pmatrix}4&1\\ -1&2\end{pmatrix}\) and solve \(Ax=\begin{pmatrix}6\\7\end{pmatrix}\).
  2. Show \(A\,\mathrm{adj}(A)=(\det A)I\) for general \(2\times 2\).
  3. Classify \(\begin{cases}kx+y=1\\ x+ky=1\end{cases}\) for all real \(k\).
  4. Rotation matrix \(\begin{pmatrix}\cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\end{pmatrix}\): compute \(\det\).
  5. Prove: if \(A\) is invertible then \(Ax=b\) has exactly one solution.

Tomorrow

Day 15 — Polynomials. Degree, leading coefficient, arithmetic, evaluation, Horner, roots vs factors preview, long division lite.