Lecture 2 Math 221 

Systems of Equations. 

 

We will look at several example where a systems of linear equations needs to be solved to accomplish the desired task.   

 

We know that two points determine a straight line.  You learned in math 181 a way to find the equation of a straight line.  We will take a slightly different approach of looking at the problem.  One that can be extended to higher degree polynomials.   

 

Example 1 

 

The general equation of a straight line can be given by  

Typesetting:-mrow(Typesetting:-mi(
If we know two points, then we will be able to solve for a and b the unknowns.
 

Here we are just interested in setting up the system of equation to find the unknowns a and b not in finding the unknowns.    

 

We want to find the straight line going through the points (1,2) and (-3,5).  Plugging the unknowns into the equation we arrive at the equations. 

Typesetting:-mrow(Typesetting:-mi(Typesetting:-mrow(Typesetting:-mo(
Let us place the unknowns on the left hand side of the equation and the known on the right.
 

 

Typesetting:-mrow(Typesetting:-mi(                    or          <[1,1],[a,b]> = 2  

Typesetting:-mrow(Typesetting:-mo(<[-3,1],[a,b]> = 5 

 

Another way of looking at the equation is the following. 

Let us look at the first equation  (recall that < *, *> is the inner product of two vectors and write the inner product as the product of a row vector times a column vector. 

<[1,1],[a,b]> = Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(  

and  now the second 

<[-3,1],[a,b]> = Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(
Writing the above in terms of vectors and using  vector equality we haveTypesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(
= Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(
 

 

We now have a convention that will make things look better.  The above can be shorten to read. 

 

Typesetting:-mrow(Typesetting:-mi( 

 

The above notation is motivated by factoring out the common term.   We have a 2 by 2 square array times a column vector equal to a column vector.   In the next section we will find that we have just observed what is ment by a new multiplication.  
To write a row vector in the with(LinearAlgebra) package use the following notation <a|b>.  The | symbol separates the columns.  If you use <a,b> you will get a column vector not a row vector.  
 

> with(linalg):
 

> with(LinearAlgebra):
 

> r1:=<1|1>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> r2:=<-3|1>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

r1 and r2 represent the first and second row of  the array  and we will look at the results of multiplying the row vectors times the unknowns Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( .  The array will be call a 2 by 2 matrix. Also the unknowns can be thought of a a matrix as well as a column vector.   

 

The first set of commands that follows  the vector x below be the dot probuct of r1 and x.  Using the DotProduct command from Maple will place a bar over the a and b.  You should just forget about the bar and read the dot product without the bar.  The best was to look at the dot product is by using . between the row vecto and the column vector.  This is really a multiplication of a row vector  times a column vector.  You have a row vecto with one row and two columns multiplied by a columns vector with two row and one column which will give you a quantity with one row and one column which is a scalar just like the dot product.   

> x:=<a,b>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> DotProduct(r1,x);
 

`+`(conjugate(a), conjugate(b))
 

> r1.x;
 

`+`(a, b) (1.1.1)
 

> DotProduct(r2,x);
 

`+`(`-`(`*`(3, `*`(conjugate(a)))), conjugate(b))
 

> r2.x;
 

`+`(`-`(`*`(3, `*`(a))), b) (1.1.2)
 

We now use the row vectors r1 and r2 to build the matrix from the text discussion above.   

 

> A:=<r1,r2>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

We can write the matrix A with out using the row vectors.  There are two way of building the matrix.  The first one below will list the first row and then the second row.  The second way wil be by columns.  Notice the differences.   

> A1:=<<1|1>,<-3|1>>;
 

Typesetting:-mrow(Typesetting:-mverbatim( (1.1.3)
 

> A2:=<<1,-3>|<1,1>>;
 

Typesetting:-mrow(Typesetting:-mverbatim( (1.1.4)
 

We finish this example by listing the system of equation as two equal vectors.  This is equivlent to the system of equations since two vectors are equal if and only if the entries in the same position are equal.   

> A.x=<2,5>;
 

Typesetting:-mrow(Typesetting:-mverbatim(8"), Typesetting:-mo("=", mathvariant = "normal", fence = "false", separator = "false", stre..." align="center" border="0">
 

>
 

 

Example 2  Quadratic equations 

Next, we  want to  find the quadratic equation that goes through three points.  

For this example we will develop a system of equations that go through the three points  

(1,3), (-2,4) and (-3, 6) 

 

The general equation of the quadratic is given by  

Typesetting:-mrow(Typesetting:-mi(
The first equation is obtained by setting x=1 and y=3 in the above quadratic.  The second equation is obtained by setting x=-2 and y=4 and the final equation is obtained by letting x=-3 and y=6.
 

 

Typesetting:-mrow(Typesetting:-mi(Typesetting:-mrow(Typesetting:-mo(Typesetting:-mrow(Typesetting:-mo(
 

 

Now writing our system in terms of a matrices as we did in example 1 

 

Typesetting:-mrow(Typesetting:-mi(  

 

The quantity  

Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(  

is called a 3x3 matrix   

 

While the quantities Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(  and Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi( are referred to as 3x1 matrices. 

We will be considering how to find the unknowns a, b and c in another lecture. The Matrix C will be built here by row.  In the next example we will use the columns to build the coefficient matrix in Maple 

  

 

> C:=<<1|1|1>,<4|-2|1>,<9|-3|1>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> y:=<a,b,c>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> d:=<3,4,6>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> C.y=d;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

 

>
 

Example 3 

 

The temperature distribution in a thin wire is our next example.   

The temperature at equally spaced points along a wire can be approximated by setting the temperature at a point is equal to the average of the points on either side.  Click on the lecture2f for a development of the system of equations.  Look at fig 1 

 

Now using the notation we have developed in example 1 and example 2 we arrive at the following matrix system 

Typesetting:-mrow(Typesetting:-mi(
Notice the nice pattern of the 4x4 matrix called the coefficient matrix.  You really can not go wrong with in the way you build this matrix in Maple since the rows and columns are the same.  We will learn shortly that CT is a symmetric matrix.  
 

 

> CT:=<<2,-1,0,0>|<-1,2,-1,0>|<0,-1,2,-1>|<0,0,-1,2>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> TT:=<T1,T2,T3,T4>;
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
 

> B:=<10,0,0,44.5>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> CT.TT=B;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

As we know two vectors are equal if the elements are equal which is the same as looking at a system of equation. 

2T1 -T2 =10 

-T1 + 2T2 -T3 =0 

-T2 + 3T3 -T4 =0 

-T3 +2T4 = 44.5 

     

 

Example 4 

 

The following one-way street diagram is a typical in-out system.  We are looking at a closed system.  That is everything that goes in must come out.  The arrows indicate the direction of flow.  We will be setting up the system of equations to find out what the possible flows will be on each of the four intersections of streets given in the diagram.    What goes into a node must equal what comes out of the node.  With this in mind,  we can set up the four equation in the four unknowns to solve the system.  From figure 2 found in the file lecture2f,  we can now write the system in the matrix form.  A 4x1 matrix is also call a column vector which leads to the usual way of describing the problem as a vector matrix set of equations. 

 

Typesetting:-mrow(Typesetting:-mi(  

Again, notice the symmetrical look the coefficient matrix has in the problem.  Many application lead to symmetrical coefficient matrices.  We will find later in the class that having a symmetrical coefficient matrix is a very desirable property.   Since the coefficient matrix in Example 3 was symmetric and you could not tell if we were building the matrix by columns or rwo the coefficient matrix here will be built by columns.   

 

> CC:=<<1,1,0,0>|<1,0,1,0>|<0,1,0,1>|<0,0,1,1>>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> t:=<x1,x2,x3,x4>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> p:=<80,65,75,60>;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

> CC.t=p;
 

Typesetting:-mrow(Typesetting:-mverbatim(
 

>
 

Homework problems to be turned in.  Use Maple to work each problem.  They are due on Monday September 8, 2008.  You may e-mail me your *.ms file or hand in a hard copy to me in the class-room between 1:10-2:00  You must include you name at the top of the worksheet.  

 

Problems 1.2.5, 1.2.19, 1.2.23, 1.2.25  

 

Your worksheet should be saved in the same manner as in the first lecture.  If you login name is ims0001 then the worksheet should be saved as lecture201,