AOS1 Topic 2: Linear and System of Equations

Linear Systems of Equations


A linear equation in $n$ variables \(x_1, x_2, \ldots, x_n\) has the general form:


\[ a_1 x_1 + a_2 x_2 + \ldots + a_n x_n = b \]


where \(a_1, a_2, \ldots, a_n\) are coefficients, \(x_1, x_2, \ldots, x_n\) are variables, and \(b\) is a constant.



A system of linear equations is a set of such equations, for example:

\[ \begin{cases} a_{11}x_1 + a_{12}x_2 + \ldots + a_{1n}x_n = b_1 \\ a_{21}x_1 + a_{22}x_2 + \ldots + a_{2n}x_n = b_2 \\ \vdots \\ a_{m1}x_1 + a_{m2}x_2 + \ldots + a_{mn}x_n = b_m \end{cases} \]


This is often compactly written as

\[ AX =B \]


Where:

  1. $A$: coefficient matrix.
  2. $X$: column vector of variables \( (x_1,x_2,…,x_n) \).
  3. $B$: column vector of constants \( (b_1,b_2,…,b_m) \).



Types of Systems


Homogenous System: $B = 0$


  1. Always had at least one solution ($X=0$)
  2. May have an infinitely many solutions if $A$ is singular ($ |A| = 0$)


Non-Homogenous System: $B \neq 0$


  1. One Unique Solution: If $A$ is non-singular ($|A| \neq 0$)
  2. No Solution: If the system is inconsistent (parallel lines)
  3. Infinitely Many Solutions: If the system has dependent equations (overlapping lines)



How to Solve System of Linear Equations?


The following methods of solving system of linear equations \(AX = B\), are applicable only when the coefficient matrix \(A\) is non-singular, i.e., \(|A| \neq 0\).


Cramer's method

Inverse method


System of Linear Equations in Two Variables


The system of linear equations in two variables contains only two variables. For example:

\[ \begin{cases} 2x + 3y = 4 \\ 3x + 5y = 12 \end{cases} \]


Solution Methods:


There are several methods of solving linear equations in two variables, such as:


Graphical method


Substitution Method


Elimination Method


Matrix Method


Detailed Solution Methods


a. Graphical Method


Description: Suitable for systems with two variables.


Process:

  1. Represent each equation as a straight line on a graph.
  2. The solution is the point(s) where the lines intersect.




Created with GeoGebra ® , by Rabiya Manzoor, Link



b. Substitution Method


Description: Solves one equation for one variable and substitutes into the other equation.

Process:


  1. Solve one equation for one variable.
  2. Substitute this expression into the other equation.
  3. Solve for the remaining variable.
  4. Substitute back to find the other variable.


Example:

Solve the system:

\[ \begin{cases} x + y = 5 \\ 2x - y = 1 \end{cases} \]


Steps:


i. From the first equation, solve for $y$:

\[ y=5-x\]


ii. Substitute into the second equation:

\[ 2x-(5-x) =1\]

\[2x-5+x=1\]

\[3x=6\]

\[x=2\]


iii. Substitute $x=2$ back into $y=5-x$:

\[y-5-2=3\]


iv. Solution: $x=2, y=3$



c. Elimination Method (or Addition Method)


Description: Adds or subtracts equations to eliminate one variable.

Process:


  1. Multiply equations by suitable coefficients to make the coefficients of one variable opposites.
  2. Add or subtract the equations to eliminate that variable.
  3. Solve for the remaining variable.
  4. Substitute back to find the other variable.


Example:

Solve the system:

\[ \begin{cases} 2x + 3y = 4 \\ 3x + 5y = 12 \end{cases} \]


Steps:


i. Multiply the first equation by $3$ and the second by $2$:

\[6x+9y=12\]

\[6x+10y=24\]


ii. Subtract the first new equation from the second:

\[(6x+10y)-(6x-9y)=24-12\]

\[y=12\]


iii. Substitute $y=12$ into the first original equation:

\[2x+3(12) =4\]

\[2x+36=4\]

\[2x=-32\]

\[x=-16\]


iv. Solution: $x=-16, y=12$


d. Matrix Method (Back Substitution)


