```
R.<x> = SR[]
a = SR.var('a')
P = a*x
P.subs(a=1)
```

returns x, as expected, but

```
R.<x, y> = SR[]
a = SR.var('a')
P = a*x
P.subs(a=1)
```

returns a*x.

1 | initial version |

```
R.<x> = SR[]
a = SR.var('a')
P = a*x
P.subs(a=1)
```

returns x, as expected, but

```
R.<x, y> = SR[]
a = SR.var('a')
P = a*x
P.subs(a=1)
```

returns a*x.

The `subs`

method behaves differently in two related settings:

- univariate polynomials over SR
- multivariate polynomials over SR

when trying to substitute a value for some variable involved as a coefficient.

In the univariate case:

```
R.<x> = SR[]
a = SR.var('a')
P = a*x
P.subs(a=1)
```

returns ~~x, ~~`x`

, as ~~expected, but ~~expected.

But in the multivariate case:

```
R.<x, y> = SR[]
a = SR.var('a')
P = a*x
P.subs(a=1)
```

returns ~~a*x. ~~`a*x`

.

3 | retagged |

The `subs`

method behaves differently in two related settings:

- univariate polynomials over SR
- multivariate polynomials over SR

when trying to substitute a value for some variable involved as a coefficient.

In the univariate case:

```
R.<x> = SR[]
a = SR.var('a')
P = a*x
P.subs(a=1)
```

returns `x`

, as expected.

But in the multivariate case:

```
R.<x, y> = SR[]
a = SR.var('a')
P = a*x
P.subs(a=1)
```

returns `a*x`

.

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.