Systems, Matrices, and Determinants

Study Sheet

Systems, Matrices, and Determinants

Substitution, elimination, Gaussian elimination, matrix algebra, inverses, determinants, Cramer's Rule, partial fractions, and linear programming

Solving Systems by Substitution and Elimination

Concept
The idea

A solution of a system is an ordered pair (or triple) that satisfies every equation at once. Two main hand methods:

  • [leftmargin=5mm,itemsep=1pt]
  • Substitution: solve one equation for a variable, then plug into the other. Best when a variable already has coefficient 11, or for nonlinear systems.
  • Elimination: add multiples of the equations to cancel a variable. Best for linear systems with awkward coefficients.

A linear system may have one solution (lines cross), no solution (parallel lines; you reach a false statement like 0=50=5), or infinitely many (same line; you reach a true statement like 0=00=0). A nonlinear system (line and circle, two conics, …) can have 0,1,2,0,1,2, or more solutions.

Example
Elimination (linear)

Solve {3x+2y=162x5y=2\begin{cases} 3x+2y=16 \\ 2x-5y=-2 \end{cases}

Multiply eq. 1 by 55 and eq. 2 by 22 to cancel yy:

15x+10y=80,4x10y=4.15x+10y=80, \qquad 4x-10y=-4.

Add: 19x=76x=419x=76 \Rightarrow x=4. Back-substitute into eq. 1: 12+2y=16y=212+2y=16 \Rightarrow y=2.

Check: 2(4)5(2)=810=22(4)-5(2)=8-10=-2. ✓  Solution: (4,2)(4,2).

Example
Substitution (nonlinear: line meets circle)

Solve {x2+y2=25y=x+1\begin{cases} x^2+y^2=25 \\ y=x+1 \end{cases}

Substitute y=x+1y=x+1: x2+(x+1)2=252x2+2x24=0x2+x12=0x^2+(x+1)^2=25 \Rightarrow 2x^2+2x-24=0 \Rightarrow x^2+x-12=0.

Factor: (x+4)(x3)=0x=4(x+4)(x-3)=0 \Rightarrow x=-4 or x=3x=3, giving y=3y=-3 or y=4y=4.

Solutions: (4,3)(-4,-3) and (3,4)(3,4). Check (3,4)(3,4): 9+16=259+16=25. ✓

Tip

Tip: After finding a variable, always back-substitute into the original equation and verify both. For nonlinear systems, each xx must be paired with the yy from the equation you substituted into.

Three-Variable Linear Systems: Gaussian Elimination

Concept
Row-echelon form

Write the system as an augmented matrix and use elementary row operations to reach row-echelon form (leading 11's stepping to the right, zeros below), then back-substitute.

  • [leftmargin=5mm,itemsep=1pt]
  • Swap two rows: RiRjR_i \leftrightarrow R_j.
  • Scale a row: RikRiR_i \to kR_i (k0k\neq 0).
  • Add a multiple of one row to another: RiRi+kRjR_i \to R_i + kR_j.

Reduced row-echelon form additionally clears entries above each leading 11 (Gauss--Jordan).

Example
Full Gaussian elimination

Solve {x+y+z=62xy+z=3x+2yz=2\begin{cases} x+y+z=6 \\ 2x-y+z=3 \\ x+2y-z=2 \end{cases}

Augmented matrix, then eliminate below the first pivot with R2R22R1R_2\to R_2-2R_1 and R3R3R1R_3\to R_3-R_1:

[111621131212]    [111603190124].\begin{bmatrix} 1 & 1 & 1 & 6 \\ 2 & -1 & 1 & 3 \\ 1 & 2 & -1 & 2 \end{bmatrix} \;\longrightarrow\; \begin{bmatrix} 1 & 1 & 1 & 6 \\ 0 & -3 & -1 & -9 \\ 0 & 1 & -2 & -4 \end{bmatrix}.

Swap R2R3R_2\leftrightarrow R_3, then R3R3+3R2R_3\to R_3+3R_2:

[1116012400721].\begin{bmatrix} 1 & 1 & 1 & 6 \\ 0 & 1 & -2 & -4 \\ 0 & 0 & -7 & -21 \end{bmatrix}.

Back-substitute: 7z=21z=3-7z=-21\Rightarrow z=3; y2(3)=4y=2y-2(3)=-4\Rightarrow y=2; x+2+3=6x=1x+2+3=6\Rightarrow x=1.

Check in eq. 2: 2(1)2+3=32(1)-2+3=3. ✓  Solution: (1,2,3)(1,2,3).

Tip

Tip: A row of the form [0 0 0c][\,0\ 0\ 0 \mid c\,] with c0c\neq 0 means no solution. A row [0 0 00][\,0\ 0\ 0 \mid 0\,] means a free variable and infinitely many solutions.

Matrices and Their Operations

Concept
Adding, scaling, multiplying

For matrices of the same size, add/subtract entrywise; scalar multiply multiplies every entry.

Matrix product ABAB is defined only when AA is m×nm\times n and BB is n×pn\times p (inner dimensions match); the result is m×pm\times p. Entry (i,j)(i,j) of ABAB is the dot product of row ii of AA with column jj of BB. In general ABBAAB\neq BA.

Example
Combined operations and a product

Let A=[1201]A=\begin{bmatrix} 1 & 2 \\ 0 & -1 \end{bmatrix}, B=[3124]B=\begin{bmatrix} 3 & 1 \\ -2 & 4 \end{bmatrix}.

2AB=[2402][3124]=[1326]2A-B=\begin{bmatrix} 2 & 4 \\ 0 & -2 \end{bmatrix}-\begin{bmatrix} 3 & 1 \\ -2 & 4 \end{bmatrix}=\begin{bmatrix} -1 & 3 \\ 2 & -6 \end{bmatrix}.

AB=[1(3)+2(2)1(1)+2(4)0(3)+(1)(2)0(1)+(1)(4)]=[1924]AB=\begin{bmatrix} 1(3)+2(-2) & 1(1)+2(4) \\ 0(3)+(-1)(-2) & 0(1)+(-1)(4) \end{bmatrix}=\begin{bmatrix} -1 & 9 \\ 2 & -4 \end{bmatrix}.

Tip

Tip: Check dimensions before multiplying: (m×n)(n×p)=(m×p)(m\times n)(n\times p)=(m\times p). If the inner numbers differ, the product does not exist.

The Inverse of a Matrix

Concept
Inverses

A1A^{-1} satisfies AA1=A1A=IAA^{-1}=A^{-1}A=I. For a 2×22\times2 matrix

A=[abcd],A1=1adbc[dbca],A=\begin{bmatrix} a & b \\ c & d \end{bmatrix},\qquad A^{-1}=\frac{1}{ad-bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix},

provided detA=adbc0\det A = ad-bc \neq 0. If detA=0\det A=0 the matrix is singular (no inverse). To solve Ax=bA\mathbf{x}=\mathbf{b}, use x=A1b\mathbf{x}=A^{-1}\mathbf{b}.

Example
Find a 2×22\times2 inverse and solve a system

Solve {2x+3y=7x+4y=6\begin{cases} 2x+3y=7 \\ x+4y=6 \end{cases} using an inverse.

Coefficient matrix A=[2314]A=\begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix}, detA=2(4)3(1)=5\det A=2(4)-3(1)=5.

A1=15[4312].A^{-1}=\frac{1}{5}\begin{bmatrix} 4 & -3 \\ -1 & 2 \end{bmatrix}.

Then x=A1b=15[4312][76]=15[28187+12]=15[105]=[21]\mathbf{x}=A^{-1}\mathbf{b}=\frac{1}{5}\begin{bmatrix} 4 & -3 \\ -1 & 2 \end{bmatrix}\begin{bmatrix} 7 \\ 6 \end{bmatrix}=\frac{1}{5}\begin{bmatrix} 28-18 \\ -7+12 \end{bmatrix}=\frac{1}{5}\begin{bmatrix} 10 \\ 5 \end{bmatrix}=\begin{bmatrix} 2 \\ 1 \end{bmatrix}.

Check: 2(2)+3(1)=72(2)+3(1)=7 and 2+4(1)=62+4(1)=6. ✓  Solution (2,1)(2,1).

Tip

Tip: Verify an inverse cheaply by confirming AA1=IAA^{-1}=I, or at least that detAdet(A1)=1\det A \cdot \det(A^{-1})=1.

Determinants and Cramer's Rule

Concept
Determinants

2×22\times2: det[abcd]=adbc\det\begin{bmatrix} a & b \\ c & d \end{bmatrix}=ad-bc.

3×33\times3 (expansion along row 1):

det[abcdefghi]=a(eifh)b(difg)+c(dheg).\det\begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix}=a(ei-fh)-b(di-fg)+c(dh-eg).

Cramer's Rule: for Ax=bA\mathbf{x}=\mathbf{b} with D=detA0D=\det A\neq0, each variable is xk=Dk/Dx_k=D_k/D, where DkD_k replaces column kk of AA with b\mathbf{b}.

Example
3×33\times3 determinant and Cramer's Rule

Solve {x+y+z=62xy+z=3x+2yz=2\begin{cases} x+y+z=6 \\ 2x-y+z=3 \\ x+2y-z=2 \end{cases} for xx by Cramer.

D=det[111211121]=1(12)1(21)+1(4+1)=1+3+5=7D=\det\begin{bmatrix} 1&1&1\\2&-1&1\\1&2&-1\end{bmatrix}=1(1-2)-1(-2-1)+1(4+1)=-1+3+5=7.

Dx=det[611311221]=6(12)1(32)+1(6+2)=6+5+8=7D_x=\det\begin{bmatrix} 6&1&1\\3&-1&1\\2&2&-1\end{bmatrix}=6(1-2)-1(-3-2)+1(6+2)=-6+5+8=7.

So x=Dx/D=7/7=1x=D_x/D=7/7=1 (matching the Gaussian result above).

Tip

Tip: Remember the alternating +++\,-\,+ sign pattern across the top row. If D=0D=0, Cramer's Rule fails---the system has either no solution or infinitely many.

Partial Fraction Decomposition

Concept
Breaking a rational function apart

For a proper fraction (numerator degree << denominator degree), factor the denominator and write one term per factor:

  • [leftmargin=5mm,itemsep=1pt]
  • Distinct linear (ax+b)(ax+b): term Aax+b\dfrac{A}{ax+b}.
  • Repeated linear (ax+b)2(ax+b)^2: terms Aax+b+B(ax+b)2\dfrac{A}{ax+b}+\dfrac{B}{(ax+b)^2}.
  • Irreducible quadratic (ax2+bx+c)(ax^2+bx+c): term Ax+Bax2+bx+c\dfrac{Ax+B}{ax^2+bx+c}.

If improper, do polynomial division first. Solve for the constants by clearing denominators.

Example
Full partial-fraction decomposition

Decompose 5x1x2x2\dfrac{5x-1}{x^2-x-2}.

Factor: x2x2=(x2)(x+1)x^2-x-2=(x-2)(x+1). Write 5x1(x2)(x+1)=Ax2+Bx+1\dfrac{5x-1}{(x-2)(x+1)}=\dfrac{A}{x-2}+\dfrac{B}{x+1}.

Clear: 5x1=A(x+1)+B(x2)5x-1=A(x+1)+B(x-2). Let x=2x=2: 9=3AA=39=3A\Rightarrow A=3. Let x=1x=-1: 6=3BB=2-6=-3B\Rightarrow B=2.

5x1x2x2=3x2+2x+1.\frac{5x-1}{x^2-x-2}=\frac{3}{x-2}+\frac{2}{x+1}.

Check: 3(x+1)+2(x2)(x2)(x+1)=5x1(x2)(x+1)\dfrac{3(x+1)+2(x-2)}{(x-2)(x+1)}=\dfrac{5x-1}{(x-2)(x+1)}. ✓

Tip

Tip: Substituting the roots of the factors instantly isolates constants. For repeated or quadratic factors, also compare coefficients of like powers.

Systems of Inequalities and Linear Programming

Concept
Feasible regions and optimization

Graph each inequality and shade the overlap---the feasible region. In linear programming you maximize or minimize a linear objective z=ax+byz=ax+by over that region. The optimum (if it exists) always occurs at a corner (vertex), so evaluate zz at every vertex and pick the best.

Example
Linear-programming optimization

Maximize z=3x+2yz=3x+2y subject to x0, y0, x+y4, x+3y6x\ge0,\ y\ge0,\ x+y\le4,\ x+3y\le6.

Vertices: (0,0),(4,0),(3,1),(0,2)(0,0),(4,0),(3,1),(0,2). The lines cross at x+y=4, x+3y=6y=1, x=3x+y=4,\ x+3y=6\Rightarrow y=1,\ x=3.

z(0,0)=0,z(4,0)=12,z(3,1)=11,z(0,2)=4.z(0,0)=0,\quad z(4,0)=12,\quad z(3,1)=11,\quad z(0,2)=4.

Maximum z=12z=12 at (4,0)(4,0).

Tip

Tip: Always list the vertices explicitly---including where two boundary lines intersect---then test each. A bounded feasible region guarantees both a max and a min exist.

Going Deeper: Advanced Systems & Matrices

Concept
Matrix powers, recurrences, and the Cayley--Hamilton shortcut

Every square matrix satisfies its own characteristic equation. For a 2×22\times2 matrix AA with trace t=trA=a+dt=\operatorname{tr}A=a+d and determinant Δ=detA\Delta=\det A, the Cayley--Hamilton theorem gives

A2tA+ΔI=0A2=tAΔI.A^2 - t\,A + \Delta\,I = \mathbf{0} \qquad\Longleftrightarrow\qquad A^2 = t\,A - \Delta\,I.

Two powerful consequences:

  • [leftmargin=5mm,itemsep=1pt]
  • Reduce high powers: A2A^2 (and hence A3,A4,A^3, A^4,\dots) is always a linear combination αA+βI\alpha A + \beta I. So An=cnA+dnIA^n = c_n A + d_n I for scalars found by a recurrence, never a full multiplication.
  • Instant inverse: rearrange to A(tIA)=ΔIA\bigl(tI-A\bigr)=\Delta I, so if Δ0\Delta\neq0, @@BLOCK1@@

The scalar recurrence itself mirrors the matrix: if An=cnA+dnIA^n=c_nA+d_nI then An+1=cnA2+dnA=(tcn+dn)AΔcnIA^{n+1}=c_n A^2 + d_n A = (tc_n+d_n)A - \Delta c_n I, so cn+1=tcn+dnc_{n+1}=tc_n+d_n and dn+1=Δcnd_{n+1}=-\Delta c_n.

Example
Worked: Cayley--Hamilton inverse and a reduced power

Let A=[2314]A=\begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix}, so t=6t=6 and Δ=2(4)3(1)=5\Delta=2(4)-3(1)=5.

Inverse. A1=15(6IA)=15[623164]=15[4312]A^{-1}=\dfrac{1}{5}\bigl(6I-A\bigr)=\dfrac{1}{5}\begin{bmatrix} 6-2 & -3 \\ -1 & 6-4 \end{bmatrix}=\dfrac{1}{5}\begin{bmatrix} 4 & -3 \\ -1 & 2 \end{bmatrix}, matching the adjugate formula.

Power via recurrence. From A2=6A5IA^2=6A-5I:

A3=AA2=6A25A=6(6A5I)5A=31A30I.A^3 = A\cdot A^2 = 6A^2-5A = 6(6A-5I)-5A = 31A-30I.

So A3=31[2314]30[1001]=[32933194]A^3=31\begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix}-30\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}=\begin{bmatrix} 32 & 93 \\ 31 & 94 \end{bmatrix} --- no repeated matrix multiplication needed.

Concept
Special determinant identities and singular conditions

Some determinants have closed forms worth memorizing:

  • [leftmargin=5mm,itemsep=1pt]
  • Vandermonde: det[1x1x121x2x221x3x32]=(x2x1)(x3x1)(x3x2)\det\begin{bmatrix} 1 & x_1 & x_1^2 \\ 1 & x_2 & x_2^2 \\ 1 & x_3 & x_3^2 \end{bmatrix}=(x_2-x_1)(x_3-x_1)(x_3-x_2), i.e. the product of all differences xjxix_j-x_i (i<ji<j).
  • Identity plus all-ones (I+aJI+aJ): if JJ is the n×nn\times n matrix of all 11's, then det(I+aJ)=1+na\det(I+aJ)=1+na.
  • Block triangular: det[AB0D]=detAdetD\det\begin{bmatrix} A & B \\ \mathbf{0} & D \end{bmatrix}=\det A\cdot\det D (the off-diagonal block BB does not matter).

Singular (det=0\det=0) exactly when rows/columns are linearly dependent: one row is a scalar multiple of another, a row is a sum of others, or a row (or column) is all zeros. A singular matrix has no inverse, and Ax=bA\mathbf{x}=\mathbf{b} then has either no solution or infinitely many.

Example
Worked: three determinant identities

Vandermonde with x1=1,x2=2,x3=4x_1=1,\,x_2=2,\,x_3=4:

det[1111241416]=(21)(41)(42)=132=6.\det\begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 4 \\ 1 & 4 & 16 \end{bmatrix}=(2-1)(4-1)(4-2)=1\cdot3\cdot2=6.

I+2JI+2J, size 33: formula gives 1+3(2)=71+3(2)=7. Directly, I+2J=[322232223]I+2J=\begin{bmatrix} 3 & 2 & 2 \\ 2 & 3 & 2 \\ 2 & 2 & 3 \end{bmatrix}, and expanding confirms det=7\det=7. ✓

Block triangular: det[2599039900170004]=(23)(14)=24\det\begin{bmatrix} 2 & 5 & 9 & 9 \\ 0 & 3 & 9 & 9 \\ 0 & 0 & 1 & 7 \\ 0 & 0 & 0 & 4 \end{bmatrix}=(2\cdot3)(1\cdot4)=24 (product of the two 2×22\times2 diagonal blocks, which are themselves triangular).

Concept
Nonlinear systems: intersecting conics

When both equations are conics, eliminate the squared terms rather than a single variable. Add or subtract multiples so that x2x^2 (or y2y^2) cancels, leaving a simpler relation; substitute back. Two conics can meet in up to four points, so expect several ordered pairs and pair each recovered value with the correct sign from the equation you used.

Example
Worked: ellipse meets hyperbola

Solve {x2+2y2=6x2y2=3\begin{cases} x^2+2y^2=6 \\ x^2-y^2=3 \end{cases}

Subtract eq. 2 from eq. 1 to kill x2x^2: 3y2=3y2=1y=±13y^2=3\Rightarrow y^2=1\Rightarrow y=\pm1.

Substitute into eq. 2: x21=3x2=4x=±2x^2-1=3\Rightarrow x^2=4\Rightarrow x=\pm2.

Solutions (four): (2,1),(2,1),(2,1),(2,1)(2,1),\,(2,-1),\,(-2,1),\,(-2,-1). Check (2,1)(2,1): 4+2=64+2=6 and 41=34-1=3. ✓

Concept
Partial fractions with repeated and irreducible factors

Two cases beyond the distinct-linear setup demand extra terms:

  • [leftmargin=5mm,itemsep=1pt]
  • Repeated linear (xr)k(x-r)^k: include one term per power, A1xr+A2(xr)2++Ak(xr)k\dfrac{A_1}{x-r}+\dfrac{A_2}{(x-r)^2}+\cdots+\dfrac{A_k}{(x-r)^k}.
  • Irreducible quadratic x2+bx+cx^2+bx+c (no real roots): use a linear numerator Bx+Cx2+bx+c\dfrac{Bx+C}{x^2+bx+c}.

Root-substitution alone will not find every constant here, so clear denominators and match coefficients of like powers of xx, giving a small linear system for the unknowns.

Example
Worked: an irreducible quadratic factor

Decompose 3x2+2x+1(x1)(x2+1)=Ax1+Bx+Cx2+1\dfrac{3x^2+2x+1}{(x-1)(x^2+1)}=\dfrac{A}{x-1}+\dfrac{Bx+C}{x^2+1}.

Clear denominators: 3x2+2x+1=A(x2+1)+(Bx+C)(x1)3x^2+2x+1=A(x^2+1)+(Bx+C)(x-1).

Root shortcut, x=1x=1:   6=2AA=3\;6=2A\Rightarrow A=3.

Match coefficients: x2 ⁣: 3=A+BB=0x^2\!:\ 3=A+B\Rightarrow B=0; constant: 1=ACC=2:\ 1=A-C\Rightarrow C=2; check x1 ⁣: 2=B+C=2x^1\!:\ 2=-B+C=2. ✓

3x2+2x+1(x1)(x2+1)=3x1+2x2+1.\frac{3x^2+2x+1}{(x-1)(x^2+1)}=\frac{3}{x-1}+\frac{2}{x^2+1}.
Concept
Linear programming: unbounded regions and an edge of optima

The corner principle assumes a bounded feasible region. Two degenerate cases:

  • [leftmargin=5mm,itemsep=1pt]
  • Unbounded region: if the objective can grow without limit along an open direction, there is no maximum (though a minimum may still exist at a vertex, or vice versa). Always check whether the region is closed in the direction you are optimizing.
  • Edge of optima: when the objective line z=ax+byz=ax+by is parallel to a boundary edge, every point on that edge is optimal --- infinitely many solutions, all giving the same zz. You detect this when two adjacent vertices tie for the best value.
Example
Worked: an unbounded feasible region

Consider x0, y0, x+y2x\ge0,\ y\ge0,\ x+y\ge2 (region opens outward to the upper right).

Maximize z=x+yz=x+y: moving farther from the origin increases zz without bound, so no maximum exists --- the problem is unbounded.

Minimize z=x+yz=x+y over the same region: the constraint forces x+y2x+y\ge2, and every point of the edge from (2,0)(2,0) to (0,2)(0,2) gives z=2z=2. So the minimum is z=2z=2, attained along an entire edge (an edge of optima), not a single corner.

Formulas, Proofs & Tips

Tip
Determinants and Cramer’s rule
det[abcd]=adbc,x=detAxdetA,y=detAydetA\det\begin{bmatrix} a & b \\ c & d\end{bmatrix}=ad-bc,\qquad x=\frac{\det A_x}{\det A},\quad y=\frac{\det A_y}{\det A}

What it means. The determinant measures how a matrix scales area; when it is 00 the system has no unique solution.

Example. det[2314]=2431=5\det\begin{bmatrix}2&3\\1&4\end{bmatrix}=2\cdot4-3\cdot1=5.

Why it works. Solving ax+by=e, cx+dy=fax+by=e,\ cx+dy=f by elimination gives x=edbfadbcx=\tfrac{ed-bf}{ad-bc}, and the numerator is the determinant of AA with the xx-column replaced by the constants. A zero determinant means the two lines are parallel or identical.

Tip. Check detA0\det A\neq 0 before dividing — that is precisely the test for a unique solution.