Ask Your Question
0

A bug with solve xy=x ?

asked 2013-12-30 04:58:08 -0500

updated 2013-12-30 06:43:31 -0500

For solving the equation "xy=x", we can do:

sage: x,y=var('x,y')
sage: solve([x*y==x],[x,y])     
[x == 0]

But this is not the complete solution.

We need to add the trivial equation "0==0" for having the complete solution:

sage: solve([x*y==x,0==0],[x,y])
[[x == 0, y == r1], [x == r2, y == 1]]

Is it a bug ?

edit retag flag offensive close merge delete

Comments

1

Is it a bug? A good question. If we change the order of x,y to solve([x*y==x],[y,x]) , we get y==1 as solution. Obviously only the first variable is used as far as there is only one equation. IMHO that's not a bug, but it would be nice, if Sage could add the trivial equation automatically.

ndomes gravatar imagendomes ( 2013-12-30 21:30:41 -0500 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2013-12-30 17:08:33 -0500

cjsh gravatar image

x,y=var('x,y') show((x*y-x).solve(x,y))

"==" is a logic,not always equal "="

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-12-30 04:58:08 -0500

Seen: 104 times

Last updated: Dec 30 '13