id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
18396 Handle substitutions of partial sums and products vdelecroix "Sage is not able to identify partial sum in a substitution
{{{
sage: var('x,y')
sage: f = x + x^2 + x^4
sage: f.subs(x^2 == y) # one term is fine
x^4 + x + y
sage: f.subs(x + x^2 == y) # partial sum does not work
x^4 + x^2 + x
sage: f.subs(x + x^2 + x^4 == y) # whole sum is fine
y
}}}
Similarly with products
{{{
sage: f = x * cos(x) * sin(x)
sage: f.subs( cos(x) * sin(x) == y)
x*cos(x)*sin(x)
}}}
As mentioned in the doc, this is the same behavior as in Maple but differ from Mathematica. We should be clearer on the semantic of `substitute` and potentially implement partial sum and product substitutions.
See also #10049 and http://ask.sagemath.org/question/25972/substitute-xy-by-u/ (with related ticket #17879)" enhancement new major sage-6.7 symbolics mjo mmezzarobba N/A