REDUCE

7.14 PF Operator

pf(exp,var) transforms the expression expinto a list of partial fractions with respect to the main variable, var. pf does a complete partial fraction decomposition, and as the algorithms used are fairly unsophisticated (factorization and the extended Euclidean algorithm), the code may be unacceptably slow in complicated cases.

Example: Given 2/((x+1)^2*(x+2)) in the workspace, pf(ws,x); gives the result

            2      - 2         2  
        {-------,-------,--------------} .  
          x + 2   x + 1    2  
                          x  + 2*x + 1

If you want the denominators in factored form, set the switch exp to off. Thus, with 2/((x+1)^2*(x+2)) in the workspace, the input off exp; pf(ws,x); gives the result

            2      - 2       2  
        {-------,-------,----------} .  
          x + 2   x + 1          2  
                          (x + 1)

To recombine the terms, for eachsum can be used. So with the above list in the workspace, for each j in ws sum j; returns the result

             2  
     ------------------  
                     2  
      (x + 2)*(x + 1)

Alternatively, one can use the operations on lists to extract any desired term.