Re: [sage-support] Wrong symbolic integral.

2015-05-11 Thread Ralf Stephan
On Monday, May 11, 2015 at 7:57:40 AM UTC+2, Kristoffer Ryhl-Johansen wrote:

 What stops Maxima from evaluating the limit?


Missing asymptotic expansion of dilog, for example.

For the math see 
also http://math.stackexchange.com/questions/1275176/limit-with-polylog
 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] I need to do these basic operations with high-degree polynomials.

2015-05-11 Thread Dima Pasechnik


On Monday, 11 May 2015 06:43:22 UTC+1, Phoenix wrote:


 Here is an example of a real-rooted polynomial generated by my code:

 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 - 
 362880*x^14 + 62208*x^12


 This I know to be real-rooted because I tested this in Mathematica.


well:

sage: p=1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 - 
362880*x^14 + 62208*x^12

sage: p.roots()

[(-2, 2),

 (2, 2),

 (-sqrt(sqrt(3) + 2), 1),

 (sqrt(sqrt(3) + 2), 1),

 (-sqrt(-sqrt(3) + 2), 1),

 (sqrt(-sqrt(3) + 2), 1),

 (-sqrt(3), 1),

 (sqrt(3), 1),

 (-1, 1),

 (1, 1),
 (0, 12)]
 

if all the monomials have even degree you certainly should replace x^2 by 
y...



 In general my code will generate polynomials of degree ~200-300

 Then is there a way to test real-rootedness inside SAGE itseld?

 And given some other number (typically as a squareroot of some other integer) 
 can I test if the largest root is below that threshold? 




 On Sunday, May 10, 2015 at 3:09:48 PM UTC-5, vdelecroix wrote:

 On 10/05/15 21:51, Dima Pasechnik wrote: 
  On Sunday, 10 May 2015 19:11:27 UTC+1, vdelecroix wrote: 
  On 10/05/15 19:43, Dima Pasechnik wrote: 
  A random polynomial for sure won't have the properties your 
 polynomial 
  probably has (e.g. all roots real). 
  
  Nope, but the characteristic polynomial of a random matrix in 
 SL(d,R) 
  would ;-) 
  
  
  really? I'd say a random symmetric matrix in M_d(R), yes, surely, but 
 not 
  in SL_d(R)... 

 Depends on your definition of random. If you pick any non-degenerate 
 generating set and look at a random product of length  d^2 then yes. 

 Though, I do not know for the definition of random as uniform on all 
 matrices in SL_d(R) with coefficients less than N. 

 Vincent 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] I need to do these basic operations with high-degree polynomials.

2015-05-11 Thread Kristoffer Ryhl-Johansen
If you figure out that all roots are real, I'm pretty sure the best you can
do about checking if k is larger than all roots, is to take the smallest of
the bounds on roots here
https://en.wikipedia.org/wiki/Properties_of_polynomial_roots#Bounds_on_.28complex.29_polynomial_roots,
and checking if k is larger than that.

Note that the previous checks the absolute value, so if you don't care
about negative roots, take a look at this paper
http://www.inf.uth.gr/wp-content/uploads/formidable/phd_thesis_vigklas.pdf
or this paper
http://www.jucs.org/jucs_15_3/linear_and_quadratic_complexity. The things
mentioned in those papers should be implemented in sage, but I don't know
where.

man. 11. maj 2015 kl. 07.43 skrev Phoenix anirbit.mukher...@gmail.com:


 Here is an example of a real-rooted polynomial generated by my code:

 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 - 
 362880*x^14 + 62208*x^12


 This I know to be real-rooted because I tested this in Mathematica.


 In general my code will generate polynomials of degree ~200-300

 Then is there a way to test real-rootedness inside SAGE itseld?

 And given some other number (typically as a squareroot of some other integer) 
 can I test if the largest root is below that threshold?




 On Sunday, May 10, 2015 at 3:09:48 PM UTC-5, vdelecroix wrote:

 On 10/05/15 21:51, Dima Pasechnik wrote:
  On Sunday, 10 May 2015 19:11:27 UTC+1, vdelecroix wrote:
  On 10/05/15 19:43, Dima Pasechnik wrote:
  A random polynomial for sure won't have the properties your
 polynomial
  probably has (e.g. all roots real).
 
  Nope, but the characteristic polynomial of a random matrix in
 SL(d,R)
  would ;-)
 
 
  really? I'd say a random symmetric matrix in M_d(R), yes, surely, but
 not
  in SL_d(R)...

 Depends on your definition of random. If you pick any non-degenerate
 generating set and look at a random product of length  d^2 then yes.

 Though, I do not know for the definition of random as uniform on all
 matrices in SL_d(R) with coefficients less than N.

 Vincent

  --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] I need to do these basic operations with high-degree polynomials.

2015-05-11 Thread Vincent Delecroix
On 11/05/15 07:43, Phoenix wrote:
 
 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 - 
 362880*x^14 + 62208*x

For the number of real roots, you can use PARI/GP (but your polynomial
needs to be square free)

sage: x = polygen(QQ)
sage: p = 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 +
584496*x^16 - 362880*x^14 + 62208*x
sage: for (q,n) in p.squarefree_decomposition():
:print q.degree(), n, gp.polsturm(q)
24 1 4

The command `gp.polsturm` returns the number of real roots of a
squarefree polynomial. The above code shows that the polynomial was
square free. And it has 4 real roots. There is *no* need to compute the
roots to determine the number of them which are real!!

Vincent

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] I need to do these basic operations with high-degree polynomials.

2015-05-11 Thread Phoenix

- What is the best way on SAGE to get all the roots? 

- Can't I just ask SAGE to find the maximum root and tell me its value if 
it sees that all the roots are real? 
  

On Monday, May 11, 2015 at 1:27:04 AM UTC-5, Kristoffer Ryhl-Johansen wrote:

 If you figure out that all roots are real, I'm pretty sure the best you 
 can do about checking if k is larger than all roots, is to take the 
 smallest of the bounds on roots here 
 https://en.wikipedia.org/wiki/Properties_of_polynomial_roots#Bounds_on_.28complex.29_polynomial_roots,
  
 and checking if k is larger than that.

 Note that the previous checks the absolute value, so if you don't care 
 about negative roots, take a look at this paper 
 http://www.inf.uth.gr/wp-content/uploads/formidable/phd_thesis_vigklas.pdf 
 or this paper 
 http://www.jucs.org/jucs_15_3/linear_and_quadratic_complexity. The 
 things mentioned in those papers should be implemented in sage, but I don't 
 know where.

 man. 11. maj 2015 kl. 07.43 skrev Phoenix anirbit@gmail.com 
 javascript::


 Here is an example of a real-rooted polynomial generated by my code:

 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 - 
 362880*x^14 + 62208*x^12


 This I know to be real-rooted because I tested this in Mathematica.


 In general my code will generate polynomials of degree ~200-300

 Then is there a way to test real-rootedness inside SAGE itseld?

 And given some other number (typically as a squareroot of some other 
 integer) can I test if the largest root is below that threshold? 




 On Sunday, May 10, 2015 at 3:09:48 PM UTC-5, vdelecroix wrote:

 On 10/05/15 21:51, Dima Pasechnik wrote: 
  On Sunday, 10 May 2015 19:11:27 UTC+1, vdelecroix wrote: 
  On 10/05/15 19:43, Dima Pasechnik wrote: 
  A random polynomial for sure won't have the properties your 
 polynomial 
  probably has (e.g. all roots real). 
  
  Nope, but the characteristic polynomial of a random matrix in 
 SL(d,R) 
  would ;-) 
  
  
  really? I'd say a random symmetric matrix in M_d(R), yes, surely, but 
 not 
  in SL_d(R)... 

 Depends on your definition of random. If you pick any non-degenerate 
 generating set and look at a random product of length  d^2 then yes. 

 Though, I do not know for the definition of random as uniform on all 
 matrices in SL_d(R) with coefficients less than N. 

 Vincent 

  -- 
 You received this message because you are subscribed to the Google Groups 
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to sage-support...@googlegroups.com javascript:.
 To post to this group, send email to sage-s...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] I need to do these basic operations with high-degree polynomials.

