Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 2081 by rosen.diankov: Pow substitution introduces wrong answers
http://code.google.com/p/sympy/issues/detail?id=2081

The most simplest example is:

x=Symbol('x')
(x**3).subs(x**2,Symbol('y'))
y**(3/2)

Regardless if x is Real or Complex, this is wrong because anything to the power of 1.5 has two possible solutions, while anything to the power of 3 has exactly one solution. The clearest way to see this is to set x=-1, then:

(-1)**3 = -1

y = x**2 = 1
y**(3/2) = +- 1

The only way to make this substitution correct is to make sure all exponents are integers. Go into core/power.py _eval_subs function and add this condition:

coeff1.is_integer and coeff2.is_integer and (coeff1/coeff2).is_integer



--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to