Created
June 5, 2023 13:12
-
-
Save maple3142/8f90cb6aea6c5600f468d0acade89af8 to your computer and use it in GitHub Desktop.
expressing an irrational in terms of another one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # express sqrt(2) in terms of a rational polynomial of w=sqrt(2)+sqrt(3)+sqrt(5) | |
| w = sqrt(2) + sqrt(3) + sqrt(5) | |
| K = QQ[w] | |
| f = K(2).sqrt().lift() | |
| print(f) | |
| print(f(w).expand()) | |
| PR = PolynomialRing(QQ, "x,y,z,r", order="lex") | |
| x, y, z, r = PR.gens() | |
| I = PR.ideal([x ^ 2 - 2, y ^ 2 - 3, z ^ 2 - 5, r - x - y - z]) | |
| f = (x - I.groebner_basis()[0]).univariate_polynomial() | |
| print(f) | |
| print(f(w).expand()) | |
| # express sqrt(2) in terms of a rational polynomial of w=sqrt(2)+cbrt(3) | |
| w = 2 ^ (1 / 2) + 3 ^ (1 / 3) | |
| K = QQ[w] | |
| f = K(2).sqrt().lift() | |
| print(f) | |
| print(f(w).expand()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment