Linear Algebra with the TI-89 Calculator

By: Andrew Orlando gtg844y

Table of Contents:

Introduction:

Tired of pages that tell you the obvious such as "Do you homework", "Go to lecture" and "Flush the toilet when you're done"? Tired of flashing scrolling animated nonsense? How about a page that can actually help you? You've come to the right place.

In Morley's class you are allowed to use calculators on the exams, even a TI-89. This powerful calculator has built-in functionality for quite a bit of the Calc 2 and linear algebra material covered in class. You still need to learn the material, but if you know how to use your calculator you can check your answers and avoid stupid mistakes (very possible with the amount of computation for some stuff). You'll also soon see that Morley is a big fan of Mathematica and Matlab, he'll also tell you that nobody does this stuff by hand in the real world. This is about the TI-89 since that's the calculator I have, but some of this is possible on others too. If you're any major that requires much math it doesn't make much sense to have a crappy calculator anyhow.

Data entry:

Of course you have to be able to enter matrices and vectors before you can do much. There's more than one way, but I'll just talk about the quicker/easier way I prefer.

Press the yellow "2nd" button and then press the opening bracket button (second function of the "," button above the 9). Next enter each element of the first row of the matrix seperated by commas. When the row is done, press 2nd then 9 to insert an ; indicating that you're starting the next row. Once the last row is done press 2nd and then the division button (2nd function is close bracket) to complete the matrix.

Now, you probably want to store the matrix in a variable. You can pick whatever but I usually just choose "a". Press "STO->" then the purple "alpha" button the the = button (2nd function a char). Press ENTER and you see the output screen above showing the matrix in a very readable format and showing that it was saved to the variable a. It's a good idea to check and make sure you didn't hit the wrong button before you go on. Also note that you can use variables instead of numbers, or mixed with them as elements.

With a vector you just have one element in each row:

Row Reduction:

This represents the bulk of the "grunt work" calculations in Calc2 where errors can be common. There are several ways to row reduce on the TI-89. I'll start by a slower method that's more similar to what you'd do by hand. This involves the function mRowAdd(numberToMultBy, matrix, rowToMult, destinationRowToAddTo). Let's start with this matrix:



