simultaneous equations

ex how do i command

# 1 3x+2y+z=2
# 2 4x+2y+2z=8
# 3 x-y+z=4

i can do the math.

(3*#3)+ #1=-5y+2z=10
(4*#3) +#2=6y-2z=-8
add both together y=2
sub in one equation above 6y-2z=-8 z=10
sub into x-y+z=4 x=-4

set this up in maple for me

Robert Israel's picture

solve

> solve({ your equations });
Doug Meade's picture

more explicit, and more options,

Robert's response is correct, but if you are a newcomer to Maple, you may not know how to enter "your equations". Here is an excerpt from a Maple 11 worksheet showing a few ways to approach your problem:

The first step is to define the three equations (note the use of * for multiplicaiton and := for assignment):

eq1 := 3*x+2*y+z=2;
                              3 x + 2 y + z = 2
eq2 := 4*x+2*y+2*z=8;
                             4 x + 2 y + 2 z = 8
eq3 := x-y+z=4;
                                x - y + z = 4

Here is what Robert's solution would look like:

solve( {eq1,eq2,eq3} );
                           {y = 2, x = -4, z = 10}

It is exactly the same as you would see if you explicitly entered the unknowns as a set:

solve( {eq1,eq2,eq3}, {x,y,z} );
                           {y = 2, x = -4, z = 10}

If you specify the unknowns as a list (which has order), the output is slightly different:

solve( {eq1,eq2,eq3}, [x,y,z] );
                          [[x = -4, y = 2, z = 10]]

I hope this is helpful,

Doug

---------------------------------------------------------------------
Douglas B. Meade
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu/~meade/

Are the systems always linear?

If you are always solving systems of linear equations
and you know some linear algebra, you could
use LinearSolve from the LinearAlgebra package
by putting your equation in Matrix form.

M := Matrix([[3,2,1],[4,2,2],[1,-1,1]]);
b := Vector([2,8,4]);
LinearAlgebra:-LinearSolve(M,b);

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}