MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: easy way to represent polynomials (v 7.0)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104672] Re: [mg104620] easy way to represent polynomials (v 7.0)
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 6 Nov 2009 05:18:14 -0500 (EST)
  • Reply-to: hanlonr at cox.net

expr1 = x/(1 + y) + y/x - 1 == 0;

To multiply through by the denominators requires that they not be zero

expr2a = Simplify[expr1, {y != -1, x != 0}]

x^2 + y^2 + y == x*y + x

or

expr2b = Simplify[expr1, Thread[
   DeleteCases[
     Denominator /@ List @@ expr1[[1]],
     _?NumericQ] != 0]]

x^2 + y^2 + y == x*y + x

expr2c = (#*x (1 + y) & /@ expr1) // Simplify

x^2 + y^2 + y == x*y + x

Putting all the terms on one side

expr3a = First[expr2a] - Last[expr2a] == 0

x^2 - x*y - x + y^2 + y == 0

or

expr3b = (expr2a /. Equal -> Subtract) == 0

x^2 - x*y - x + y^2 + y == 0

Collecting terms

expr4a = Collect[expr3a, x]

x^2 + x*(-y - 1) + y^2 + y == 0

or

expr4b = Collect[expr3a, y]

x^2 + (1 - x)*y - x + y^2 == 0


Bob Hanlon

---- kristoph <kristophs.post at web.de> wrote: 

=============
Hi,

is there a way to get a "proper" polynomial representation of results
that Mathematica gives?

Here is a "cooked up" example (my actual results in Mathematica a
fairly complicated expressions):

Suppose the result is:

x/(1 + y) + y/x - 1 = 0

I'm looking for something that gives me:

x^2 - x + y^2 = 0

Thanks in advance
Kris



  • Prev by Date: Monitoring using Mathematica
  • Next by Date: Re: Multi-variable first-order perturbation analysis?
  • Previous by thread: easy way to represent polynomials (v 7.0)
  • Next by thread: Re: easy way to represent polynomials (v 7.0)