Adding if depending on version of sympy in dsolve (III)