JAgbanwa

Untitled

Mar 29th, 2026
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. R<x,n> := PolynomialRing(Rationals(), 2);
  2.  
  3. // Define A, B, C
  4. A := (36*n + 27)^2;
  5. B := 15552*n^3 + 34992*n^2 + 26244*n + 6561;
  6. C := 46656*n^4 + 139968*n^3 + 157464*n^2 + 78713*n + 14748;
  7.  
  8. // Perform substitution
  9. expr := (x - A/3)^3
  10. + A*(x - A/3)^2
  11. + B*(x - A/3)
  12. + C;
  13.  
  14. // Extract coefficients directly
  15. a3 := Coefficient(expr, x, 3);
  16. a2 := Coefficient(expr, x, 2);
  17. a1 := Coefficient(expr, x, 1);
  18. a0 := Coefficient(expr, x, 0);
  19.  
  20. // Output
  21. print "a3 =", a3;
  22. print "a2 =", a2;
  23. print "a1 =", a1;
  24. print "a0 =", a0;
  25.  
  26. print "Final Weierstrass equation:";
  27. print "y^2 = x^3 + (", a1, ")*x + (", a0, ")";
Advertisement
Add Comment
Please, Sign In to add comment