Partial fraction decomposition program for the TI-85, works also with 
multiple and complex roots, needs only 1113 bytes, by Thomas Kutzschebauch


This partial fraction program works with the method of the coefficient
comparison. It doesn't need to derivate and is that's why much shorter  
than PRTLFRAC.

FEATURES
- works with multiple roots
- works with complex roots and calculates the result in the form
            A*x+B
          ----------
            2
           x +px +q

RUNNING "PARTIAL"
You don't have to define variables outside the program. Simply start it.  
Now you must enter p(x) (the numerator) and q(x) (the denominator).
I have programmed to enter p(x) and q(x) as a vector, that means you
have to enter both with the [,] brackets. I think this is better because 
you have easier access over the keyboard than to the {,} brackets (internally 
I convert it into a list, it's only a user-friendly feature).
Be sure the order of the numerator is lower than the order of the denominator.
Otherwise you will get an error message. 
Don't forget a "0" if it's necessary:
  4      2
 x  + 2 x + 3 x = [1, 0, 2, 3, 0] !
I don't know if it's better to enter the roots or the coefficients of the
denominator. I decided to enter the coefficients, then I calculate the roots
of it. If you wish to change it just modify the program, it's easy.
Then, after a while, you will get the results. The roots and the 
corresponding coefficients in the same order.
You will get the result
                            _
Roots=        [ a, b, b, c, c ] 
Coefficients= [ A,B1,B2,C1,C2 ]

that means

  p(x)             A       B1      B2        C1*x+C2
 ------ = f(x) = -----  + ----- + ------  + ----------
                                       2             _
  q(x)           (x-a)    (x-b)   (x-b)     (x-c)*(x-c)

a - single root
b - double root   _
c - complex root, c - conjugate complex root
 
It makes no sense to tear up the complex roots. I use the form
   
          C1*x+C2
        -----------  
                 _
        (x+c)*(x+c) .             
        
Note: If you want the form       C1         C2
                              -------- + --------                
                                             _
                                (x+c)     (x+c)
just delete line 35 of my program which starts with "2*real j(v) ...".
But nobody uses this form.

Now you see a menu:           
Again: runs the program again     _        2
Trans: You can transform (x+c)*(x+c) into x +px+q
       to get the form
                        C1*x+C2
                       ---------
                         2
                        x +px+q.

Save: For your review you can save the results. The coefficients are 
      stored in "coef" and the roots in "root".
 
Exit: Well, what do you think will happen?

EXAMPLE:
                   3       2
       p(x)     3 x  + 12 x  + 19 x +18
f(x)= ------ = ----------------------------
                4      3       2
       q(x)    x  + 4 x  + 10 x  + 12 x + 5

YOU must enter: p(x)= [3,12,19,18]
                q(x)= [1,4,10,12,5]

YOU will get the result:
Roots=        [ (-1,2), (-1,-2), -1, -1]
Coefficients= [ 2, 3, 1, 2]

That means:
              2x+3                1       2
F(x)=  ---------------------- + ----- + -------
                                              2
       (x+(-1,2))*(x+(-1,-2))   (x+1)    (x+1)
                                                     
Now you can choose "Trans":
        Following is displayed
        Root= (-1,2)
        p= 2
        q= 5

Press "Next" for the next complex root (in this example isn't another),
"Quit" to get to the menu before or "Exit" to exit the program.

             
Now you have this result:             

             2x+3         1         2
    F(x)= ----------- + ------- + -------  
            2                          2
           x + 2x+ 5     (x+1)     (x+1)            

INFORMATON:
used variables: i,j,l,m,o,p,q,v,x
All internally used vectors, matrices and lists will be converted into
real at the end of the program to save memory.


Be free to use, change and copy this program.
If you have any indications, opinions or questions please let me know.

Mail address:             e-mail:
Thomas Kutzschebauch      thomas.kutzschebauch@e-technik.tu-chemnitz.de
Gluckstr. 8               
D-09120 Chemnitz          
Germany

Thomas Kutzschebauch, Technical University of Chemnitz
(FTP: 134.109.132.51 (saturn.hrz.tu-chemnitz.de))
      
And please excuse my English, it's not my first language.                
