Updates:
        Labels: NeedsBetterPatch

Comment #18 on issue 1261 by asmeurer: incorrect exponentiation with  
non-commutative symbols
http://code.google.com/p/sympy/issues/detail?id=1261

The ODE fail is a strange one:
Old:
In [12]: dsolve(Eq(x*f(x).diff(x) + f(x) - f(x)**2,0), f(x), "Bernoulli")
Out[12]:
            1
f(x) = ──────────
          ⎛     1⎞
        x⋅⎜C₁ + ─⎟
          ⎝     x⎠
In [3]: dsolve(Eq(x*f(x).diff(x) + f(x) - f(x)**2,0),  
f(x), "Bernoulli_Integral")
Out[3]:
                ⌠
                ⎮ 1
               -⎮ ─ dx
                ⎮ x
                ⌡
              ℯ
f(x) = ───────────────────
             ⌠
             ⎮    ⌠
             ⎮    ⎮ 1
             ⎮   -⎮ ─ dx
             ⎮    ⎮ x
             ⎮    ⌡
             ⎮ -ℯ
        C₁ + ⎮ ───────── dx
             ⎮     x
             ⌡

In [24]: Eq(f(x),  exp(-integrate(1/x, x))/(C1 +  
integrate(-exp(-integrate(1/x, x))/x, x)))
Out[24]:
             1
f(x) = ──────────
          ⎛     1⎞
        x⋅⎜C₁ + ─⎟
          ⎝     x⎠


Your patch:
In [14]: dsolve(Eq(x*f(x).diff(x) + f(x) - f(x)**2,0), f(x), "Bernoulli")
Out[14]: f(x) = 1

In [15]: dsolve(Eq(x*f(x).diff(x) + f(x) - f(x)**2,0),  
f(x), "Bernoulli_Integral")
Out[15]: f(x) = 1

In [24]: Eq(f(x),  exp(-integrate(1/x, x))/(C1 +  
integrate(-exp(-integrate(1/x, x))/x, x)))
Out[24]:
             1
f(x) = ──────────
          ⎛     1⎞
        x⋅⎜C₁ + ─⎟
          ⎝     x⎠


Also, your patch has a whitespace error.

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