01Hsolving3equations

= Solving Systems of Three Equations =

Equations in 3-Dimensions
A linear equation with 3 variables creates a plane (flat surface) in 3-Dimensional space. {Flat but tilted}

Imagine the standard XY axes flat on the page (or on the screen) The positive Z axis then points perpendicularly up from the page (or out of the screen)

** Example **
Consider the equation 2x + 3y + z = 5

For every point (x, y) we can find a value of z that make this equation true (shown in red)

Imagine a pin in each position pointing straight out of the page with the given height.

The tops of each pin will join to form the plane referred to by this equation.

NB: In the graph, the faint red lines form a contour map of the surface of the plane.

Solving Systems of Equations in 3 Dimensions
Consider two equations (two planes) in 3 dimensions. The planes could be
 * Parallel (no solutions)
 * Coincident (infinite solutions -- every point on the plane)
 * Intersecting (the intersection would be a straight line - infinite solutions)

Now imagine a third equation (three planes) in 3 dimensions. The planes could be
 * Two or three of the planes could be parallel (no solutions)
 * The three planes could intersect each other but not all at the same place (no solutions)
 * All three could be coincident (infinite solutions -- every point on the plane)
 * All three could intersect along a single straight line (infinite solutions)
 * All three could intersect at a single point (a unique solution)

Solving 3 Simultaneous Equations Algebraically
We can solve 3 simultaneous equations with 3 variables algebraically using an extended version of the elimination method.
 * 1) Use equations [1] and [2] to eliminate one of the variables and produce a new equation in 2 variables. Call this [4]
 * 2) Use equations [1] and [3] (or [2] and [3]) to eliminate the __same__ variable and produce a 2nd new equation in the same 2 variables as [4]. Call this [5].
 * 3) Solve [4] and [5] simultaneously to get solutions for two of the variables.
 * 4) Substitute the two found solutions into [1] to obtain the third solution.
 * 5) Check by substituting the solutions into [2] and [3]

NB: At several different points in the process we could discover that there are no solutions (or infinitely many solutions)

** Example 6a **
Solve these simultaneous equations algebraically math \\ . \qquad x + 2y - z = 6 \qquad \big[ \textbf{1} \big] \\ . \qquad 2x - y - z = 1 \qquad \big[ \textbf{2} \big] \\ . \qquad \; x + 2z = -1 \qquad \big[ \textbf{3} \big] math


 * Solution:**

Combine ** [1] ** and ** [2] ** to eliminate **y** math \\ . \qquad x + 2y - z = 6 \qquad \big[ \textbf{1} \big] \\ . \qquad 2x - y - z = 1 \qquad \big[ \textbf{2} \big] math

Multiply ** [2] ** by 2 math \\ . \qquad x + 2y - z = 6 \qquad \big[ \textbf{1} \big] \\ . \qquad 4x - 2y - 2z = 2 \qquad \big[ \textbf{2} \big] \times 2 math

Add to get ** [4] ** math . \qquad 5x - 3z = 8 \qquad \big[ \textbf{4} \big] math

Equation ** [3] ** already has no value for **y** math \\ . \qquad 5x - 3z = 8 \qquad \big[ \textbf{4} \big] \\ . \qquad x + 2z = -1 \qquad \big[ \textbf{3} \big] math

Multiply ** [4] ** by 2 and multiply ** [3] ** by 3 math \\ . \qquad 10x - 6z = 16 \qquad \big[ \textbf{4} \big] \times 2 \\ . \qquad 3x + 6z = -3 \qquad \big[ \textbf{3} \big] \times 3 math

Add and solve for **x** math \\ . \qquad 13x = 13 \\ . \qquad x = 1 math

Sub ** x = 1 ** into ** [3] ** and solve for **z** math \\ . \qquad 1 + 2z = -1 \\ . \qquad \quad 2z = -2 \\ . \qquad \quad z = -1 math

Sub ** x = 1, z = –1 ** into ** [1] ** and solve for **y** math \\ . \qquad 1 + 2y - \big( -1 \big) = 6 \\ . \qquad \quad 2y + 2 = 6 \\ . \qquad \qquad 2y = 4 \\ . \qquad \qquad y = 2 math

Sub ** (1, 2, –1) ** into ** [2] ** to check math \\ . \qquad 2 \big( 1 \big) - \big( 2 \big) - \big( -1 \big) = 1 \\ . \qquad \qquad 2 - 2 + 1 = 1 \\ . \qquad \qquad \qquad 1 = 1 math

Sub ** (1, 2, –1) ** into ** [3] ** to check math \\ . \qquad 1 + 2 \big( -1 \big) = -1 \\ . \qquad \quad 1 - 2 = -1 \\ . \qquad \qquad -1 = -1 math


 * Hence the solution is (x = 1, y = 2, z = –1) **

