# 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 ?

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 ?

add a comment

0

Use symbolic variables ?

```
sage: X=var('X')
sage: ((X+1)**2+1)
(X + 1)^2 + 1
```

Asked: **
2014-11-27 14:24:13 -0600
**

Seen: **67 times**

Last updated: **Nov 27 '14**

Computations with complex algebraic numbers?

bell_polynomial(n,k).coefficients() raises an error

Find the kernel of a matrix $A$ and make it a matrix.

How do I Pass a tuple as an argument for a multivariate polynomial?

How to get Polynomial Coefficients

Pass a list of variable names as parameter to a polynomial ring

Issues with: Solving a polynomial equation with multiple variables

wxMaxima cannot reduce system to a polynomial in one variable [closed]

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.