Systems of Linear Equations

Part 1.  Unique Solutions

First use a technique you already know to solve the system:

Now use this method:

A  = 
       { {2,  8,  6},  {4,  2,  -2},  {3,  -2,  1} };  
    A // MatrixFormb  =  { 20,  -2,  11}

LinearSolve[A,  b]

Part 2.  Multiple Solutions

Part 3.  Inconsistent Solutions

Part 4.  Mixed Bag

Part 5.  Geometric Interpretations of the Algebraic Equations

When we solve the system x1 + 2*x2  = 16, x1 - x2 = 2, we get

Clear[x1, x2];
\(Solve[\ {x1\  + \ 2*\ x2\  == \ 
          16, \ 
		\ \ \ \ \ \ \ \ \ \ \ \ \ x1\  - \ x2\  == \ 
          2}, \ {x1, \ x2}\ ]\)

If we think of x1 and x2 as variables on the horizontal and vertical axes, respectively, then each equation in the system defines a line.  We can graph those lines:

\(Plot[\ \ {8 - x1/2, \ x1 - 2}, \ {x1, \ \(-5\), \ 20}, \ 

      		\ \ \ \ \ \ \ \ \ \ 
      PlotStyle -> {\ {Dashing[{0.03}], \ RGBColor[1, 0, 0]\ }, 

          			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {Dashing[{0.00}], \ RGBColor[0, 0, 1]}\ \ }, 

      	\ \ \ \ \ \ \ \ \ \ \ \ \ 
      AxesLabel\  -> \ {\ "x1", \ "x2"\ }\ ]\)

Clear[x1, x2];

Now we generalize our system to any systm in two variables with the same constant terms:  ax1 + bx2 = 16, cx1 + dx2 = 2.   (First clear the old values of the variables.)

Clear[a, b, c, d];

Clear[x1, x2];
\(Solve[\ {a*x1\  + \ b*x2\  == \ 
          16, 
		\ \ \ \ \ \ \ \ \ \ \ \ \ c*x1\  + \ d*x2\  == \ 
          2}, \ {x1, \ x2}\ ]\)

To get the same system we had before, we simply define the constants a, b, c, d as in the original system:

a  =  1 b  =  2 c  =  1d  =  -1

We turn now to geometric interpretation of a system with three unknowns.  Recall that any linear equation of the form  ax1 + bx2 + cx3 = d  has a graph that is a plane perpendicular to the vector  (a,b,c).  For example, here is the graph of  x1 + 4x2 + 3x3 = 10:

\(g1\  = \ 
      Plot3D[\ \ \((10\  - \ x1\  - \ 4*x2)\)/3, \ {x1, \ \(-2\), \ 2}, 
        \ {x2, \ \(-2\), \ 2}\ , 

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        PlotRange\  -> \ {\(-3\), \ 9}, 

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        Boxed\  -> \ True, 

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        AxesLabel\  -> \ {\ "x1", \ "x2", \ "x3"\ }, 

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        ViewPoint\  -> \ {2, \ 1, \ 2}\ ]\)

Now we add the graph of 2x1 + x2 - x3 = -3:

\(g2\  = \ 
      Plot3D[\ \ 3\  + \ 2*x1\  + \ x2, \ {x1, \ \(-2\), \ 2}, 
        \ {x2, \ \(-2\), \ 2}\ , 

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        PlotRange\  -> \ {\(-3\), \ 9}, 

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        Boxed\  -> \ True, 

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        AxesLabel\  -> \ {\ "x1", \ "x2", \ "x3"\ }, 

        	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        ViewPoint\  -> \ {2, \ 1, \ 2}\ , 

        		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        DisplayFunction -> Identity]\)Show[g1,  g2,  DisplayFunction  ->  $DisplayFunction]

Finally we add the graph of x1 - x2 + x3 = 3:

\(g3\  = \ 
      Plot3D[\ \ 3\  - \ x1\  + \ x2, \ {x1, \ \(-2\), \ 
          2}, \ {x2, \ \(-2\), \ 
          2}\ , 
	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ PlotRange\  -> \ {\(-3\), \ 
            9}, 
	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Boxed\  -> \ 
          True, 
	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ AxesLabel\  -> \ {\ "x1", \ "x2", \ "x3"\ }, 
	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ViewPoint\  -> \ {2, \ 1, \ 
            2}\ , 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ DisplayFunction -> \ Identity]\)
Show[g1,  g2,  g3,  
      DisplayFunction  ->  $DisplayFunction]

Part 6.  Algebraic Interpretations of the Geometry

Part 7.  Module Summary