Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#30570 closed defect (duplicate)

wrong result of solve

Reported by: zimmerma Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: calculus Keywords: solve, conjugate, maxima
Cc: slelievre Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by slelievre)

[Closed as duplicate of #18488.]

Reported by Alexandre Casamayou (checked with Sage 9.1 and Sage 9.2.beta12):

sage: z = SR.var('z')
sage: expr_a = i*z^2 - 2*conjugate(z) + 2 - i
sage: sol_a = solve(expr_a, z, solution_dict=True)
sage: sol_a
[{z: -2*I - 1}, {z: 1}]

The first listed solution is wrong:

sage: [expr_a.subs(s) for s in sol_a]
[-8*I, 0]

The issue is that solve ignores conjugate. Compare:

sage: expr_b = i*z^2 - 2*z + 2 - i
sage: sol_b = solve(expr_b, z, solution_dict=True)
sage: sol_b
[{z: -2*I - 1}, {z: 1}]
sage: [expr_b.subs(s) for s in sol]
[0, 0]

Change History (5)

comment:1 Changed 7 months ago by slelievre

  • Cc slelievre added
  • Description modified (diff)
  • Keywords solve conjugate maxima added

It turns out solve ignores conjugate.

comment:2 Changed 7 months ago by slelievre

  • Milestone changed from sage-9.2 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

Duplicate of #18488.

comment:3 Changed 7 months ago by zimmerma

  • Status changed from needs_review to positive_review

I agree this is a duplicate. Sorry.

comment:4 Changed 7 months ago by slelievre

  • Description modified (diff)
  • Resolution set to duplicate
  • Status changed from positive_review to closed

No problem, thanks for reporting, better twice than not. Duplicate tickets are cheap and easy to close.

I found the other ticket using Trac's query engine:

The reverse works too:

Otherwise searching for "solv" or "conjugat" would also catch solving, conjugation...

comment:5 Changed 7 months ago by slelievre

  • Description modified (diff)
Note: See TracTickets for help on using tickets.