Ask Your Question
0

solving one variable with two equations

asked 2012-08-30 08:04:19 +0100

Jakob gravatar image

I cannot figure out why this gives and empty solution

x,y  = var('x,y')
sol = solve([x+y == 2, y==x], x);sol

and this works properly

x,y  = var('x,y')
sol = solve([x+y == 2, y==x], x,y);sol

Have I missed something?

Jakob

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-08-30 11:03:19 +0100

calc314 gravatar image

updated 2012-08-30 11:04:14 +0100

In your first version, solve views y as a known parameter (that Sage does not assume up front to be $-2$) and not a variable. So, the system doesn't have a solution.

In your second version, solve views y as a variable and solves for it.

edit flag offensive delete link more
0

answered 2012-08-30 10:45:52 +0100

kcrisman gravatar image

No, this is also in Maxima.

(%i1) solve([x+y=2,y=x],[x,y]);
(%o1)                          [[x = 1, y = 1]]
(%i2) solve([x+y=2,y=x],[x]);
(%o2)                                 []

I suppose you were expecting [x=1]... I don't know how to get Maxima to do that.

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

2 followers

Stats

Asked: 2012-08-30 08:04:19 +0100

Seen: 244 times

Last updated: Aug 30 '12