[sage-support] Re: Bug (?) in full_simplify()

2010-11-20 Thread JamesHDavenport
Disclaimer: I do not know the SAGE code here, just general theory.
As BFJ pointed out, there is no 'canonical' form for such expressions,
where 'canonical' means (see 2.3.1, p.79 of Davenport, Siret 
Tournier) that there is a unique representation for every expression.
But there may well be a 'normal' form, in the sense that zero only has
one representation, so you could try full_simplify(A-B)==0 rather than
full_simplify(A)==full_simplify(B).

On Nov 20, 3:57 pm, pevzi pevz...@gmail.com wrote:
 Thank you for your reply.
 But so is there any way to check if the expressions are equivalent?

 On 20 ноя, 05:05, BFJ benjaminfjo...@gmail.com wrote:

  The two expressions you give may be algebraically equivalent, but
  they're not identical. There is no canonical fully simplified form
  for a general algebraic expression, so you can't expect
  full_simplify() to output this non-existant form. If the expressions
  are simple enough, like polynomials, you might, but not in general.

  On Nov 19, 3:31 pm, pevzi pevz...@gmail.com wrote:

   I have two expressions:

   (x/(2*sqrt(x+1)) + 1/(2*sqrt(x+1)*(sqrt(x+1)+1)))
   ((x*(sqrt(x+1)+1)+1)/(2*sqrt(x+1)*(sqrt(x+1)+1)))

   As you see, they are identical, so full_simplify() method should
   return the same result for both expressions. But:

   sage: (x/(2*sqrt(x+1)) + 1/(2*sqrt(x+1)*(sqrt(x
   +1)+1))).full_simplify()
   1/2*(x + sqrt(x + 1))/(sqrt(x + 1) + 1)
   sage: ((x*(sqrt(x+1)+1)+1)/(2*sqrt(x+1)*(sqrt(x
   +1)+1))).full_simplify()
   1/2*(sqrt(x + 1)*x + x + 1)/(x + sqrt(x + 1) + 1)

   Although

   sage: ((1/2*(x + sqrt(x + 1))/(sqrt(x + 1) + 1))/(1/2*(sqrt(x + 1)*x +
   x + 1)/(x + sqrt(x + 1) + 1))).full_simplify()
   1

   Is this really a bug or I misunderstand something?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Bug (?) in full_simplify()

2010-11-20 Thread Mike Hansen
Hello,

On Sat, Nov 20, 2010 at 7:57 AM, pevzi pevz...@gmail.com wrote:
 Thank you for your reply.
 But so is there any way to check if the expressions are equivalent?

You could do this:

sage: a = (x/(2*sqrt(x+1)) + 1/(2*sqrt(x+1)*(sqrt(x+1)+1)))
sage: b = ((x*(sqrt(x+1)+1)+1)/(2*sqrt(x+1)*(sqrt(x+1)+1)))
sage: bool(a==b)
True

--Mike

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Bug (?) in full_simplify()

2010-11-20 Thread pevzi
Oh, thank you very much for the explaination.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org