Up | Next | Prev | PrevTail | Tail |
pf(\(\langle \)exp\(\rangle \),\(\langle \)var\(\rangle \))
transforms the expression \(\langle \)exp\(\rangle \) into a list of partial fractions with respect
to the main variable, \(\langle \)var\(\rangle \). 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 each
… sum
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.
Up | Next | Prev | PrevTail | Front |