Post Reply 
linera solver and cas
01-01-2016, 10:25 PM
Post: #1
linera solver and cas
Hi,
happy new year !

I know there is a linear solver app, but it's limited to number, and I wanted to see how I can play with cas with linear system.
system is :
2x-a*y=2
-x-2y=-1
I typed linsolve([2*x-a*y=2 -x-2*y=-1],[x y])
and cas gave me : [1 0]
But expected result was -1/(2+a) and (a+4)/(a+2)


Ok... let's try with solve() that is a little bit the swiss knife of cas.
first of all, lets try with a basic system :
solve(3*x+2*y=1 AND 3*x-y=2 , {x,y})
return {[5/9 -1/3]} which is correct !
I was very enthousiatic!

then I tried :
solve(2*x-a*y=2 AND -x-2*y=-1, {x,y})
but I got {[1 0]}

something look wrong, any idea ?
Find all posts by this user
Quote this message in a reply
01-02-2016, 08:50 AM
Post: #2
RE: linera solver and cas
[1,0] is correct, check your equations!
Find all posts by this user
Quote this message in a reply
01-02-2016, 04:21 PM
Post: #3
RE: linera solver and cas
Solving by substitution, we have x=(1-2*y).
"Plugging" x=(1-2*y) into the other equation and solving for "y", we have:
2*(1-2*y)-a*y=2 --> 2-4*y-a*y=2 --> (-4-a)*y=0 --> y=0 (a<>-4).
Now "plugging" this y-value back into either equation and solving for "x", we have x=1.
Hence the Prime is correct.
Best,

Aries ;-)
Find all posts by this user
Quote this message in a reply
01-02-2016, 09:32 PM
Post: #4
RE: linera solver and cas
yes, you are right, I made mistake while copying equation.
both solve() and linsolve() perfectly works.
sorry...
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)