Hi:

Sympy's dsolve solves

t = Symbol("t")
y = Function("y")
de = y(t).diff(t)+2*y(t) - t*exp(-2*t)
dsolve(de,y(t))
#y(t) == (C1 + t**2/2)*exp(-2*t)

and

t = Symbol("t")
y = Function("y")
de = y(t).diff(t)+2*y(t) - 2*cos(t)
dsolve(de,y(t))
#y(t) == (C1 + 2*exp(2*t)*sin(t)/5 + 4*exp(2*t)*cos(t)/5)*exp(-2*t)

instantly, but when I try the sum

t = Symbol("t")
y = Function("y")
de = y(t).diff(t)+2*y(t) - t*exp(-2*t) - 2*cos(t)
dsolve(de,y(t))
#y(t) == (C1 + t**2/2 + 2*exp(2*t)*sin(t)/5 + 4*exp(2*t)*cos(t)/5)*exp(-2*t)

Sympy takes 5 seconds (or more). I tested this both
with the debian sympy and with the latest spkg of Sympy in
Sage (the spkg version was much slower). I'm also on
a fairly old ubuntu machine.

Not a complaint really, just curious why this happens.

- David Joyner

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

Reply via email to