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.6 Eliminating Variables

When you are working with sets of equations in several variables, it is often convenient to reorganize the equations by eliminating some variables between them.

This eliminates y between the two equations, giving a single equation for x.

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

Out[1]=

When you write down a set of simultaneous equations in Mathematica TE, you are specifying a collection of constraints between variables. When you use Solve, you are finding values for some of the variables in terms of others, subject to the constraints represented by the equations.

Eliminating variables.

Here are two equations involving x, y and the "parameter" a.

In[2]:= eqn = {x == 1 + 2 a, y == 9 + 2 x}

Out[2]=

If you solve for both x and y, you get results in terms of a.

In[3]:= Solve[eqn, {x, y}]

Out[3]=

Similarly, if you solve for x and a, you get results in terms of y.

In[4]:= Solve[eqn, {x, a}]

Out[4]=

If you only want to solve for x, however, you have to specify whether you want to eliminate y or a. This eliminates y, and so gives the result in terms of a.

In[5]:= Solve[eqn, x, y]

Out[5]=

If you eliminate a, then you get a result in terms of y.

In[6]:= Solve[eqn, x, a]

Out[6]=

In some cases, you may want to construct explicitly equations in which variables have been eliminated. You can do this using Eliminate.

This combines the two equations in the list eqn, by eliminating the variable a.

In[7]:= Eliminate[eqn, a]

Out[7]=

This is what you get if you eliminate y instead of a.

In[8]:= Eliminate[eqn, y]

Out[8]=

As a more sophisticated example of Eliminate, consider the problem of writing in terms of the "symmetric polynomials" and .

To solve the problem, simply write f in terms of a and b, eliminating the original variables x and y.

In[9]:= Eliminate[ {f == x^5 + y^5, a == x + y, b == x y},
{x, y} ]

Out[9]=

Other Mathematica functions related to solving equations. (See Section 3.2.)