Work around a bug in sympy 0.7.5

in version 0.7.5 sympy's `dsolve` function apparently sometimes returns `nan` as the RHS of the solution