Looks like we can eliminate the 1st element of both the 2nd and 3rd rows by multiplying the first row by 1/2 and adding it two the second and third rows. Press 2nd, goto Math, goto Matrix, goto Row Ops, choose mRowAdd( and hit enter. Filling in the arguments, the first is what we multiply the row we're going to add by. We chose 1/2 so enter that followed by a comma. The next argument is the name of our matrix, we chose a so enter that. Next is the row we're multiplying. This is the first one so enter 1. Now, the last argument is the row to add the multiplied row to. We repeat this, once for 2 and again for 3. Also, to keep all your changes to the matrix you need to store it again. So after the closing paranthesis press STO-> and then enter "a1" so we don't wipe out the old matrix. Sometimes you may want to check to make sure you're actually eliminating elements before saving the new array (just go up into the outputs and paste the correct command that worked, and add the STO part). Looks like this now:





Now it is obvious that simply adding the 2nd row to the third will further reduce, so use "1" as what you're multiplying by.



Now it's row reduced! It's possible to do this in one step too. The "ref" function puts a matrix in Row Echelon Form. Basically what we did but it ensures that the first non-zero element of each row is 1. You can find this function in the same Math -> Matrix menu mentioned earlier. Looks like this:



There's also rref which is "Reduced Row Echelon Form". It goes as far as ref but then goes backwards up the matrix from the bottom row trying to eliminate other elements in upper rows by multiplying a lower row then adding it to a row above it. See:

Length of vector:

The name of the function to get what's called the length of a vector in class is called "norm". Lets do Ch5 page 13 #1.14. Enter the vector. Next, press 2nd then 5 (MATH), then go to Matrix, then all the way down to Norms, then select "norm(" and press ENTER to copy it to the input line. Fill in the vector you saved above to v as the single vector "norm(v)". Even with imaginary values there was still a real length. This works with real numbers too of course. Also note that you might find sqrt(32) if you did it by hand, this simplifies to 4 * sqrt(2) which the calculator gets (always simplifies).

Image:

Lets do problem 2 on quiz 4. I got full credit so this should be right. You're to use the matrix A below and find a system of equations that describe its image, as well as a parameterization of the image. Entering the matrix (went ahead an augmented it with b variables so we can get system of eqns):



Now you want to row reduce. There's more than one way, but you can still get two equations that are set equal to zero. I got something like what you can see below:



So 0 = (-9/7)b1 + (4/7)b2 + b3 and 0 = b1 - b3 + b4 are two equations that describe the image together. You can also see from your row reduced matrix that there are only two pivot columns. The question just asked for any parameterization of the image, so save time and just take the first column times s plus the second column times t as your parameterization.

Transpose:

This is easy. Just enter a matrix (I'll just call it a again):



On the input line, press the purple "alpha" button then the variable name of the matrix you want the transpose of (I used a). Now press 2nd, MATH (5 button), go down to 4: Matrix, and press ENTER at the top entry "1: T". You see something that looks like a raised to the T power on the input line. Press enter to see the transpose. As always, you could use STO->b to store it in b or whatever else you want.



Inverse:

This is just as easy as finding the transpose. Let's try the matrix shown below:



You're going to raise it to the -1 power. Press the ^ button, then open parenthesis (, then -1, then closed paranthesis). So you have a^(-1). Now hit enter and see the inverse:



There's actually another way to do this which is sorta like how you can do it by hand. Basically, you augment the matrix you want to invert with the identity matrix of the same size then turn the left side (original matrix) into reduced row echelon form (rref, should look like identity matrix when done). If you can't do this it may not be possible to get the inverse of the matrix (not onto and one-to-one). See below (look at what right side became!):



Least Squares:

Here's the fast way to do it. Let's do problem 3 on quiz 4. You want to find a quadratic function to fit the given data. Using the matrix and vector below I got full credit, so enter these:





We need to find (A Transpose)(A) x = (A Tranpose)b. Actually, the question only asks to set up the equations. That looks like this:



Note that the last column is ATb and is augmented to the larger matrix AT A. This represents a system of equations. For example, the first row translates to the equation 979a + 225b + 55c = 91. We can use the super awesome powers of the TI-89 to solve this even though we don't have to:



It is clear from this matrix that we get the equations a = 3/7, b = -111/35, c = 7. So, our quadratic would be y = (3/7)x^2 -(111/35)x + 7.

Eigen Vectors/Values:

I'm going to work through problem 1.2 in Ch5 page 11 in the Linear Algebra Book.

First input the matrix A they give us:

"a) Find the characteristic polynomial of A and give its roots.":

Short way: Press 2nd, MATH (5 button), then goto Matrix then down to "eigenVl(". Hit enter to copy it to the input line. Fill in the function with "a" and ")". Hit enter to see the screen below. Note that the -2.E-14 is really zero since it is approximating. See below to prove it is really zero.



Long way: So we need to find the determinant of ( A - lambda * I ). A is the matrix we entered above. Lambda is just some single variable. I is the identity matrix the size of A (3 by 3). We can do this:

For the identity function press 2nd then MATH then go down to Matrix and press ->, then go to identity. Press ENTER to put it on the input line. Put 3 as the single argument to this function for the 3x3 Identity matrix. You can use anything in place of Lambda, but if you do what that press 2nd then CHAR (+ button), then in Greek scroll down to it.

Now to get the determinant go back into the menu with Identity and choose "det(" instead. Press enter to copy it into the input line. We want to get the determinant of what we just did above, so you can press the up arrow once to highlight the last output and then hit ENTER to copy it into the input line. Enter the closing parenthesis ). This is the "characteristic polynomial of A".


So we need to find the roots or zeroes of this. What will make it equal to zero. There is a function called "zeroes" that takes in an expression and what variable you want to solve it for equal to =. Press F2 to get into the Algebra menu. Copy "zeroes(" into the input line. Copy the output above as described earlier. Enter "," followed by the variable you used for lambda and a closing paranthesis. Due to how the calculator showed the polynomial before the roots were obvious anyhow.


"a) Find the eigen values of A, and for each eigenvalue give a basis for the corresponding eigenspace.":

The eigenvalues are just the roots found above. The second part is just asking for the eigenvectors. For the eigenvectors we want to solve for Kernal(A - eigenvalue * I). See below for eigenvalue -4:


Now row reduce with 2nd, MATH, Matrix, "ref(". Copy the output matrix above:


Oh noes, we have a free variable. We can see here that z = 0, let y = y, and then x = -y since x + y + 0 = 0. Parameterized the eigenvalue must look like this:


You can just use [-1;1;0] for a basis and that works. Do the same thing for the other eigenvalues.



It's also worth noting that you can quickly get approximate (floating point) eigenvectors in one operation on A. Do 2nd, Math, Matrix, eigenVc(a). You get:


This doesn't look quite like what we got, but if you look at the parameterized solutions you could reach these vectors. Notice it returns a matrix, each column is an eigenvector. Looking at the second one we can see the the first and second rows are half the third row. Looks like [1/2;1/2;1] doesn't it? I would NOT use this method as your answer on a quiz with no work however. Doesn't really show that you have any idea what's going on.

"c) What are the algebraic and geometric multiplicities of each of the eigenvalues?":

In the characteristic polynomial when simplified, had anything like (lambda + 3) been raised to a power the algebraic multiplicity would be that power. Here its just one, there's just one zero, -3, and -4. Geometric multiplicity is how many linearly independent eigen vectors we have. It has to be less than or equal the algebraic multiplicity and greater than 0 so it must be one. Also, try the number of columns in A (3) minus the rank of A - eigenval * I. 3-2 = 1 for each eigenvalue.

"d) Compute the trace of A":

Just add the diagonal elements from the topleft to the bottomright. -3 + -3 + -1 = -7. Note that this equals the sum of the eigenvalues, another way to check our work.

Links:

This is what you may feel like in Calc2 (I know I did), but hang in there!

How I felt in calc2