determine if expression is polynomial P(x,y/Q(x,y)
Subject: determine if expression is polynomial P(x,y/Q(x,y)
From: nijso beishuizen
Date: Sat, 25 Feb 2012 19:53:58 +0100
Thank you for your input. I realize now that it is more difficult than I thought, because some input that could be rewritten to P/Q will not be recognized in my simple algorithms. Anyway, when the expression is already of the form P/Q, then polynomialp will do the trick.
I will have to think about the cases where the expression can be rewritten to P/Q and see if there are other properties that I can use to detect (some of) these as well.
Date: Sat, 25 Feb 2012 12:34:43 -0500
Subject: Re: [Maxima] determine if expression is polynomial P(x,y/Q(x,y)
From: macrakis at alum.mit.edu
To: nijso at hotmail.com
CC: maxima at math.utexas.edu
It is very easy to determine whether an expression is of the form P(x,y)/Q(x,y), where P and Q are polynomials in a given list of variables:
ratfunp(ex,vars) := polynomialp(num(ex),vars) and polynomialp(denom(ex),vars)$
If you need them, polynomialp has additional arguments that let you specify symbolic parameters etc. so that you can consider (a*x+1)/(b*y-1) a polynomial in variables x and y, with parameters a and b.
Other people's solutions test whether an expression can be written in the form P(x,y)/Q(x,y) -- a problem which is in the general case unsolvable, but in many practical cases perfectly tractable. But beware of things like trigonometric identities (as RJF says), radicals, etc.
-s
On Sat, Feb 25, 2012 at 09:02, nijso beishuizen <nijso at hotmail.com> wrote:
Dear all,
The problem I am dealing with now is related to my previous question about determining if an expression is polynomial. I now want to determine if an expression is of the form P(x,y)/Q(x,y), where P and Q are bivariate polynomials in x and y. Like my previous problem, it should also accept expressions that contain e.g. sin(x) but then return something meaningful when it is not a polynomial.
I think this can be done by putting the expression in CRE form and determine the numerator and denominator using Q:ratdenom(expr) and P:ratnumer(expr).
If I call showratvars(Q), will Q then always be a polynomial in x and y if it returns [x,y]?
Regards,
Nyso
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima