Re: Converting to and from partial fractions

Martin Rubey <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
"Alasdair McAndrew" <[email protected]> writes:

> This is an example of where Axiom's handling of domains fries my limited
> brain.

Never say such things.

> ex:=z/(z-1)+2*z/(z-3)
> 
> (Result is returned as a single polynomial fraction.)

Yes. That's the "canonical form" for FRAC POLY INT.

> Now, what I want to do is to break this single fraction up into its original
> components.  The canonical way to do this (for my purposes), is to divide
> the fraction by z, form partial fractions, and multiply through by z.  Here
> goes:
> 
> exf:=partialFraction(ex/z::FRAC POLY INT,z)$PFRPAC(INT)
> 
> Now, because the result is returned as a partial fraction,if I try
> 
> nthFractionalTerm(exf,1)*z
> 
> I don't get 2*z/(z-3), but 2+6/(z-3).  So I need to remove this term from
> its partialFraction domain.
> 
> But none of nthFractionalTerm(exf,1)::FRAC POLY INT,

Look at the type of nthFractionalTerm(exf,1) and you'll see why: axiom is too
stupid to go the long way from 

    PartialFraction UnivariatePolynomial(z,Fraction Polynomial Integer)

to 

    FRAC POLY INT

Using HyperDoc, you can browse the operations of PartialFraction, select coerce
(for which :: is syntactic sugar) and find that it has a coercion 

    PartialFraction R -> Fraction R

Thus

    nthFractionalTerm(exf,1)::FRAC UP(z,FRAC POLY INT)

will do what you want.

Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.