Comment #3 on issue 3993 by [email protected]: Cannot solve x*y'' - xy' + y = 0
http://code.google.com/p/sympy/issues/detail?id=3993

This is a 2nd order linear equation with variable coefficients. sympy currently correctly finds 1 solution. The second can be found using reduction of order, or directly through series methods. By steps in sympy, ...

In [18]: -x*Derivative(y(x), x) + x*Derivative(y(x), x, x) + y(x)
Out[18]:
                   2
    d             d
- x⋅──(y(x)) + x⋅───(y(x)) + y(x)
    dx             2
                 dx

In [19]: _.subs(y(x),x).doit()
Out[19]: 0

In [20]: dsolve(__)
Out[20]:
               ⎛ 6⎞
y(x) = C₀⋅x + O⎝x ⎠

In [21]: Out[18].subs(y(x),x*f(x))
Out[21]:
                            2
           d               d
x⋅f(x) - x⋅──(x⋅f(x)) + x⋅───(x⋅f(x))
           dx               2
                          dx

In [22]: _.doit()
Out[22]:
                            ⎛    2                   ⎞
    ⎛  d              ⎞     ⎜   d            d       ⎟
- x⋅⎜x⋅──(f(x)) + f(x)⎟ + x⋅⎜x⋅───(f(x)) + 2⋅──(f(x))⎟ + x⋅f(x)
    ⎝  dx             ⎠     ⎜    2           dx      ⎟
                            ⎝  dx                    ⎠

In [23]: _.expand()
Out[23]:
                     2
   2 d           2  d              d
- x ⋅──(f(x)) + x ⋅───(f(x)) + 2⋅x⋅──(f(x))
     dx              2             dx
                   dx

In [25]: __.subs(f(x).diff(x),g(x))
Out[25]:
   2         2 d
- x ⋅g(x) + x ⋅──(g(x)) + 2⋅x⋅g(x)
               dx

In [28]: dsolve(_,g(x))
Out[28]:
           x
       C₁⋅ℯ
g(x) = ─────
          2
         x

In [30]: _
Out[30]:
           x
       C₁⋅ℯ
g(x) = ─────
          2
         x

In [31]: Integral(_.rhs,x)
Out[31]:
⌠
⎮     x
⎮ C₁⋅ℯ
⎮ ───── dx
⎮    2
⎮   x
⌡

In [32]: _.doit()
Out[32]:
   ⎛         x⎞
   ⎜        ℯ ⎟
C₁⋅⎜Ei(x) - ──⎟
   ⎝        x ⎠



--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to