Ask Your Question

# solving one variable with two equations

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 close merge delete

## 2 Answers

Sort by » oldest newest most voted

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.

more

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.

more

## Your Answer

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

Add Answer

## Stats

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

Seen: 110 times

Last updated: Aug 30 '12