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:
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:
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
.