System of Linear Equations Notes

System of Linear Equations

1.1 Definition of Equation

  • An equation is a statement of equality containing one or more variables.

  • Solving the equation means determining which values of the variables make the equality true.

  • Variables are called unknowns, and the values satisfying the equality are called solutions.

  • General form: ax+by=cax + by = c

    • Expressions on the left and right-hand sides are separated by an equal sign "=".

1.2 Linear and Non-linear Equations

  • Linear Equation: Unknown variables occur only to the first power and are multiplied by constants.

    • Example: ax+b=0ax + b = 0, where aa and bb are real numbers.

  • Non-linear Equation: Involve products of unknown variables or variables as arguments of trigonometric, logarithmic, exponential, or other functions.

    • Examples: y=2x6y = 2x - 6, y=6x3+7x+3y = 6x^3 + 7x + 3, z=6xy+5xz = 6xy + 5x, y=exy = e^x, y=sinxy = \sin x

1.3 System of 2 Linear Equations

  • One-dimensional real space R\mathbb{R}

    • If a0a \neq 0 in the linear equation ax+b=0ax + b = 0, there is a unique solution: x=bax = -\frac{b}{a}.

  • Two-dimensional real space R2\mathbb{R}^2

    • Consider the system: {ax+by=p cx+dy=q\begin{cases} ax + by = p \ cx + dy = q \end{cases}, where a,b,c,d,pa, b, c, d, p, and qq are real numbers.

Geometric Interpretation
  • The equations ax+by=pax + by = p and cx+dy=qcx + dy = q represent lines in the xyxy-plane.

  • The solution to the system is the intersection point(s) of these lines.

    • Consistent System: At least one solution exists.

      • Exactly One Solution: The lines intersect at one point.

      • Infinitely Many Solutions: The lines coincide.

    • Inconsistent System: No solution exists.

      • No Solution: The lines are parallel.

Algebraic Methods
  1. Substitution

    • Given the system:

      • ax+by=pax + by = p (1)

      • cx+dy=qcx + dy = q (2)

    • Rearrange (1) to express yy in terms of xx: y=abx+pby = -\frac{a}{b}x + \frac{p}{b} (3)

    • Substitute (3) into (2).

    • If adbc0ad - bc \neq 0, there is a unique solution (consistent).

    • If adbc=0ad - bc = 0 and pdbq=0pd - bq = 0, there are infinitely many solutions (consistent).

    • If adbc=0ad - bc = 0 and pdbq0pd - bq \neq 0, there is no solution (inconsistent).

  2. Gaussian Elimination

    • Based on elementary row operations:

      • (Interchange): Swap two equations.

      • (Scaling): Multiply an equation by a non-zero constant.

      • (Replacement): Add a multiple of one equation to another.

    • Example:

      • {3x<em>1+x</em>2=4 6x<em>1+5x</em>2=2{6x<em>1+2x</em>2=8 6x<em>1+5x</em>2=2{3x<em>2=6 6x</em>1+5x<em>2=2{x</em>2=2 x1=2\begin{cases} 3x<em>1 + x</em>2 = 4 \ 6x<em>1 + 5x</em>2 = 2 \end{cases} \longrightarrow \begin{cases} 6x<em>1 + 2x</em>2 = 8 \ 6x<em>1 + 5x</em>2 = 2 \end{cases} \longrightarrow \begin{cases} -3x<em>2 = 6 \ 6x</em>1 + 5x<em>2 = 2 \end{cases} \longrightarrow \begin{cases} x</em>2 = -2 \ x_1 = 2 \end{cases}

1.4 System of 3 Linear Equations

  • How to find three unknowns from three linear equations.

1.5 General System of Linear Equations

  • An equation in nn variables x<em>1,x</em>2,,xnx<em>1, x</em>2, …, x_n can be written in the form:

    • a<em>1x</em>1+a<em>2x</em>2++a<em>n1x</em>n1+a<em>nx</em>n=ba<em>1x</em>1 + a<em>2x</em>2 + … + a<em>{n-1}x</em>{n-1} + a<em>nx</em>n = b

    • where a<em>1,a</em>2,,ana<em>1, a</em>2, …, a_n and bb are real or complex numbers.

    • The constants aja_j are coefficients, and bb is the right-hand side.

  • A system of mm linear equations in nn variables:

    • {a<em>11x</em>1+a<em>12x</em>2++a<em>1nx</em>n=b<em>1 a</em>21x<em>1+a</em>22x<em>2++a</em>2nx<em>n=b</em>2  a<em>m1x</em>1+a<em>m2x</em>2++a<em>mnx</em>n=bm\begin{cases} a<em>{11}x</em>1 + a<em>{12}x</em>2 + … + a<em>{1n}x</em>n = b<em>1 \ a</em>{21}x<em>1 + a</em>{22}x<em>2 + … + a</em>{2n}x<em>n = b</em>2 \ … \ a<em>{m1}x</em>1 + a<em>{m2}x</em>2 + … + a<em>{mn}x</em>n = b_m \end{cases}

    • b<em>ib<em>i and a</em>ija</em>{ij} are real or complex numbers.

    • mm and nn are positive integers.

Cases:
  1. Case m = n (same number of equations and variables)

    • High chance of having one set of solutions.

  2. Case m > n (more equations than variables)

    • High chance of having no solutions.

  3. Case m < n (fewer equations than variables)

    • High chance of having many solutions.

    • x<em>m+1x<em>{m+1} to x</em>nx</em>n can be free variables.

Questions:
  1. How to solve the system when mm and nn are large?

  2. How to determine if the system has one solution, no solution, or multiple solutions?

1.6 Matrix Notation

  • Example:

    • System: {3x<em>1+x</em>2=4 6x<em>1+5x</em>2=2\begin{cases} 3x<em>1 + x</em>2 = 4 \ 6x<em>1 + 5x</em>2 = 2 \end{cases}

    • Vector form: [3 6]x<em>1+[1 5]x</em>2=[4 2]\begin{bmatrix} 3 \ 6 \end{bmatrix} x<em>1 + \begin{bmatrix} 1 \ 5 \end{bmatrix} x</em>2 = \begin{bmatrix} 4 \ 2 \end{bmatrix}

    • Matrix form: [3amp;1 6amp;5][x<em>1 x</em>2]=[4 2]\begin{bmatrix} 3 &amp; 1 \ 6 &amp; 5 \end{bmatrix} \begin{bmatrix} x<em>1 \ x</em>2 \end{bmatrix} = \begin{bmatrix} 4 \ 2 \end{bmatrix}

    • Augmented matrix form: [3amp;1amp;4 6amp;5amp;2]\begin{bmatrix} 3 &amp; 1 &amp; 4 \ 6 &amp; 5 &amp; 2 \end{bmatrix}

      • The size of a matrix is given by the number of rows and columns (e.g., a 3 × 4 matrix has 3 rows and 4 columns).

1.7 Solving a Linear System

Example:

x<em>12x</em>2+x<em>3amp;=0 5x</em>15x<em>3amp;=10 2x</em>28x3amp;=8\begin{aligned} x<em>1 - 2x</em>2 + x<em>3 &amp;= 0 \ 5x</em>1 - 5x<em>3 &amp;= 10 \ 2x</em>2 - 8x_3 &amp;= 8 \end{aligned}

Augmented Matrix:

[1amp;2amp;1amp;0 5amp;0amp;5amp;10 0amp;2amp;8amp;8]\begin{bmatrix} 1 &amp; -2 &amp; 1 &amp; 0 \ 5 &amp; 0 &amp; -5 &amp; 10 \ 0 &amp; 2 &amp; -8 &amp; 8 \end{bmatrix}

Row Operations to Eliminate $x_1$ from equations 2 and 3:

[1amp;2amp;1amp;0 0amp;1amp;4amp;4 0amp;0amp;1amp;1]\begin{bmatrix} 1 &amp; -2 &amp; 1 &amp; 0 \ 0 &amp; 1 &amp; -4 &amp; 4 \ 0 &amp; 0 &amp; 1 &amp; -1 \end{bmatrix}

Back Substitution to Solve for the Variables:

x<em>1amp;=1 x</em>2amp;=0 x3amp;=1\begin{aligned} x<em>1 &amp;= 1 \ x</em>2 &amp;= 0 \ x_3 &amp;= -1 \end{aligned}

1.8 Existence and Uniqueness Questions

  • Two Fundamental Questions:

    • Is the system consistent (does at least one solution exist)?

    • If a solution exists, is it the only one (is the solution unique)?

Existence and Uniqueness Theorem
  • A linear system is consistent if and only if an echelon form of the augmented matrix has no row of the form:

    • [0amp;amp;0amp;b]\begin{bmatrix} 0 &amp; … &amp; 0 &amp; b \end{bmatrix}, with bb nonzero.

  • If a linear system is consistent, then the solution set contains either:

    • (i) a unique solution when there are no free variables, or

    • (ii) infinitely many solutions when there is at least one free variable.

Numerical Note
  • In real-world problems, computers solve systems of linear equations using elimination algorithms.

  • Floating-point arithmetic represents numbers as decimals with a finite number of digits, leading to round-off errors.

  • Inaccuracies seldom cause problems, but numerical notes warn of potential issues.

2.1 Echelon ("steplike") Forms

  • Triangular form is a special case of echelon form.

  • A leading entry of a row refers to the leftmost nonzero entry.

  • Any nonzero matrix may be row-reduced (by elementary row operations) into more than one matrix in echelon form, using different sequences of row operations. However, the reduced echelon form for a matrix is unique.

2.2 The Row Reduction Algorithm

  1. Write the augmented matrix of the system.

  2. Use row reduction to obtain an equivalent augmented matrix in echelon form.

    • Decide whether the system is consistent. If there is no solution, stop; otherwise, go to the next step.

  3. Continue row reduction to obtain the reduced echelon form.

  4. Write the system of equations corresponding to the matrix obtained in step 3.

  5. Rewrite each nonzero equation from step 4 so that its one basic variable is expressed in terms of any free variables appearing in the equation.

  • Elementary row operations:

    • (Interchange): Swapping two rows.

    • (Scaling): Multiplying all entries in a row by a non-zero constant.

    • (Replacement): Replacing one row by the sum of itself and a multiple of another row.

2.3 Existence and Uniqueness Theorem

  • A linear system is consistent if and only if an echelon form of the augmented matrix has no row of the form [0…0 b] with b nonzero.

  • If a linear system is consistent, then the solution set contains either:

    • (i) a unique solution, when there are no free variables, or

    • (ii) infinitely many solutions, when there is at least one free variable.

2.4 An Example

  • To find the solution of the system of linear equations with the following augmented matrix representation:

\begin{pmatrix} 1 & 4 & 5 & -9 & -7 \ 0 & 2 & 4 & -6 & -6 \ 0 & 5 & 10 & -15 & -15\0&-3&-6&4&9 \end{pmatrix}

  • After row operations the matrix transforms to:

\begin{pmatrix} 1 & 4 & 5 & -9 & -7 \ 0 & 2 & 4 & -6 & -6 \ 0 & 0 & 0 & 0 & 0\0&0&0&0&0 \end{pmatrix}

  • And the equations are given as:

    {x<em>1+4x</em>2+5x<em>39x</em>4=7 2x<em>2+4x</em>36x4=6 0=0 0=0\begin{cases} x<em>1 + 4x</em>2 + 5x<em>3 -9x</em>4 = -7 \ 2x<em>2 + 4x</em>3 -6x_4 = -6 \ 0 = 0 \ 0 = 0 \end{cases}

  • Explicit Equations

  • From the equations (2) and (3), we have x<em>2=2x</em>33x<em>2 = -2x</em>3 - 3

  • From the equations (1), (2) and (3), we have x<em>1=35x</em>3+54x<em>1 = \frac{3}{5}x</em>3 + \frac{5}{4}

  • There is no constraint on x3x_3, so it can be treated as a free variable.

  • We have more than one solution.

  • The solution can be written as:

x<em>4=0x<em>4 = 0 x</em>2=2x<em>33x</em>2 = -2x<em>3 - 3 x</em>1=35x3+54x</em>1 = \frac{3}{5}x_3 + \frac{5}{4}

3.1 A Simple Economy

  • Suppose an economy consists of the Coal, Electric (power), Steel, and the output of each sector is distributed among the various sectors.

  • Denote the prices of the total annual outputs of the Coal, Electric, and Steel sectors by pC, pE, and pS, respectively.

  • If possible, find equilibrium prices that make each sector’s income match its expenditures.

  • The total expenses used by Coal company are 0.0p<em>C+0.4p</em>E+0.6pS0.0p<em>C + 0.4p</em>E + 0.6p_S.

  • The total value produced by Coal company is pCp_C.

  • Therefore, we have p<em>C=0.0p</em>C+0.4p<em>E+0.6p</em>Sp<em>C = 0.0p</em>C + 0.4p<em>E + 0.6p</em>S.

  • The total expenses used by Electric company are 0.6p<em>C+0.1p</em>E+0.2pS0.6p<em>C + 0.1 p</em>E + 0.2p_S

  • The total value produced by Electric company is pEp_E

  • Therefore we have p<em>E=0.6p</em>C+0.1p<em>E+0.2p</em>Sp<em>E = 0.6p</em>C + 0.1 p<em>E + 0.2p</em>S

  • The total expenses used by Steel company are 0.4p<em>C+0.5p</em>E+0.2pS0.4p<em>C+0.5p</em>E + 0.2p_S

  • The total value produced by Steel company is pSp_S

  • Therefore we have p<em>S=0.4p</em>C+0.5p<em>E+0.2p</em>Sp<em>S = 0.4p</em>C+0.5p<em>E + 0.2p</em>S

  • {0.6p<em>C+0.9p</em>E0.2p<em>S=0 0.4p</em>C0.5p<em>E+0.8p</em>S=0\begin{cases} -0.6p<em>C + 0.9p</em>E - 0.2p<em>S = 0 \ -0.4p</em>C - 0.5p<em>E + 0.8p</em>S = 0 \end{cases}

  • The general solution is pc = .94ps, PE = .85ps, and ps is free. The equilibrium price vector for the economy has the form

3.2 Traffic flow

  • Suppose the vehicles per hour over several streets are given on the map. We want to determine the unknowns x1, x2, x3, x4 , x5.

  • Write equations that describe the flow, and then find the general solution of the system.

  • We make use of the fact that at each intersection, the traffic flow in must be equal to the flow out.

  • Putting all the equations together, we have

{x<em>1+x</em>2=800 x<em>2x</em>3+x<em>4=300 x</em>1+x<em>5=600 x</em>4+x<em>5=400 x</em>3=500\begin{cases} x<em>1 + x</em>2 = 800 \ x<em>2 - x</em>3 + x<em>4 = 300 \ x</em>1 + x<em>5 = 600 \ x</em>4 + x<em>5 = 400 \ x</em>3 = 500 \end{cases}

3.3 Balancing chemical equation

x<em>1(C</em>3H<em>8)+x</em>2(O<em>2)x</em>3(CO<em>2)+x</em>4(H2O)\begin{aligned} x<em>1(C</em>3H<em>8) + x</em>2(O<em>2) \rightarrow x</em>3(CO<em>2) + x</em>4(H_2O) \end{aligned}

We want to determine x1, x2, x3, x4 such that the number of atoms of each type will be the same on both sides.

  • For carbon C, we have 3x1 = x3

  • For hydrogen H, we have 8x1 = 2x4

  • For oxygen O, we have 2x2 = 2x3+x4

  • We have a system of linear equations

{3x<em>1+0x</em>2x<em>3+0x</em>4=0 8x<em>1+0x</em>2+0x<em>32x</em>4=0 0x<em>1+2x</em>22x<em>3x</em>4=0\begin{cases} 3x<em>1 + 0x</em>2 - x<em>3 + 0x</em>4 = 0 \ 8x<em>1 + 0x</em>2 + 0x<em>3 - 2x</em>4 = 0 \ 0x<em>1 + 2x</em>2 - 2x<em>3 - x</em>4 = 0 \end{cases}

  • Solution in mathematics

x<em>1=(1/4)x</em>4x<em>1 = (1/ 4) x</em>4
x<em>2=(5/4)x</em>4x<em>2 = (5/ 4) x</em>4
x<em>3=(3/4)x</em>4x<em>3 = (3/ 4) x</em>4

  • The numbers of atoms of C, H and O for this chemical reaction have to be integers.

  • So, x1, x2, x3, x4 have to be integer, the minimum x4 = 4. so that x3 = 3; x2 = 5; x1 = 1.

  • Solution in Chemistry

C<em>3H</em>8+5O<em>23CO</em>2+4H2O\begin{aligned} C<em>3H</em>8 + 5O<em>2 \rightarrow 3CO</em>2 + 4H_2O \end{aligned}