Description: Represents the system as a matrix equation $AX=B$ and uses matrix operations to solve for $X$.

Process:


  1. Write the augmented matrix for the system.
  2. Use row operations to reduce the matrix to row-echelon form.
  3. Solve for the variables using back-substitution.


This method is used in Engineering.


Example:

Solve the system:

\[ \begin{cases} x + 2y = 5 \\ 3x + 4y = 6 \end{cases} \]


Steps:


i. Write the augmented matrix:

\[ \begin{array}{rr|r} 1 & 2 & 5 \\ 3 & 4 & 6 \end{array} \]


ii. Eliminate $x$ from the second equation:

  1. Multiply the first row by $3$:

\[ \begin{array}{rr|r} 3 & 6 & 15 \\ 3 & 4 & 6 \end{array} \]


  1. Subtract the first row from the second row:

\[ \begin{array}{rr|r} 1 & 2 & 5 \\ 0 & -2 & -9 \end{array} \]


iii. Solve for $y$ from the second row

\[ -2y = -9\]

\[ y = 4.5\]


iv. Substitute $ y = 4.5$ into the first equation:

\[ x+2(4.5) = 5\]

\[ x+9 = 5\]

\[x=-4\]


v. Solution: $x=-4, y=4.5$



e. Inverse Method (Matrix Inversion)


Description: Represents the system as a matrix equation $AX=B$ and uses matrix operations to solve for $X$.

Process:


  1. Define matrix $A$ and $B$ and find $det(A)$.
  2. Find the inverse of $A$.
  3. Solve for the variables by multiplying the inverse of $A$ by $B$.


Example:

Solve the system:

\[ \begin{cases} 2x + y = 5 \\ 4x + 3y = 11 \end{cases} \]


Steps:


i. Define matrix $A$ and $B$:

\[ A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 4 & 3 \end{pmatrix} \]

\[ B = \begin{pmatrix} e \\ f \end{pmatrix} = \begin{pmatrix} 5 \\ 11 \end{pmatrix} \]


ii. Find $det(A)$:

\[ det(A) = a \times d - b \times c = 2 \times 3 - 1 \times 4 = 2 \]


iii. Find inverse of $A$:

\[ A^{-1} = \frac{1}{det(A)} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix} = \frac{1}{2} \begin{pmatrix} 3 & -1 \\ -4 & 2 \end{pmatrix} = \begin{pmatrix} \frac{3}{2} & \frac{-1}{2} \\ -2 & 1 \end{pmatrix} \]


iv. Multiply $A^{-1}$ by $B$:

\[ X = \begin{pmatrix} x \\ y \end{pmatrix} = A^{-1}B = \begin{pmatrix} \frac{3}{2} & \frac{-1}{2} \\ -2 & 1 \end{pmatrix} \begin{pmatrix} 5 \\ 11 \end{pmatrix} \]


First row:

\[ x = ( \frac{3}{2} \times 5) + (\frac{-1}{2} \times {11}) = \frac{15}{2} - \frac{11}{2} = \frac{4}{2} = 2 \]


Second row:

\[ y = (-2 \times 5) + (1 \times 11) = -10 + 11 = 1 \]


Solution:

\[ \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 2 \\ 1 \end{pmatrix} \]



f. Cramer's Method


Description: Solves a system of linear equations by using the determinant of the coefficient matrix $A$ and replacing columns with the constant matrix $B$ to compute each variable directly.

Process:


  1. Define matrix $A$ and $B$ and find $det(A)$.
  2. Replace columns of $A$ and find the $det(A_x)$ and $det(A_y)$.
  3. Solve for the variables by dividing $det(A_x)$ and $det(A_y)$ by $det(A)$.


Example:

Solve the system:

\[ \begin{cases} x + 2y = 8 \\ 3x + y = 7 \end{cases} \]


Steps:



i. Define matrix $A$ and $B$:

\[ A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} = \begin{pmatrix} 1 & 2 \\ 3 & 1 \end{pmatrix} \]

\[ B = \begin{pmatrix} e \\ f \end{pmatrix} = \begin{pmatrix} 8 \\ 7 \end{pmatrix} \]


ii. Find $det(A)$:

\[ det(A) = a d - b c = 1 \times 1 - 2 \times 3 = -5 \]


