Opened 10 years ago

Closed 10 years ago

## #13286 closed defect (fixed)

# inconsistent behaviour of solve

Reported by: | Frédéric Chapoton | Owned by: | Burcin Erocal |
---|---|---|---|

Priority: | minor | Milestone: | sage-5.3 |

Component: | symbolics | Keywords: | solve, symbolic |

Cc: | Merged in: | sage-5.3.beta2 | |

Authors: | Punarbasu Purkayastha | Reviewers: | Frédéric Chapoton |

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

I have found the following :

sage: w,z=var('w','z') sage: solve([z-4,w-3],[z,w]) [[z == 4, w == 3]] sage: solve([z-4],z) [z == 4] sage: solve([z-4,z-2],z) [] sage: solve([z-4,z-2],[z]) [] sage: solve([z-4],[z]) TypeError: [z] is not a valid variable.

The last line is a really ***bad*** behaviour ! It forces to distinguish the case when there is only one equation and one variable. Compare also with the first solve.

### Attachments (1)

### Change History (9)

### comment:1 Changed 10 years ago by

### comment:3 Changed 10 years ago by

Authors: | → Punarbasu Purkayastha |
---|

### comment:4 follow-up: 5 Changed 10 years ago by

Thanks for the ticket. Are you sure of the syntax of the links to trac ? According to #12490, it seems rather to be

:trac:`13077`

with no # inside.

### comment:5 Changed 10 years ago by

Replying to chapoton:

Thanks for the ticket. Are you sure of the syntax of the links to trac ?

Thanks for checking this. Indeed, it was incorrect. Have corrected the patch now.

### comment:7 Changed 10 years ago by

Reviewers: | → Frédéric Chapoton |
---|

### comment:8 Changed 10 years ago by

Merged in: | → sage-5.3.beta2 |
---|---|

Resolution: | → fixed |

Status: | positive_review → closed |

**Note:**See TracTickets for help on using tickets.

At first I thought this was part of #10750, but apparently not. Thanks for this report.

On the plus side, the behavior isn't

thatbad; it doesn't return a mathematically wrong result, gives a readable error message (this doesn't always happen in Sage!), and by reading`solve?`

one can see the proper syntax. It isn't a good thing, but isn't horrendous.