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 <[email protected]> wrote:
> Thank you for your reply.
> But so is there any way to check if the expressions are equivalent?
>
> On 20 ноя, 05:05, BFJ <[email protected]> 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 <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to