Updates:
        Summary: expand(power_base=True) is too aggressive

Comment #2 on issue 1766 by smichr: expand(power_base=True) is too  
aggressive
http://code.google.com/p/sympy/issues/detail?id=1766

This behavior is comes from expand_pow_base upon which separatevars  
depends, so it's
not intrinsic to separatevars.

Regarding the previous comment, is there a reason that they should not just
initialize all their variables as

x,y,z=symbols('xyz',positive=True)

I would prefer that they get the education by a failed attempt at solving  
an equation
than to have to defend why sympy gave an expression in symbols that was not  
correct
when you put numbers in their place. (I searched a bit for a FAQ or  
tutorial that I
saw where Ondrej explains why expand or something wouldn't make something  
like
sqrt(x*y) into sqrt(x)*sqrt(y) without giving symbols assumptions but can't  
find it
now.) Is there an ODE for which this would happen, i.e. give variables  
separated out
from under a radical that should not be separated?

Here's the equation you cite (and no doubt know will fail without  
assumptions):
>>> dsolve(f(x).diff(x) - sqrt(f(x)*(1 + x)), f(x))
Traceback (most recent call last):
   File "<interactive input>", line 1, in <module>
   File "C:\Documents and Settings\chris\sympy\sympy\solvers\ode.py", line  
366, in dsolve
     raise NotImplementedError("dsolve: Cannot solve " + str(eq))
NotImplementedError: dsolve: Cannot solve D(f(x), x) - ((1 +z  
x)*f(x))**(1/2)

But just doing this,
>>> x=Symbol('x', positive=True)

makes it work just fine.
>>> dsolve(f(x).diff(x) - sqrt(f(x)*(1 + x)), f(x))
f(x) == C1 + x/3 + x**2/3 + x**3/9 + C2*(1 + x)**(3/2)

The "just work" principal can be applied to some situations and we can call  
it
"batteries included"; but to make something work with a hidden assumption  
and not do
anything to make sure that that assumption is satisfied is a "bombs  
included"
approach ;-)

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--

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