This is a bug. Can you open an issue with sympy on GitHub?
The correct answer is given if you use exact rational numbers (S(1)/2
or Rational(1, 2)) rather than the float 1/2:
In [6]: solveset(Eq(sin(x), S(1)/2), x, Reals)
Out[6]:
⎧ 5⋅π │ ⎫ ⎧ π │ ⎫
⎨2⋅n⋅π + ─── │ n ∊ ℤ⎬ ∪ ⎨2⋅n⋅π + ─ │ n ∊ ℤ⎬
⎩ 6 │ ⎭ ⎩ 6 │ ⎭
The problem is that solveset solves this in an overly complicated way
using complex numbers even if the domain is reals. Then a small
rounding error makes it look like the solutions are not real.
--
Oscar
> --
> 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 view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/c98b1ad9-133b-484d-860a-00c48a7d339en%40googlegroups.com.