login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #309 partial fraction with unknown constants revision 3 of 3

1 2 3
Editor: kratt6
Time: 2007/12/28 14:16:53 GMT-8
Note:

added:

From kratt6 Fri Dec 28 14:16:52 -0800 2007
From: kratt6
Date: Fri, 28 Dec 2007 14:16:52 -0800
Subject: 
Message-ID: <20071228141652-0800@axiom-wiki.newsynthesis.org>

Category: Axiom User Interface => Axiom Library 


Submitted by : (unknown) at: 2007-11-17T22:24:33-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

This example is from Ulrich Schwardmann: Computeralgebra-Systeme, Addison-Wesley, 1995, p127f. It tries to compute a partial fraction of a fraction with unknown constants. The result is not the expected partial fraction decomposition, and does not seem to have any other senseful interpretation (it is q/x).

Following is a verification of the partial fraction that macsyma computes.

axiom
q:=(x+a)/(x*(x**3+(b+c)*x**2+b*c*x))

\label{eq1}{x + a}\over{{x^4}+{{\left(c + b \right)}\ {x^3}}+{b \  c \ {x^2}}}(1)
Type: Fraction(Polynomial(Integer))
axiom
partialFraction(q,x)

\label{eq2}{{{- b + a}\over{{{b^2}\  c}-{b^3}}}\over{x + b}}+{{{c - a}\over{{c^3}-{b \ {c^2}}}}\over{x + c}}+{{{{{{{\left(b - a \right)}\  c}-{a \  b}}\over{{b^2}\ {c^2}}}\  x}+{a \over{b \  c}}}\over{x^2}}(2)
Type: PartialFraction?(UnivariatePolynomial(x,Fraction(Polynomial(Integer))))
axiom
(c-a)/((c^3-b*c**2)*(x+c))-(b-a)/((b**2*c-b**3)*(x+b))+((b-a)*c-a*b)/(b**2*c**2*x)+a/(b*c*x**2) - q

\label{eq3}0(3)
Type: Fraction(Polynomial(Integer))

it seems that it is better to use partialFraction$PartialFraction. I did it as follows:

axiom
SUP FRAC POLY INT has EUCDOM

\label{eq4} \mbox{\rm true} (4)
Type: Boolean
axiom
den := univariate((x*(x**3+(b+c)*x**2+b*c*x)),x)::SUP FRAC POLY INT

\label{eq5}{?^4}+{{\left(c + b \right)}\ {?^3}}+{b \  c \ {?^2}}(5)
Type: SparseUnivariatePolynomial?(Fraction(Polynomial(Integer)))
axiom
num := univariate(x+a,x)::SUP FRAC POLY INT

\label{eq6}? + a(6)
Type: SparseUnivariatePolynomial?(Fraction(Polynomial(Integer)))
axiom
partialFraction(num, factor den)$PartialFraction SUP FRAC POLY INT

\label{eq7}{{{- b + a}\over{{{b^2}\  c}-{b^3}}}\over{? + b}}+{{{c - a}\over{{c^3}-{b \ {c^2}}}}\over{? + c}}+{{{{{{{\left(b - a \right)}\  c}-{a \  b}}\over{{b^2}\ {c^2}}}\  ?}+{a \over{b \  c}}}\over{?^2}}(7)
Type: PartialFraction?(SparseUnivariatePolynomial?(Fraction(Polynomial(Integer))))

Does this suggest that the bug is in PartialFractionPackage?

Axiom chooses the "wrong" signature --kratt6, Sat, 12 Aug 2006 05:09:42 -0500 reply
The reason for the behaviour described above is quite simple to explain - unfortunately...

There are two operations partialFraction with two arguments:

    partialFraction: (R, FRR) -> %
      ++ partialFraction(numer,denom) is the main function for
      ++ constructing partial fractions. The second argument is the
      ++ denominator and should be factored.

from the exposed domain PartialFraction and:

      partialFraction: (FPR, Symbol) -> Any
         ++ partialFraction(rf, var) returns the partial fraction decomposition
         ++ of the rational function rf with respect to the variable var.

from the unexposed package PartialFractionPackage. Of course, the interpreter chooses the exposed domain, which produced the surprising result.

This shows that overloading should be done very carefully. I think we should rename the operations in PartialFractionPackage.

Martin

Martin

Maybe it's enough to expose PartialFractionPackage? --Christian Sievers, Tue, 15 Aug 2006 10:48:13 -0500 reply
(Sorry for not first testing a simpler example...)

I came to the same result this weekend. It seems to me from first tests that it would suffice to just also expose PartialFractionPackage?. However I don't know axiom good enough to see if there are any unwanted side effects.

axiom
)expose PFRPAC
PartialFractionPackage is now explicitly exposed in frame initial partialFraction((x+a)/(x*(x**3+(b+c)*x**2+b*c*x)),x)

\label{eq8}{{{- b + a}\over{{{b^2}\  c}-{b^3}}}\over{x + b}}+{{{c - a}\over{{c^3}-{b \ {c^2}}}}\over{x + c}}+{{{{{{{\left(b - a \right)}\  c}-{a \  b}}\over{{b^2}\ {c^2}}}\  x}+{a \over{b \  c}}}\over{x^2}}(8)
Type: PartialFraction?(UnivariatePolynomial(x,Fraction(Polynomial(Integer))))
axiom
partialFraction(1,10)

\label{eq9}{1 \over 2}-{2 \over 5}(9)
Type: PartialFraction?(Integer)

not yet applied --kratt6, Fri, 28 Dec 2007 14:16:40 -0800 reply
Category: Axiom Mathematics => Axiom User Interface Status: open => fix proposed

there are in fact two (different) fixes proposed... Should be reconsidered

Category: Axiom User Interface => Axiom Library