Solving 3 Simultaneous Equations Using Matrices
To solve manually, we have to be able to find the inverse of the matrix. It is possible to find the inverse of a 3 × 3 matrix manually, but it is not worth the bother.

We can do matrices on the CAS calculator very easily.

** Example 6b **
Solve these simultaneous equations using matrices. math \\ . \qquad x + 2y - z = 6 \qquad \big[ \textbf{1} \big] \\ . \qquad 2x - y - z = 1 \qquad \big[ \textbf{2} \big] \\ . \qquad \; x + 2z = -1 \qquad \big[ \textbf{3} \big] math


 * Solution:**

Write in matrix form (fill in the missing space with 0) math . \qquad \left[ \begin{matrix} 1&2&-1 \\ 2&-1&-1 \\ 1&0&2 \\ \end{matrix} \right] \left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right] = \left[ \begin{matrix} 6 \\ 1 \\ -1 \\ \end{matrix} \right] math

Therefore math . \qquad \left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right] = \left[ \begin{matrix} 1&2&-1 \\ 2&-1&-1 \\ 1&0&2 \\ \end{matrix} \right]^{-1} \left[ \begin{matrix} 6 \\ 1 \\ -1 \\ \end{matrix} \right] math

Using the calculator gives math . \qquad \left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right] = \left[ \begin{matrix} 1 \\ 2 \\ -1 \\ \end{matrix} \right] math

{NB Slow double click on the matrix icon to get 3 × 3 matrix}

Solve 3 Simultaneous Equations Using the Classpad
You can also use the simultaneous equations function on the Classpad to solve these equations. {Slow double click on the icon to get slots for 3 equations}

** Example 6c **
Solve these simultaneous equations. math \\ . \qquad x + 2y - z = 6 \qquad \big[ \textbf{1} \big] \\ . \qquad 2x - y - z = 1 \qquad \big[ \textbf{2} \big] \\ . \qquad \; x + 2z = -1 \qquad \big[ \textbf{3} \big] math


 * Solution:**

As seen on the calculator.

Solution is : {x = 1, y = 2, z = –1}

Example 7
Consider the following system of simultaneous equations math \\ . \qquad kx - y + z = 8 \qquad \big[ \textbf{1} \big] \\ . \qquad 3x + ky + 2z = 2 \qquad \big[ \textbf{2} \big] \\ . \qquad \; x + 3y + z = -6 \qquad \big[ \textbf{3} \big] math

For which values of k is there
 * 1) a unique solution
 * 2) an infinite number of solutions
 * 3) no solutions


 * Solution:**

We could od this agebraically by solving the equations to get an expression for k.

Or we could use the idea that when the determinant equals zero, there are no unique solutions.

Write in matrix form: math . \qquad \left[ \begin{matrix} k&-1&1 \\ 3&k&2 \\ 1&3&1 \\ \end{matrix} \right] \left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right] = \left[ \begin{matrix} 8 \\ 2 \\ -6 \\ \end{matrix} \right] math Use the calculator to find the determinant {__**det**__ is in the ACTION menu, MATRIX-CALCULATION submenu}

Set the determinant to zero and solve for k math \\ . \qquad k^2 - 7k + 10 = 0 \\ . \qquad \big( k-2 \big) \big( k-5 \big) = 0 \\ . \qquad k = 2 \quad or \quad k = 5 math

Hence there are no unique solutions for k = 2, 5

math . \qquad k \in R \backslash \big\{ 2, \, 5 \big\} math
 * (1) Hence there are unique solutions for **

Substitute ** k = 2 ** into the equations math \\ . \qquad 2x - y + z = 8 \qquad \big[ \textbf{1} \big] \\ . \qquad 3x + 2y + 2z = 2 \qquad \big[ \textbf{2} \big] \\ . \qquad \; x + 3y + z = -6 \qquad \big[ \textbf{3} \big] math Put these into the calculator and solve. Gives us {x = f(z), y = g(z), z = z} {where f and g are linear functions}

This means that for k = 2, there is a solution for every z in R.


 * (2) Hence there is an infinite number of solutions when k = 2 **

Substitute ** k = 5 ** into the equations math \\ . \qquad 5x - y + z = 8 \qquad \big[ \textbf{1} \big] \\ . \qquad 3x + 5y + 2z = 2 \qquad \big[ \textbf{2} \big] \\ . \qquad \; x + 3y + z = -6 \qquad \big[ \textbf{3} \big] math Put these into the calculator and solve Gives us {No Solution}


 * (3) Hence there are no solutions when k = 5 **

.