ii. Calculate $det(A_x)$ (replace the first column with $B$

\[ A = \begin{pmatrix} 8 & 2 \\ 7 & 1 \end{pmatrix} \]

\[ det(A_x) = 8 \times 1 - 2 \times 7 = -6\]


iii. Calculate $det(A_y)$ (replace the second column with $B$

\[ A = \begin{pmatrix} 1 & 8 \\ 3 & 7 \end{pmatrix} \]

\[ det(A_y) = 1 \times 7 - 8 \times 3 = -17\]


iv. Find $x$ and $y$:


\[ x = \frac{ det(A_{x}) }{ det(A) } = \frac{-6}[-5} = 1.2 \]

\[ y = \frac{ det(A_{y}) }{ det(A) } = \frac{-17}[-5} = 3.4 \]


v. Solution: $x = 1.2, y = 3.4$




Common Misconceptions


Misconception 1: All Systems Have a Unique Solution


Clarification: Systems can have one solution, no solution, or infinitely many solutions depending on the equations' relationships.


Misconception 2: Matrix Methods Are Always the Best Choice


Clarification: While powerful, matrix methods may be overkill for simple systems. Choosing the appropriate method depends on the system's complexity.




Setting up Worded Linear Equations


Easy: Basic Translation:


Example:

The sum of two numbers is 10. One number is twice the other. Find the numbers.


Steps:


  1. Let the two numbers be $x$ and $y$


  1. Translate the problem into equations:


The sum of two numbers is 10:

\[x+y=10\]


One number is twice the other:

\[x=2y\]


  1. Substitute $x=2y$ into $x+y=10$


\[2y+y=10\]

\[3y=10\]

\[y=\frac{10}{3}\]


  1. Solve for $x$:

\[x=2y\]

\[x=2( \frac{10}{3})\]

\[x= \frac{20}{3}\]


Answer: The numbers are $x=\frac{20}{3}$​ and $y=\frac{10}{3}$​.




Intermediate: Price and Quantity Problem


Example:

A shopkeeper sells $3$ pencils and $2$ erasers for \$1.50 and $2$ pencils and $5$ erasers for \$2.00. Find the price of one pencil and one eraser.


Steps:


1.Let the price of one pencil be $x$ and one eraser be $y$.

2.Translate the problem into equations:


  1. $3$ pencils and $2$ erasers cost $\$1.50$:

\[3x+2y=1.50\]


  1. 2 pencils and 5 erasers cost $ \$2.00$ :

\[2x+5y=2.00\]


3.Solve the system using substitution or elimination:


Multiply the first equation by $2$ and the second by $3$ to eliminate


\[6x+4y=3.00\]

\[6x+15y=6.00\]


Subtract the first equation from the second:

\[11y = 3.00\]

\[y= \frac{3.00}{11} = 0.2711\]

\[ \therefore x= $ 0.32\]


Answer: One pencil costs \$0.32, and one eraser costs \$0.27




Challenging: Mixture Problem


Example:

A farmer has two types of feed: one containing 30% protein and the other containing 50% protein. How many kilograms of each feed should be mixed to produce 200 kg of feed containing 40% protein?


Steps:


  1. Let the amount of 30% protein feed be $x$ kg and 50% protein feed be $y$ kg.
  2. Translate the problem into equations:


  1. Total weight: $x+y=200$
  2. Total protein content: $0.3x+0.5y =0.4(200)=80$


  1. Solve the system:


  1. From the first equation, $y=200−x$
  2. Substitute $y=200−x$ into $0.3x+0.5y=80$:


\[0.3x+0.5(200−x)=80\]

\[ 0.3x+100−0.5x=80\]

\[−0.2x=−20 \]

\[x=100\]

\[ \therefore y=100 \]


Answer: Mix 100 kg of 30% protein feed and 100 kg of 50% protein feed.



Difficult: Motion Problem with Two Unknowns


Example:

A boat travels 20 km downstream in 2 hours and 16 km upstream in 4 hours. Find the speed of the boat in still water and the speed of the current.


Steps:


1.Let the speed of the boat in still water be $x$ km/h and the speed of the current be $y$ km/h.


2.Translate the problem into equations:


Downstream speed is $x+y$ km/h:


\[ \frac{20}{x+y} = 2 \implies x + y = \frac{20}{2} = 10 \]


Upstream speed is $x−y$ km/h:


\[ \frac{16}{x−y} = 4 \implies x−y= \frac{16}{4} = 4 \]


3.Solve the system:


From $x+y=10$ and $x−y=4$, add the equations:

\[2x=14 \implies x=7\]


Substitute $x=7$ into $x+y=10$

\[ 7+y=10 \implies y = 3\]


Answer: The speed of the boat in still water is 7 km/h, and the speed of the current is 3 km/h.



Medium: Geometry Problem


Example:

The perimeter of a rectangle is 36 cm. The length is 3 cm more than twice the width. Find the dimensions of the rectangle.


Steps:


1.Let the width be $w$ cm and the length be $l$ cm.

2.Translate the problem into equations:


Perimeter: $2l+2w=36 \implies l + w = 18$

Relationship between length and width: $l=2w+3$


3.Solve the system:


Substitute $l=2w+3$ into $l+w=18$:


\[(2w+3)+w=18\]

\[3w+3=18 \implies 3w=15 \implies w=5 \]

\[ \therefore l = 13\]


Answer: The dimensions of the rectangle are $5 cm \times 13$ cm



Difficult: Investment Problem


Example:

A person invests \$10,000 in two accounts, one earning 5% interest and the other 8%. After one year, the total interest earned is \$680. How much was invested in each account?


Steps:


1.Let the amount invested at 5% be $x$ dollars and at 8% be $y$ dollars.


2.Translate the problem into equations:


Total investment: $x+y=10,000$

Total interest earned: $0.05x+0.08y=680$


3.Solve the system:


From the first equation, $y=10,000−x$.


Substitute $y=10,000−x$ into $0.05x+0.08y=680$:

\[0.05x+0.08(10,000−x)=680\]

\[0.05x+800−0.08x=680\]

\[−0.03x=−120 \implies x=4,000\]


Substitute $x=4,000$ into $y=10,000−x$:

\[y=10,000−4,000=6,000\]


Answer: \$4,000 was invested at 5%, and \$6,000 was invested at 8%.




Summary: Linear Systems of Equations


Linear Equation: An equation of the form $a_1 x_1 + a_2 x_2 + \ldots + a_n x_n = b$.


System of Linear Equations: A set of two or more linear equations with the same variables.


Types of Systems:

  1. Homogeneous: $B=0$, always has at least one solution.
  2. Non-Homogeneous: $B \neq 0$, may have one solution, no solution, or infinitely many solutions.


Solution Types:

  1. Unique Solution: One distinct set of variable values satisfies all equations.
  2. No Solution: The system is inconsistent.
  3. Infinitely Many Solutions: Dependent equations with multiple satisfying variable sets.

Example 1

Cramer's Method
Consider the system of equations and solve by Cramer's Method:

\(2x + 3y = 5\)
\(4x + y = 11\)

Solution:
We are given the system of linear equations:

2x + 3y = 5    (1)
4x + y = 11    (2)

Step 1: Write the System in Matrix Form
The matrix form is \(AX = B\), where:

A = \(\begin{pmatrix} 2 & 3 \\ 4 & 1 \end{pmatrix}\),   X = \(\begin{pmatrix} x \\ y \end{pmatrix}\),   B = \(\begin{pmatrix} 5 \\ 11 \end{pmatrix}\)

Step 2: Calculate the Determinant of Matrix A
We calculate the determinant of matrix \(A\) as follows:

\(\det(A) = \begin{vmatrix} 2 & 3 \\ 4 & 1 \end{vmatrix} = (2 \times 1) - (3 \times 4)\)
\(\det(A) = 2 - 12 = -10\)

Step 3: Find \(\det(A_x)\) and \(\det(A_y)\)
Now, we replace the columns of matrix \(A\) with matrix \(B\) to calculate \(\det(A_x)\) and \(\det(A_y)\).
Finding \(\det(A_x)\):

A_x = \(\begin{pmatrix} 5 & 3 \\ 11 & 1 \end{pmatrix}\)
\(\det(A_x) = (5 \times 1) - (3 \times 11) = 5 - 33 = -28\)

Finding \(\det(A_y)\):

A_y = \(\begin{pmatrix} 2 & 5 \\ 4 & 11 \end{pmatrix}\)
\(\det(A_y) = (2 \times 11) - (5 \times 4) = 22 - 20 = 2\)

Step 4: Solve for \(x\) and \(y\)
Using Cramer's Rule, we solve for \(x\) and \(y\) as:

\(x = \frac{\det(A_x)}{\det(A)} = \frac{-28}{-10} = 2.8\)
\(y = \frac{\det(A_y)}{\det(A)} = \frac{2}{-10} = -0.2\)

Final Answer
The solution to the system of equations is:

\(x = 2.8\),   \(y = -0.2\)

Example 2

Inverse method
We are given the system of linear equations:

2x + 3y = 5    (1)
4x + y = 11    (2)

Solution:
We find the inverse of matrix \(A\):

A = \(\begin{pmatrix} 2 & 3 \\ 4 & 1 \end{pmatrix}\)
\(\det(A) = -10\)
\(A^{-1} = \frac{1}{-10} \begin{pmatrix} 1 & -3 \\ -4 & 2 \end{pmatrix} = \begin{pmatrix} -0.1 & 0.3 \\ 0.4 & -0.2 \end{pmatrix}\)

Now, multiply \(A^{-1}\) by \(B\):

\(X = A^{-1}B = \begin{pmatrix} -0.1 & 0.3 \\ 0.4 & -0.2 \end{pmatrix} \begin{pmatrix} 5 \\ 11 \end{pmatrix}\)
\(x = 2.8\), \(y = -0.2\)

Final Answer: \(x = 2.8\), \(y = -0.2\)

Example 3

3. Gauss-Jordan Method

Start with the augmented matrix:

\(\begin{pmatrix} 2 & 3 & | & 5 \\ 4 & 1 & | & 11 \end{pmatrix}\)

Perform row operations:
  • \(R1 = R1 / 2 \rightarrow \begin{pmatrix} 1 & 1.5 & | & 2.5 \\ 4 & 1 & | & 11 \end{pmatrix}\)
  • \(R2 = R2 - 4R1 \rightarrow \begin{pmatrix} 1 & 1.5 & | & 2.5 \\ 0 & -5 & | & 1 \end{pmatrix}\)
  • \(R2 = R2 / (-5) \rightarrow \begin{pmatrix} 1 & 1.5 & | & 2.5 \\ 0 & 1 & | & -0.2 \end{pmatrix}\)
  • \(R1 = R1 - 1.5R2 \rightarrow \begin{pmatrix} 1 & 0 & | & 2.8 \\ 0 & 1 & | & -0.2 \end{pmatrix}\)
Final Answer: \(x = 2.8\), \(y = -0.2\)

Example 4

4. Gauss Elimination Method

Start with the augmented matrix:

\(\begin{pmatrix} 2 & 3 & | & 5 \\ 4 & 1 & | & 11 \end{pmatrix}\)

Perform row operations to get an upper triangular matrix:
  • \(R1 = R1 / 2 \rightarrow \begin{pmatrix} 1 & 1.5 & | & 2.5 \\ 4 & 1 & | & 11 \end{pmatrix}\)
  • \(R2 = R2 - 4R1 \rightarrow \begin{pmatrix} 1 & 1.5 & | & 2.5 \\ 0 & -5 & | & 1 \end{pmatrix}\)

Solve for \(y\) and back-substitute to find \(x\):

\(y = -0.2\), \(x = 2.8\)

Final Answer: \(x = 2.8\), \(y = -0.2\)

Example 5

5. LU Decomposition Method

Decompose matrix \(A\) into \(L\) and \(U\):

\(L = \begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix}\),   \(U = \begin{pmatrix} 2 & 3 \\ 0 & -5 \end{pmatrix}\)

Solve \(LY = B\) and then \(UX = Y\):

\(Y = \begin{pmatrix} 5 \\ 1 \end{pmatrix}\),   \(X = \begin{pmatrix} 2.8 \\ -0.2 \end{pmatrix}\)

Final Answer: \(x = 2.8\), \(y = -0.2\)