sage automatically expanding polynomial
R.<X>=PolynomialRing(ZZ,'X')
X=R.gen()
P=(X+1)²+1
show(P)
The result is X²+2X+2 while i would like sage to show (X+1)²+1.
How can i do that ?
R.<X>=PolynomialRing(ZZ,'X')
X=R.gen()
P=(X+1)²+1
show(P)
The result is X²+2X+2 while i would like sage to show (X+1)²+1.
How can i do that ?
But P[2] (to get the coefficient before X²) doesn't work anymore with var.
Use P.coeffs() to get a list of all of the coefficients.
But looks like sage will still expand e.g. 5(2x -7) into 10*x - 35. How to keep it in the original form?
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 10 years ago
Seen: 1,204 times
Last updated: Nov 27 '14
Multivariate Polynomials over Rational Function Fields
How do I Pass a tuple as an argument for a multivariate polynomial?
Is there an example of how i could write a polynomial as a product of linear factors
multi-symmetric functions and multi-partitions
polynomials rings over transcendental field extensions
Coercion problem while defining piecewise function