2015-05-11 Thread Dima Pasechnik
well, you didn't paste the correct polynomial:
(the least degree is 12, not 1).
so one gets

sage: for (q,n) in p.squarefree_decomposition(): 

: print q.degree(), n, gp.polsturm(q) 

: 

8 1 8
2 2 2
1 12 1
which gives you 11 real roots, just as computed by .roots()

Right, I forgot about Sturm sequences :-( 
They are certainly way, way more efficient than actual root computation.


On Monday, 11 May 2015 08:28:24 UTC+1, vdelecroix wrote:

 On 11/05/15 07:43, Phoenix wrote: 
  
  1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 - 
 362880*x^14 + 62208*x 

 For the number of real roots, you can use PARI/GP (but your polynomial 
 needs to be square free) 

 sage: x = polygen(QQ) 
 sage: p = 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 
 584496*x^16 - 362880*x^14 + 62208*x 
 sage: for (q,n) in p.squarefree_decomposition(): 
 :print q.degree(), n, gp.polsturm(q) 
 24 1 4 

 The command `gp.polsturm` returns the number of real roots of a 
 squarefree polynomial. The above code shows that the polynomial was 
 square free. And it has 4 real roots. There is *no* need to compute the 
 roots to determine the number of them which are real!! 

 Vincent 


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] I need to do these basic operations with high-degree polynomials.

2015-05-11 Thread Kristoffer Ryhl-Johansen
Of course if it isn't square free, you can fix that by dividing the
polynomial with the greatest common divider of the polynomial and it's
derivative.

man. 11. maj 2015 kl. 12.54 skrev Dima Pasechnik dimp...@gmail.com:

 well, you didn't paste the correct polynomial:
 (the least degree is 12, not 1).
 so one gets

 sage: for (q,n) in p.squarefree_decomposition():

 : print q.degree(), n, gp.polsturm(q)

 :

 8 1 8
 2 2 2
 1 12 1
 which gives you 11 real roots, just as computed by .roots()

 Right, I forgot about Sturm sequences :-(
 They are certainly way, way more efficient than actual root computation.


 On Monday, 11 May 2015 08:28:24 UTC+1, vdelecroix wrote:

 On 11/05/15 07:43, Phoenix wrote:
 
  1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 -
 362880*x^14 + 62208*x

 For the number of real roots, you can use PARI/GP (but your polynomial
 needs to be square free)

 sage: x = polygen(QQ)
 sage: p = 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 +
 584496*x^16 - 362880*x^14 + 62208*x
 sage: for (q,n) in p.squarefree_decomposition():
 :print q.degree(), n, gp.polsturm(q)
 24 1 4

 The command `gp.polsturm` returns the number of real roots of a
 squarefree polynomial. The above code shows that the polynomial was
 square free. And it has 4 real roots. There is *no* need to compute the
 roots to determine the number of them which are real!!

 Vincent

  --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Decimal Answers

2015-05-11 Thread Selah Bryce
How do you find the decimal that is equal to 7950734897590/87

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Decimal Answers

2015-05-11 Thread David Joyner
On Mon, May 11, 2015 at 3:15 PM, Selah Bryce brycs...@hsd.k12.or.us wrote:
 How do you find the decimal that is equal to 7950734897590/87


You don't say how many places you want. There are lots of ways if that
doesn't matter, for example 7950734897590/87.0

 --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Decimal Answers

2015-05-11 Thread kcrisman



  How do you find the decimal that is equal to 7950734897590/87 
  

 You don't say how many places you want. There are lots of ways if that 
 doesn't matter, for example 7950734897590/87.0 


Or N(7950734897590/87) , assuming you haven't redefined N as N=10 or 
something during the session.

(7950734897590/87).n() should always work - n for numerical approx.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Decimal Answers

2015-05-11 Thread Selah Bryce
Thank you. It gave me 9.13877574435632e10. What does that mean?

On Monday, May 11, 2015 at 12:26:32 PM UTC-7, kcrisman wrote:


  How do you find the decimal that is equal to 7950734897590/87 
  

 You don't say how many places you want. There are lots of ways if that 
 doesn't matter, for example 7950734897590/87.0 


 Or N(7950734897590/87) , assuming you haven't redefined N as N=10 or 
 something during the session.

 (7950734897590/87).n() should always work - n for numerical approx.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Decimal Answers

2015-05-11 Thread Michael Orlitzky
On 05/11/2015 03:40 PM, Selah Bryce wrote:
 Thank you. It gave me 9.13877574435632e10. What does that mean?
 

It means 9.13877574435632 times 10^10, or 91387757443.5632.

The e10 at the end is scientific notation. I don't know where the 'e'
came from, but I would guess it stands for exponent and I would bet we
use 'e' because there was no way to write a superscript when hand-held
calculators were invented.

In any case, e10 means move the decimal point 10 places to the right.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Decimal Answers

2015-05-11 Thread Anton Sherwood

On 2015-5-11 17:21, Michael Orlitzky wrote:

The e10 at the end is scientific notation. I don't know where
the 'e' came from, but I would guess it stands for exponent
and I would bet we use 'e' because there was no way to write
a superscript when hand-held calculators were invented.


O youth!  It was used in Fortran about twenty years before that.
(For double precision numbers the E became D, iirc.)

--
*\\*  Anton Sherwood  *\\*  www.bendwavy.org

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] I need to do these basic operations with high-degree polynomials.

2015-05-11 Thread Phoenix

The polynomial is 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 
584496*x^16 - 362880*x^14 + 62208*x^12  

- Can SAGE find the gcd of a polynomial and its derivative? 


 polygen(QQ)#What doe this do? What is QQ# ? 
p = 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 - 
362880*x^14 + 62208*x 
for (q,n) in p.squarefree_decomposition(): 
 print q.degree(), n, gp.polsturm(q) 


Can someone explain what are these q.degree, n and gp.plotsum ? 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] I need to do these basic operations with high-degree polynomials.

2015-05-11 Thread Vincent Delecroix
Did you know that Sage is shipped with documentation?

On 11/05/15 19:30, Phoenix wrote:
 
 The polynomial is 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 
 584496*x^16 - 362880*x^14 + 62208*x^12  
 
 - Can SAGE find the gcd of a polynomial and its derivative? 

http://sagemath.org/doc/reference/polynomial_rings/sage/rings/polynomial/polynomial_element.html#sage.rings.polynomial.polynomial_element.Polynomial.gcd

http://sagemath.org/doc/reference/polynomial_rings/sage/rings/polynomial/polynomial_element.html#sage.rings.polynomial.polynomial_element.Polynomial.derivative

  polygen(QQ)#What doe this do? What is QQ# ? 
 p = 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 - 
 362880*x^14 + 62208*x 
 for (q,n) in p.squarefree_decomposition(): 
  print q.degree(), n, gp.polsturm(q) 
 
 
 Can someone explain what are these q.degree, n

http://sagemath.org/doc/reference/polynomial_rings/sage/rings/polynomial/polynomial_element.html#sage.rings.polynomial.polynomial_element.Polynomial.squarefree_decomposition
Vincent

 gp.plotsum ?

gp.plotsum does not exists this is gp.polsturm. It is a command from
PARI/GP and its documentation is

http://pari.math.u-bordeaux.fr/dochtml/html.stable/

- Polynomials and power series
- polsturm

Vincent

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] I need to do these basic operations with high-degree polynomials.

2015-05-11 Thread Phoenix
[ignore the previous post] 

The polynomial is 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 
584496*x^16 - 362880*x^14 + 62208*x^12  

- Can SAGE find the gcd of a polynomial and its derivative? 


polygen(QQ)#What doe this do? What is QQ# ? 
p = 1296*x^24 - 20736*x^22 + 129600*x^20 - 393984*x^18 + 584496*x^16 - 
362880*x^14 + 62208*x^12   
for (q,n) in p.squarefree_decomposition(): 
 print q.degree(), n, gp.polsturm(q) 


Can someone explain what are these q.degree, n and gp.plotsum ? 

Can this detect if there are any complex roots? 




-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.