#18396: Handle substitutions of partial sums and products
-------------------------------+------------------------
       Reporter:  vdelecroix   |        Owner:
           Type:  enhancement  |       Status:  new
       Priority:  major        |    Milestone:  sage-6.7
      Component:  symbolics    |   Resolution:
       Keywords:               |    Merged in:
        Authors:               |    Reviewers:
Report Upstream:  N/A          |  Work issues:
         Branch:               |       Commit:
   Dependencies:               |     Stopgaps:
-------------------------------+------------------------
Description changed by vdelecroix:

Old description:

> Sage is not able to identify partial sum in a substitution
> {{{
> sage: var('x,y,z')
> sage: f = x^4 + x^2 + x
> sage: f.subs(x^4 + x^2 == y)
> x^4 + x^2 + x
> }}}
> 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.

New description:

 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.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/18396#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to