Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  The Teacher's Book /  Basic Calculations /  Solving Equations /

7.3 Solving Simultaneous Equations

Solving sets of simultaneous equations.

You can also use Mathematica TE to solve sets of simultaneous equations. You simply give the list of equations and specify the list of variables to solve for.

Here is a list of two simultaneous equations to be solved for the variables and .

In[1]:= Solve[{a x + y == 0, 2 x + (1 - a) y == 1}, {x, y}]

Out[1]=

Here is another example.

In[2]:= Solve[{a x + b y == 1, x - y == 2}, {x, y}]

Out[2]=

If you do not explicitly specify objects to solve for, Solve will try to solve for all the variables.

In[3]:= Solve[ { x + y == 1, x - 3 y == 2 } ]

Out[3]=

Mathematica TE can solve any set of simultaneous linear equations. Mathematica TE can also solve a large class of simultaneous polynomial equations. Even when it does not manage to solve the equations explicitly, Mathematica TE will still usually reduce them to a much simpler form.

Here are some more complicated simultaneous equations. The two solutions are given as two lists of replacements for x and y.

In[4]:= Solve[{x^2 + y^2 == 1, x + 3 y == 0}, {x, y}]

Out[4]=

Here are the two pairs of solutions.

In[5]:= {x, y} /. %

Out[5]=

This uses the solutions to evaluate the expression x + y. There are two possibilities.

In[6]:= x + y /. %%

Out[6]=