Hi,
I'm new to sympy and I'm trying to understand how to use dsolve.  (I'm 
creating an ipython notebook for a class.)

I'm creating my DE like this:
de = Eq(u(t).diff(t, t) + 4*u(t), 0)
print(de)

4*u(t) + Derivative(u(t), t, t) == 0


soln = dsolve(de, u(t))
print(soln)

u(t) == C1*sin(2*t) + C2*cos(2*t)


So far now everything is perfect.  But if I try to change the number 4 for a 
"generic" symbol (f**2) I do not get

u(t) == C1*sin(f*t) + C2*cos(f*t) as I expected, insted I get a more 
"comprehensive" solution below.


What am I doing wrong?


>>> d2udt2 = Eq(u(t).diff(t, t) - f*(-f*u(t)), 0)
>>> print(d2udt2)
f**2*u(t) + Derivative(u(t), t, t) == 0

u(t) == (C1*sin(t*((-re(f)**2 + im(f)**2)**2 + 
4*re(f)**2*im(f)**2)**(1/4)*Abs(sin(atan2(-2*re(f)*im(f), -re(f)**2 + 
im(f)**2)/2))) + C2*cos(t*((-re(f)**2 + im(f)**2)**2 + 
4*re(f)**2*im(f)**2)**(1/4)*sin(atan2(-2*re(f)*im(f), -re(f)**2 + 
im(f)**2)/2)))*exp(-t*((-re(f)**2 + im(f)**2)**2 + 
4*re(f)**2*im(f)**2)**(1/4)*cos(atan2(-2*re(f)*im(f), -re(f)**2 + im(f)**2)/2)) 
+ (C3*sin(t*((-re(f)**2 + im(f)**2)**2 + 
4*re(f)**2*im(f)**2)**(1/4)*Abs(sin(atan2(-2*re(f)*im(f), -re(f)**2 + 
im(f)**2)/2))) + C4*cos(t*((-re(f)**2 + im(f)**2)**2 + 
4*re(f)**2*im(f)**2)**(1/4)*sin(atan2(-2*re(f)*im(f), -re(f)**2 + 
im(f)**2)/2)))*exp(t*((-re(f)**2 + im(f)**2)**2 + 
4*re(f)**2*im(f)**2)**(1/4)*cos(atan2(-2*re(f)*im(f), -re(f)**2 + im(f)**2)/2))


Thanks,

-Filipe

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/1395f3d9-f6ea-4167-bc0c-3a9b7e1e1e5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to