This is in some sense a bug. The solution is correct mathematically.
The biggest issue with it is actually that there are four constants,
not two. This is because the solver currently outputs four terms and
relies on the constant simplification to reduce them to two. But the
terms don't simplify in this case because they are so complicated.
If you want something simpler, you should assume that f is real, like
f = symbols('f', real=True)
If you do that, you will get
In [8]: print(dsolve(d2udt2, u(t)))
u(t) == C1*sin(t*Abs(f)) + C2*cos(t*Abs(f))
if you don't like the Abs you can assume f is positive instead.
Ideally, dsolve would return a solution in terms of complex
exponentials in these sorts of cases, which would be a lot less
complicated. Any potential GSoC students out there, especially those
interested in the ODE module, this is a nice little project for your
patch requirement.
Aaron Meurer
> --
> 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
sympy+un...@googlegroups.com.
> To post to this group, send email to
sy...@googlegroups.com.
> 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.