The problem is that the solver needs to know the sign of a certain expression in terms of the coefficients (the discriminant of a polynomial), and it cannot determine the sign based on the information given, as the discriminant ends up being `D = (1/(c2*r2) - 1/(c1*r1))**2`. Symbols are not automatically assumed real; so the square of some expression like that could even be negative. It's a good idea to declare symbols as real, by
sym.symbols('i, r1, c1, r2, c2, t', real=True)
but this doesn't solve the problem because it might happen that c1*r1 == c2*r2, and then D is 0.
I just edited the source to tell it which branch to choose, and got the result:
[Eq(x1(t), C1*exp(t*(-(c1*r1 - c2*r2)/(2*c1*c2*r1*r2) - (c1*r1 + c2*r2)/(2*c1*c2*r1*r2)))/(c1*r1) + C2*exp(t*((c1*r1 - c2*r2)/(2*c1*c2*r1*r2) - (c1*r1 + c2*r2)/(2*c1*c2*r1*r2)))/(c1*r1) + i*(r1 + r2)), Eq(x2(t), C1*(1/(c1*r1) - (c1*r1 - c2*r2)/(2*c1*c2*r1*r2) - (c1*r1 + c2*r2)/(2*c1*c2*r1*r2))*exp(t*(-(c1*r1 - c2*r2)/(2*c1*c2*r1*r2) - (c1*r1 + c2*r2)/(2*c1*c2*r1*r2))) + C2*(1/(c1*r1) + (c1*r1 - c2*r2)/(2*c1*c2*r1*r2) - (c1*r1 + c2*r2)/(2*c1*c2*r1*r2))*exp(t*((c1*r1 - c2*r2)/(2*c1*c2*r1*r2) - (c1*r1 + c2*r2)/(2*c1*c2*r1*r2))) + i*r2)]
So at least you have your solution... Unfortunately I cannot think of any workaround at user level. I think the
handling of D here should be changed in two ways:
a) test it with D.is_positive etc instead of D>0 which throws the error you got
b) if the sign can't be determined, return a Piecewise object listing the options with appropriate cases:
Piecewise((sol1, D>0), (sol2, D<0), (sol3, Eq(D, 0)))