PF(⟨exp⟩,⟨var⟩) transforms the expression ⟨exp⟩ into 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
If you want the denominators in factored form, use off exp;. Thus, with 2/((x+1)^2*(x+2)) in the workspace, the commands off exp; pf(ws,x); give the result
To recombine the terms, FOR EACH… SUM can be used. So with the above list in the workspace, for each j in ws sum j; returns the result
Alternatively, one can use the operations on lists to extract any desired term.