Trinomial Factoring Program for the TI-86(85), version 1

After working with the "split the middle term" scheme for factoring trinomials of the form

Ax2 + Bx + C
we begin to recognize a pattern to our efforts. We can codify that pattern in a program for the TI-86. Note that we are assuming that A, B, and C are integers, and that neither A nor C is 0. The image below gives the listing of the TI-86 program. That listing has been modified with the tracing lines on the left to help you identify the ranges of the the IF-THEN and IF-THEN-ELSE constructs in the program, along with the FOR structure.
We start by clearing the screen and getting the three coefficients A, B, and C, from the user. Our goal will be to find F and G so that F*G=A*C and F+G=B. Then we can rewrite the polynomial as Ax2 + Fx + Gx + C.
Next we want to make sure that A is positive. We assume tht we will multiply the entire expressing by D. We start D as 1, but if A is negative, we set D to hold -1 and change the sign on every coefficient.
We will multiply A times C, ignoring the sign of C, to get our goal product. Then, we will search for each pair of factors for that product. We need only look from 1 through the square root of E.
If I goes into E exactly J times, then I and J are factors are factors of E. However, there are different things to do if we are finding the sum or the difference of the factors.
If C is positive then we want the sum, otherwise we will want the difference.
We want the sum to be B, but B could be positive or negative.
If B is negative, then both factors will be negative.
If B is not negative, both factors will be positive.
We have done all that we need to do, go to Lbl W for the next phase.
The ELSE here is for the case where we want a Difference, not a Sum. In this case we just need to know if we can get the right difference. Therefore we need only compare the absolute values.
There are only two possibilities, I-J=B or J-I=B. Choose the right one and set the values for F and G as indicated.
We have done all that we need to do, go to Lbl W for the next phase.
To get here we went through all of the factors of E and did not find one that produced the required sum of difference. Therefore, there is no integer answer.
At Lbl W we have created F and G. Now we need to get the common factor for A and F and the common factor for G and C. This will give rise to the rest of the values in the answer.
We have all the values. Display a template for the values and then the five values themselves.
 

Naturally, one could enter the program into a calculator. However, the file for the program in is available at trifact1.86p. In addition, the TI-85 version is available at trifact1.85p. Depending upon your browser, you should be able to save the file to your disk and then transfer it via TI-Graphlink, assuming you have the program and the required cable.

We conclude this page with few sample runs of the program:
Figure 1
We open the PRGM menu by pressing the key. The result is shown in Figure 1. We press the key to move to Figure 2.
Figure 2
The submenu giving names of programs defined on this calculator is displayed. We are looking for the TRIFACT1 program. Since it is not in the submenu shown on this calculator, we will press the to shift the display until we can see the TRIFACT1 entry.
Figure 3
In Figure 3 the submenu has been shifted so that we see two entries for programs given as TRIFAC. This particular calculator has both the TRIFACT1 and the TRIFACT2 programs on it. Unfortunately, the menu system does not have room for the entire name of the program. Both programs are abbreviated as TRIFAC. However, the programs are listed in alphabetic order. Therefore, we can assume that the first TRIFAC choice is the one we want. We can press to select that item.
Figure 4
Our choice was correct. The calculator has pasted the name TRIFACT1 onto the screen. The calculator is waiting for us to press to start the program.
Figure 5
In Figure 5 the program has started. It has cleared the display and written the heading,
FACTOR Ax2+Bx+C
at the top. In addition, the calculator has printed the prompt A= and the calculator is waiting for our response.
Figure 6
Not only did we supply the value 1 for A, Figure 6 shows that we have entered the value 11 for B and the value 24 for C. These are the coefficients for
x2 + 11x + 24
The calculator is waiting for us to press to accept the value for C and to move on with the program.
Figure 7
Figure 7 shows the answer produced by the program. The template
(Lx+M)(Px+Q)D
is displayed. Then the values for L, M, P, Q, and D are given. From this we can determine that the original problem
x2 + 11x + 24
factors into
(1x+8)(1x+3)1
where the final 1 is not needed. Thus, we obtain
(x+8)(x+3)
Figure 8
The program was completed in Figure 7. To restart it, we press . Figure 8 gives the data entry for the problem
x2 – 10x + 24
Note the negative value for B, namely, – 10.
Figure 9
Figure 9 shows the result, after entering the value for C and pressing . From these values we obtain a factoring of
(1x–6)(1x+2)1
or
(x–6)(x+2)
Figure 10
Figure 10 gives the data entry for the problem
X2 + 9X + 24
Figure 11
The TRIFACT1 program can not factor this trinomial using just integers. The message to that effect is displayed on the screen seen in Figure 11.
Figure 12
Figure 12 gives the data entry for the problem
x2 – 10x – 24
Figure 13
Figure 13 shows the result, after entering the value for C and pressing . From these values we obtain a factoring of
(1x–12)(x+2)1
or
(x–12)(x+2)
Figure 14
Figure 14 gives the data entry for the problem
3x2 + 10x + 8
Figure 15
Figure 15 shows the result, after entering the value for C and pressing . From these values we obtain a factoring of
(1x+2)(3x+4)1
or
(x+2)(3x+4)
Figure 16
Figure 16 gives the data entry for the problem
20x2 + 13x - 21
Figure 17
Figure 17 shows the result, after entering the value for C and pressing . From these values we obtain a factoring of
(5x+7)(4x-3)1
or
(5x+7)(4x-3)

The TRIFACT1 program, given and illustrated above, produces output that asks the user to associate the numeric answers with the coefficients of a standard answer

(Lx+M)(Px+Q)(D)
It is a bit harder to get the TI-86 to produce a really nice looking answer. Extra programming effort is required to generate that better looking output. However, the main algorithm will stay the same. There is another web page, 208604.htm, that presents a listing of the programs needed to generate nicer looking output for the TI-86. That page contains links to the actual program as well as to similar programs for the TI-85 and TI-86.

PRECALCULUS: College Algebra and Trigonometry
© 2000 Dennis Bila, James Egan, Roger Palay