       Re: Re: rationalize numerator of quotient

• To: mathgroup at smc.vnet.net
• Subject: [mg81213] Re: [mg81208] Re: rationalize numerator of quotient
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Sun, 16 Sep 2007 04:01:43 -0400 (EDT)
• References: <29319569.1189724898261.JavaMail.root@eastrmwml14.mgt.cox.net> <fcdf9p\$plc\$1@smc.vnet.net> <200709150818.EAA28315@smc.vnet.net> <7EB64796-3E91-4153-8BFB-6717780343BE@mimuw.edu.pl> <46EBEA0F.3090705@math.umass.edu>

```An interesting observation, since you seem to be both right and ...
wrong. Right because the documentation says:

?PolynomialExtendedGCD
PolynomialExtendedGCD[poly1,poly2,x] gives the extended GCD of poly1
and poly2 treated as univariate polynomials in x.
PolynomialExtendedGCD[poly1,poly2,x,Modulus->p] gives the extended
GCD over the integers mod prime p. >>

and wrong because:

{f, g} = {2*x^5 - 2*x, (x^2 - 1)^2};
PolynomialExtendedGCD[f, g]
{x^2 - 1, {x/4, -(x^2/2) - 1}}

works fine.

In other words, although this seems to be undocumented,
PolynomialExtendedGCD (as well as many other or maybe even all)
polynomial algebra functions can extract the variable name by
themselves if none is specified. I am not sure whether the fact that
thsi seems to be undocumented (?) is meant to imply that we are not
encouraged to take advantage of this feature?

Andrzej Kozlowski

On 15 Sep 2007, at 23:19, Murray Eisenberg wrote:

> There appears to be a little syntax error in RationalizeDenominator
> as defined in the quoted message below.  Namely, there a missing
> third argument to PolynomialExtendedGCD, which should be t here.
>
>
> Andrzej Kozlowski wrote:
>
>
>> ... The factthat a fraction like:
>> (2 + Sqrt)/(3 - 5*Sqrt)
>> can be uniquely expressed in the form
>> RationalizeDenominator[(2 + Sqrt)/(3 - 5*Sqrt), Sqrt]
>> -(16/41) - (13*Sqrt)/41
>> (where the function RationalizeDenominator is defined by
>> RationalizeDenominator[f_, a_] := Block[{t},
>>   Numerator[f]*
>>      PolynomialExtendedGCD[Denominator[f] /. {a -> t},
>>        MinimalPolynomial[a, t]][[2, 1]] /. t -> a // Expand]
>> )
>> ....
> --
> Murray Eisenberg                     murray at math.umass.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower      phone 413 549-1020 (H)
> University of Massachusetts                413 545-2859 (W)
> 710 North Pleasant Street            fax   413 545-1801
> Amherst, MA 01003-9305

```

• Prev by Date: Re: LegendreP error (bug?) in Mathematica
• Next by Date: Re: Re: rationalize numerator of quotient
• Previous by thread: Re: rationalize numerator of quotient
• Next by thread: Re: Re: rationalize numerator of quotient