# 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 -0500
**

Seen: **55 times**

Last updated: **Nov 27 '14**

Computing square free part of a multivariate polynomial

Is the R interface identical to R in a R.<x> assignment?

How to get the quotients in multivariable polynomial division?

Ideals of non-commutative polynomials

conversion from polynomial to symbolic

defining boolean variables in sage

lcm and gcd of polynomials over the irrationals

How to extract coefficient terms from a differential equation, as for polynomial?

Solving polynomial equations with Groebner basis in $\mathbb{R}$

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.