Eliminating Variables

When you write down a set of simultaneous equations in the Wolfram Language, 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.

Solve[eqns,vars,elims]find solutions for vars, eliminating the variables elims
Eliminate[eqns,elims]rearrange equations to eliminate the variables elims

Eliminating variables.

Here are two equations involving , and the "parameters" and .
In[1]:=
Click for copyable input
Out[1]=
If you solve for both and , you get results in terms of and .
In[2]:=
Click for copyable input
Out[2]=
Similarly, if you solve for and , you get results in terms of and .
In[3]:=
Click for copyable input
Out[3]=
If you only want to solve for , however, you have to specify whether you want to eliminate or or . This eliminates , and so gives the result in terms of and .
In[4]:=
Click for copyable input
Out[4]=
If you eliminate , then you get a result in terms of and .
In[5]:=
Click for copyable input
Out[5]=

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 , by eliminating the variable .
In[6]:=
Click for copyable input
Out[6]=
This is what you get if you eliminate instead of .
In[7]:=
Click for copyable input
Out[7]=

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

To solve the problem, we simply have to write in terms of and , eliminating the original variables and .
In[8]:=
Click for copyable input
Out[8]=

In dealing with sets of equations, it is common to consider some of the objects that appear as true "variables", and others as "parameters". In some cases, you may need to know for what values of parameters a particular relation between the variables is always satisfied.

SolveAlways[eqns,vars]solve for the values of parameters for which the eqns are satisfied for all values of the vars

Solving for parameters that make relations always true.

This finds the values of parameters that make the equation hold for all .
In[9]:=
Click for copyable input
Out[9]=
This equates two series.
In[10]:=
Click for copyable input
Out[10]=
This finds values of the undetermined coefficients.
In[11]:=
Click for copyable input
Out[11]=