Open
Description
In the following case, the solve
function of sage 5.8 will yield a list of incorrect solutions, whereas the correct solution is missing. The computation involves complex numbers, symbolic expressions and trigonometric functions.
----------------------------------------------------------------------
| Sage Version 5.8, Release Date: 2013-03-15 |
| Type "notebook()" for the browser-based notebook interface. |
| Type "help()" for help. |
----------------------------------------------------------------------
sage: phi = var('phi', domain='real')
sage: M = Matrix([
....: [-sqrt(-I)/(exp(I*phi)-1), sqrt(-I)/(exp(I*phi)-1)],
....: [-1/(exp(I*phi)-1)+exp(-I*phi), 1/(exp(I*phi)-1)]])
sage: z = M*vector((-I, 1))
sage: z = z[0]/z[1]
sage: zi = z.imag_part()
sage: s1 = [s.rhs() for s in solve(zi == 0, phi)]
sage: s1
[0, pi - arccos(1/2*sqrt(5) - 1/2), arccos(1/2*sqrt(5) + 1/2)]
sage: N(zi.subs(phi=s1[1]))
0.244669085661435
sage: zi.subs(phi=pi/2)
0
The correct solution was found from an easier form of zi
, which is -1/2*sqrt(2)*cos(phi)/(sin(phi) + 1)
. I first reported this at asksage, and tmonteil confirmed that this is a bug, not my mistake.
Upstream: Reported upstream. No feedback yet.
CC: @kcrisman
Component: symbolics
Stopgaps: wrongAnswerMarker
Issue created by migration from https://trac.sagemath.org/ticket/14628