unexpected behavior of divide



There is a 3rd argument to divide, which you have left out.
The two results from divide(a,b,x)  are the quotient and remainder from
the division of polynomials a by b in the ring Q[x], where Q is a field 
of rational functions in all the other variables.
Thus the quotient and remainder are in Q, which is in general rational 
functions.
If divide is given just two arguments  (i.e. x is unspecified)  I think 
it picks one variable for x.


I haven't looked at your example in detail, so I am not positive what 
you are finding. But I hope this makes sense to you (and other readers...)

RJF

On 9/21/2011 7:08 AM, andre maute wrote:
> Hi list,
>
> suppose we have the following,
> polynomial division, r1 is the remainder,
> but why is f1 a rational function?
>
> Regards
> Andre
>
> ------------------------------------------
> Maxima 5.19.2 http://maxima.sourceforge.net
> Using Lisp SBCL 1.0.40-1.fc14
> Distributed under the GNU Public License. See the file COPYING.
> Dedicated to the memory of William Schelter.
> The function bug_report() provides bug reporting information.
> (%i1)                      batch(divide-test-1.max)
>
> batching /home/user/divide-test-1.max
> (%i2)                          display2d : false
> (%o2) false
> (%i3) h0:2*b1^2+4*a2*b2-4*a2^2*b2+4*b1*b2+2*b1^2*b2+4*a2*b2^2-4*a2^2*b2^2
>                
> +4*b1*b2^2+2*b1^2*b2^2-2*b2^3+4*b1*b2^3+2*a2*d-2*a2^2*d+2*b1*d
>                -b1^2*d-4*a2^2*b2*d+2*b1^2*b2*d-5*b2^2*d-4*a2*b2^2*d
>                +6*b1*b2^2*d-a2*d^2-a2^2*d^2-b1*d^2+b1^2*d^2-4*b2*d^2
>                -4*a2*b2*d^2+4*b1*b2*d^2-d^3-a2*d^3+b1*d^3
> (%o3) b1*d^3-a2*d^3-d^3+4*b1*b2*d^2-4*a2*b2*d^2-4*b2*d^2+b1^2*d^2-b1*d^2
>             -a2^2*d^2-a2*d^2+6*b1*b2^2*d-4*a2*b2^2*d-5*b2^2*d+2*b1^2*b2*d
>             -4*a2^2*b2*d-b1^2*d+2*b1*d-2*a2^2*d+2*a2*d+4*b1*b2^3-2*b2^3
>             
> +2*b1^2*b2^2+4*b1*b2^2-4*a2^2*b2^2+4*a2*b2^2+2*b1^2*b2+4*b1*b2
>             -4*a2^2*b2+4*a2*b2+2*b1^2
> (%i4) [f1,r1]:factor(divide(h0,(2+b2-b1)*(2*b2+d)))
> (%o4) 
> [(b1*d^2-a2*d^2-d^2+2*b1*b2*d-2*a2*b2*d-2*b2*d+b1^2*d-b1*d-a2^2*d-a2*d
>               
> +2*b1*b2^2-b2^2+2*b1*b2-2*a2^2*b2+2*a2*b2-b1^2+2*b1-2*a2^2+2*a2)
>         /(b2-b1+2),2*b1^2*(b2+1)^2]
> (%o4) "/home/user/divide-test-1.max"
> --------------------------------------------------------
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima