alpertron / calculators

Source code of calculators hosted at https://www.alpertron.com.ar
GNU General Public License v3.0
220 stars 39 forks source link

The polynomial factorization calculator can write a representation of the roots of polynomials (classic, i.e. not mod any number) using only integers and i and the operations of addition, subtraction, multiplication, division, and the extraction of roots (not trigonometric functions or pi) #28

Open xayahrainie4793 opened 2 months ago

xayahrainie4793 commented 2 months ago

For the five roots of the polynomial x^5-1, the representations only use integers and i and the operations of addition, subtraction, multiplication, division, and the extraction of roots, but for the seven roots of the polynomial x^7-1, the representations use cos(k*2pi/7) and sin(k*2pi/7), but no representations which only use integers and i and the operations of addition, subtraction, multiplication, division, and the extraction of roots, but every root of unity has representations which only use integers and i and the operations of addition, subtraction, multiplication, division, and the extraction of roots, thus I hope that the calculator can write the seven roots of the polynomial x^7-1 with representations which only use integers and i and the operations of addition, subtraction, multiplication, division, and the extraction of roots (and not trigonometric functions or pi), although it is casus irreducibilis, i.e. the real and imaginary parts of the roots need to use nonreal complex numbers in the representations.

I hope that the calculator can write the seven roots of all polynomials with representations which only use integers and i and the operations of addition, subtraction, multiplication, division, and the extraction of roots (and not trigonometric functions or pi) as long as such representations exist (I know that such representations does not exist for some polynomials with degree > 4 such as x^5-x-1).

I think that both representations can be written, such as the 105 roots of x^105-1, some roots only have representations which only use integers and i and the operations of addition, subtraction, multiplication, division, and the extraction of roots, some roots only have representations cos(k*2pi/105)+i*sin(k*2pi/105), and some roots have both representations, I hope that all 105 roots can have both representations (except the "too easy" roots, i.e. 1 and -1/2 +/- sqrt(3)/2*i, they need not the representations cos(k*2pi/105)+i*sin(k*2pi/105)).

alpertron commented 2 months ago

The problem is that you have to compute roots of complex numbers, so this is equivalent to use trigonometric functions. You cannot find the 6 seventh non-real roots of 1 using only real roots.

Since x^6+x^5+x^4+x^3+x^2+x+1 is a symmetric polynomial, you can find that these six roots can be expressed with cube roots of complex numbers.

xayahrainie4793 commented 2 months ago

For the algebraic representations of the roots of polynomials, not only square root can be used, but also cube root, 5th root, 7th root, ..., can be used, e.g. the algebraic representations of the roots of the polynomial x^3-2 uses the cube root, thus the calculator can return the roots of the polynomial x^7-1 uses the cube root and the square root, with cube roots of non-real complex numbers, but for the roots of the polynomial x^n-1, the calculator return a representation which only use integers and i and the operations of addition, subtraction, multiplication, division, and the extraction of roots only if only square roots are needed (and does not need cube roots, 5th roots, 7th roots, ...), two examples are cos(pi/9) in https://en.wikipedia.org/wiki/Casus_irreducibilis#Relation_to_angle_trisection and cos(2pi/25) in https://en.wikipedia.org/wiki/Casus_irreducibilis#Relation_to_angle_pentasection_(quintisection)_and_higher, also sin(2pi)/7 = \frac{1}{2}\sqrt{\frac{1}{3}\left(7-\omega^2\sqrt[3]{\frac{7+21\sqrt{-3}}{2}}-\omega\sqrt[3]{\frac{7-21\sqrt{-3}}{2}}\right)} and cos(2pi/7) = \frac{1}{6}\left(-1+\sqrt[3]{\frac{7+21\sqrt{-3}}{2}}+\sqrt[3]{\frac{7-21\sqrt{-3}}{2}}\right), where omega is the primitive 3rd root of unity, which can easily be written as a representation which only use integers and i and the operations of addition, subtraction, multiplication, division, and the extraction of roots: -1/2+sqrt(3)/2*i

xayahrainie4793 commented 2 months ago

See https://www.intmath.com/blog/wp-content/images/2011/06/exact-values-sin-degrees.pdf, you can use the notations like this (but with 3√ instead of 1/3)

