2

I have system of linear equations, however I DO NOT want the answer to be a number - I want it in terms of the parameters.

ax+by= m cx+dy= n I don't have the values for any of the constants, so I for the above equation, I'd just want the answer x = (md-nb)/(ad-bc) and y = (mc-na)/(bc-ad).

How do I do this in Sage?

calanthe
  • 21
  • 1
  • 3

1 Answers1

5
var('a b c d m n x y')
solve([a*x+b*y==m,c*x+d*y==n],x,y)
Bill Bell
  • 21,021
  • 5
  • 43
  • 58
  • 3
    Live example: http://sagecell.sagemath.org/?z=eJwrSyzSUE9USFJIVkhRyFXIU6hQqFTX5OUqzs8pS9WITtSq0E7SqrS1zdVJBjJTQMy8WJ0KnUpNAPAaERY=&lang=sage – kcrisman Sep 07 '16 at 22:02