Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

solving one variable with two equations

asked 12 years ago

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

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 12 years ago

calc314 gravatar image

updated 12 years ago

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.

Preview: (hide)
link
0

answered 12 years ago

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.

Preview: (hide)
link

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: 12 years ago

Seen: 259 times

Last updated: Aug 30 '12