Thanks for your reply,

what you show is very surprising.

Another example in which abs() is corrrectly applied (with no common
denominator)

sage: h=((x^2-1)*x/(x^2+1)^2-x/(x^2+1))/sqrt(-(x^2-1)^2/(x^2 + 1)^2 +
1)
sage: h.simplify_radical()
-x/((x^2 + 1)*abs(x))

Best
Loïc

On 27 jan, 21:55, kcrisman <kcris...@gmail.com> wrote:
> On Jan 27, 12:38 pm, Loïc <xl...@free.fr> wrote:
>
>
>
> > Hi list,
>
> > I found a problem with simplify_radical()
>
> > sage: f(x)=asin(2*x/(x^2+1))
> > sage: g=f.derivative();g
> > x |--> -2*(2*x^2/(x^2 + 1)^2 - 1/(x^2 + 1))/sqrt(-4*x^2/(x^2 + 1)^2 +
> > 1)
> > sage: g.simplify_radical()
> > x |--> -2/(x^2 + 1)
>
> > The last answer should be:
>
> > x |--> -2/(x^2 + 1)* (x^2-1)/abs(x^2-1)
>
> > or easier
>
> > x |--> -2/(x^2 + 1)*sign(x^2-1)
>
> Hmm, I'm not sure that's exactly a bug.   Well, at least I don't know
> that the Maxima people would say so.  But here's a simpler example.
>
> sage: h = (2*x^2/(x^2+1)-1)/sqrt(-4*x^2/(x^2+1)^2+1)
> sage: h.simplify_radical()
> 1
> sage: h = ((2*x^2-x^2-1)/(x^2+1))/sqrt((x^2-1)^2/(x^2+1)^2) # same as
> the other one, but common denominators gotten
> sage: h.simplify_radical()
> (x^2 - 1)/abs(x^2 - 1)
>
> So I think that Maxima is treating these two expressions differently
> in that it might be factoring something out of the square root first
> which removes the abs() piece.  Simplification does simplify, after
> all.
>
> Also, FYI, If you look at the documentation, you'll see "DETAILS: This
> uses the Maxima radcan() command."  And it does
>
>         from sage.calculus.calculus import maxima
>         maxima.eval('domain: real$')
>         res = self.parent()(self._maxima_().radcan())
>         maxima.eval('domain: complex$')
>         return res
>
> But maybe it should be treated as a bug after all; I'm starting to
> think so.  In which case we'd want to check it in a newer version of
> Maxima.
>
> - kcrisman

-- 
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

Reply via email to