Re: [sage-devel] Simple integral raises AttributeError

2019-12-09 Thread Dima Pasechnik
On Mon, Dec 9, 2019 at 1:55 PM Thierry  wrote:
>
> Hi,
>
> On Wed, Dec 04, 2019 at 07:38:34AM -0800, Eric Gourgoulhon wrote:
> > Hi,
> >
> > In Sage 9.0.beta8 we have
> >
> > sage: a = var('a')
> > sage: integrate(1/(x^4 + x^2 + a), x)
> > ...
> > AttributeError: 'RootSum' object has no attribute '_sage_'
> >
> > The same error occurs in Sage 8.9, but not in Sage 8.8 (and below). In Sage
> > 8.8, we have instead:
> >
> > sage: a = var('a')
> > sage: integrate(1/(x^4 + x^2 + a), x)
> > integrate(1/(x^4 + x^2 + a), x)

Fricas just returns the answer in radicals, if you call
sage:  integrate(1/(x^4 + x^2 + a), x, algorithm='fricas')

with
sage:  integrate(1/(x^5 + x^3 + a), x, algorithm='fricas')
one gets an error, for a reason similar to the RootSum thing for sympy
(i.e. it can express the integral as a sum over roots of a polynomial, it's
just Sage doesn't know how to parse it)

> >
> > Note that RootSum is a SymPy object. Actually, in Sage 9.0.beta8, forcing
> > the algorithm to 'maxima' yields the same result as in Sage 8.8:
> >
> > sage: integrate(1/(x^4 + x^2 + a), x, algorithm='maxima')
> > integrate(1/(x^4 + x^2 + a), x)
> >
> > So it seems that since Sage 8.9, when integrate() is not capable to find an
> > answer via Maxima, it tries SymPy but is not capable to translate the
> > result back to Sage. I could not find a ticket about this. Shall I open one?
>
> For what it worth, the change was done at
> https://trac.sagemath.org/ticket/27958
>
> Ciao,
> Thierry
>
>
> > Eric.
> >
> > PS: for the record, a primitive of 1/(x^4 + x^2 + a) is
> >
> > sage: b = sqrt(1 - 4*a)
> > sage: f = sqrt(2)/b*(arctan(sqrt(2)*x/sqrt(1 - b))/sqrt(1 - b)  -
> > arctan(sqrt(2)*x/sqrt(1 + b))/sqrt(1 + b))
> >
> > as we can check:
> >
> > sage: diff(f, x).simplify_full()
> > 1/(x^4 + x^2 + a)
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sage-devel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to sage-devel+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/sage-devel/5e7fbd5a-f422-4268-b2fb-f77d58c4a2e2%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/20191209135522.n7ymn5yfpcurdppq%40metelu.net.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq1MyN0pUea%2Bbg1F0fFRKwzbo2F-fNuchURGHJq8FEpD0A%40mail.gmail.com.


Re: [sage-devel] Simple integral raises AttributeError

2019-12-09 Thread Thierry
Hi,

On Wed, Dec 04, 2019 at 07:38:34AM -0800, Eric Gourgoulhon wrote:
> Hi,
> 
> In Sage 9.0.beta8 we have
> 
> sage: a = var('a')
> sage: integrate(1/(x^4 + x^2 + a), x)
> ...
> AttributeError: 'RootSum' object has no attribute '_sage_'
> 
> The same error occurs in Sage 8.9, but not in Sage 8.8 (and below). In Sage 
> 8.8, we have instead:
> 
> sage: a = var('a')
> sage: integrate(1/(x^4 + x^2 + a), x)
> integrate(1/(x^4 + x^2 + a), x)
> 
> Note that RootSum is a SymPy object. Actually, in Sage 9.0.beta8, forcing 
> the algorithm to 'maxima' yields the same result as in Sage 8.8:
> 
> sage: integrate(1/(x^4 + x^2 + a), x, algorithm='maxima')
> integrate(1/(x^4 + x^2 + a), x)
> 
> So it seems that since Sage 8.9, when integrate() is not capable to find an 
> answer via Maxima, it tries SymPy but is not capable to translate the 
> result back to Sage. I could not find a ticket about this. Shall I open one?

For what it worth, the change was done at
https://trac.sagemath.org/ticket/27958

Ciao,
Thierry


> Eric. 
> 
> PS: for the record, a primitive of 1/(x^4 + x^2 + a) is
> 
> sage: b = sqrt(1 - 4*a)
> sage: f = sqrt(2)/b*(arctan(sqrt(2)*x/sqrt(1 - b))/sqrt(1 - b)  - 
> arctan(sqrt(2)*x/sqrt(1 + b))/sqrt(1 + b))
> 
> as we can check:
> 
> sage: diff(f, x).simplify_full()
> 1/(x^4 + x^2 + a)
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/5e7fbd5a-f422-4268-b2fb-f77d58c4a2e2%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/20191209135522.n7ymn5yfpcurdppq%40metelu.net.


Re: [sage-devel] Simple integral raises AttributeError

2019-12-04 Thread Eric Gourgoulhon
Le mercredi 4 décembre 2019 18:37:15 UTC+1, Dima Pasechnik a écrit :
>
> sure, please open a ticket.
>

This is now
https://trac.sagemath.org/ticket/28842
Please review. 

Eric.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/95dfeb17-2c9c-4349-9e75-1c5cedc01789%40googlegroups.com.


Re: [sage-devel] Simple integral raises AttributeError

2019-12-04 Thread Dima Pasechnik
sure, please open a ticket.

On Wed, 4 Dec 2019, 15:38 Eric Gourgoulhon,  wrote:

> Hi,
>
> In Sage 9.0.beta8 we have
>
> sage: a = var('a')
> sage: integrate(1/(x^4 + x^2 + a), x)
> ...
> AttributeError: 'RootSum' object has no attribute '_sage_'
>
> The same error occurs in Sage 8.9, but not in Sage 8.8 (and below). In
> Sage 8.8, we have instead:
>
> sage: a = var('a')
> sage: integrate(1/(x^4 + x^2 + a), x)
> integrate(1/(x^4 + x^2 + a), x)
>
> Note that RootSum is a SymPy object. Actually, in Sage 9.0.beta8, forcing
> the algorithm to 'maxima' yields the same result as in Sage 8.8:
>
> sage: integrate(1/(x^4 + x^2 + a), x, algorithm='maxima')
> integrate(1/(x^4 + x^2 + a), x)
>
> So it seems that since Sage 8.9, when integrate() is not capable to find
> an answer via Maxima, it tries SymPy but is not capable to translate the
> result back to Sage. I could not find a ticket about this. Shall I open one?
>
> Eric.
>
> PS: for the record, a primitive of 1/(x^4 + x^2 + a) is
>
> sage: b = sqrt(1 - 4*a)
> sage: f = sqrt(2)/b*(arctan(sqrt(2)*x/sqrt(1 - b))/sqrt(1 - b)  -
> arctan(sqrt(2)*x/sqrt(1 + b))/sqrt(1 + b))
>
> as we can check:
>
> sage: diff(f, x).simplify_full()
> 1/(x^4 + x^2 + a)
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/5e7fbd5a-f422-4268-b2fb-f77d58c4a2e2%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq3n-qtMCK_QW4L_VKVo%2BifbkMixvtfCynoBGg2VHw8cow%40mail.gmail.com.


[sage-devel] Simple integral raises AttributeError

2019-12-04 Thread Eric Gourgoulhon
Hi,

In Sage 9.0.beta8 we have

sage: a = var('a')
sage: integrate(1/(x^4 + x^2 + a), x)
...
AttributeError: 'RootSum' object has no attribute '_sage_'

The same error occurs in Sage 8.9, but not in Sage 8.8 (and below). In Sage 
8.8, we have instead:

sage: a = var('a')
sage: integrate(1/(x^4 + x^2 + a), x)
integrate(1/(x^4 + x^2 + a), x)

Note that RootSum is a SymPy object. Actually, in Sage 9.0.beta8, forcing 
the algorithm to 'maxima' yields the same result as in Sage 8.8:

sage: integrate(1/(x^4 + x^2 + a), x, algorithm='maxima')
integrate(1/(x^4 + x^2 + a), x)

So it seems that since Sage 8.9, when integrate() is not capable to find an 
answer via Maxima, it tries SymPy but is not capable to translate the 
result back to Sage. I could not find a ticket about this. Shall I open one?

Eric. 

PS: for the record, a primitive of 1/(x^4 + x^2 + a) is

sage: b = sqrt(1 - 4*a)
sage: f = sqrt(2)/b*(arctan(sqrt(2)*x/sqrt(1 - b))/sqrt(1 - b)  - 
arctan(sqrt(2)*x/sqrt(1 + b))/sqrt(1 + b))

as we can check:

sage: diff(f, x).simplify_full()
1/(x^4 + x^2 + a)


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5e7fbd5a-f422-4268-b2fb-f77d58c4a2e2%40googlegroups.com.