alpertron commented 2 months ago

The expressions in that PDF are interesting. I do not know if those expressions can be optimized. Of course, cube roots of non-real numbers are required for angles that are not multiple of 3 degrees.

xayahrainie4793 commented 2 months ago

But when I factor x^360-1 with your calculator, it does not write the expressions in that PDF for cos(theta)+i*sin(theta) if theta is not multiple of 3 degrees. So can you update your program to make that can write such expressions (and similar expressions for x^7-1 and x^9-1 and x^11-1 and x^13-1 and x^14-1 and x^18-1 and x^19-1 and x^21-1 and ...)? Thanks.

alpertron commented 2 months ago

I've just read the methods found by Gauss and Vandermonde to express the roots of unity using radicals and it appears that the results would be a lot of pages of expressions. This is because the roots of x^n-1 depend on the roots of x^r-1, x^s-1, x^t-1, etc where rst = n. The roots of x^p-1 (p prime) depends on very complex expressions and also on the roots of x^(p-1)-1.

That means that it is not convenient to implement them in the calculator.

xayahrainie4793 commented 2 months ago

I found that the radical expressions of x^n-1 is shown if and only if the odd part of n divides 255, but I think that it is not hard to show if the odd part of n is just 7, 9, 11, 13 (and not more complex odd numbers, such as 47 and 59) or 257 and 65537 (also 21, 27, 33, 35, 39, etc.)

The trigonometric functions representations (i.e. cos(theta)+i*sin(theta)) of some roots are not shown, e.g. for x^105-1, only x8 to x105 show trigonometric functions representations, but x1 to x7 do not show (although x1 = 1 is trivial)

alpertron commented 2 months ago

The calculator knows how to compute the algebraic roots of 1^(1/2^n), 1^(1/3), 1^(1/5) and 1^(1/17).

If you want to compute the algebraic roots of the numbers you mention, for example the fifteen values of 1^(1/15), just multiply the three values of 1^(1/3) by the five values of 1^(1/5).

alpertron commented 2 months ago

In https://ericbinnendyk.net/roots_of_unity.pdf (not accessible at this moment but you can use archive.org to download it), Eric R. Binnendyk developed an optimized version of Gauss' method to find the radical expressions for roots of unity. Degree 2, items in expression: 1 Degree 3, items in expression: 2 Degree 5, items in expression: 4 Degree 7, items in expression: 10 Degree 11, items in expression: 34 Degree 13, items in expression: 20 Degree 17, items in expression: 16 Degree 19, items in expression: 50 Degree 23, items in expression: 682 Degree 29, items in expression: 244 Degree 31, items in expression: 170 Degree 37, items in expression: 100 Degree 41, items in expression: 136 Degree 43, items in expression: 610 Degree 47, items in expression: 30010 Degree 53, items in expression: 964 Degree 59, items in expression: 13666 Degree 61, items in expression: 340 Degree 67, items in expression: 3410 Degree 73, items in expression: 200 Degree 97, items in expression: 160 Degree 193, items in expression: 320 Degree 257, items in expression: 256

Of course, in Gauss' method, the number of items in the radical expression is a lot larger.

The paper also notes that the coefficients are huge. For example, when trying to find the 23rd roots of 1, it says that there are some coefficients of 98 digits long.

xayahrainie4793 commented 2 months ago

OK, but x^7-1 and x^9-1 should be possible (you only gave prime n and does not give degrees 9, 25, 27, etc.)

I hope that (e.g. for the n roots of x^n-1):

Also, recently I want to find the roots of x^5040-1, but it returns "degree is too high", and thus I tried x^n-1 for smaller n, and found that the maximum allowed degree is 1000, but I think the 1001st cyclotomic polynomial may be interesting like the 105th cyclotomic polynomial and the 385th cyclotomic polynomial (the irreducible polynomial factors of x^n-1 are exactly the m-th cyclotomic polynomial for all m dividing n), thus I suggest you to change the maximum allowed degree to 1024 (=2^10), thanks.

alpertron commented 2 months ago

With respect to the last paragraph, now the calculator supports degrees up to 1024.