# Rewriting Equations to Eliminate Variables

To rewrite equations to eliminate variables, tap the "Eliminate" button and follow the prompts, or use the "eliminate" command.

The "eliminate" command is used to rewrite a set of simultaneous equations to omit the specified variable.  Equations containing the variable are "solve"d  in terms of that variable, and their right-hand sides are paired to form new equations.  The original equations are automatically "remove"d, so the eliminated variable no longer appears in any equation.

Elimination can be used to simplify a set of equations by minimizing the number of equations and/or variables involved.

Solving Simultaneous Equations

The method of elimination is useful when solving "simultaneous equations".  In these kinds of problems, no variable values are known beforehand, but there are as many equations as there are unknowns.  Since no variables are known, a cascade of solutions cannot start directly.

`> clear all> remove all> x+y=3> x=2y`

Elimination works by selecting a common variable, and "solve"ing each equation for that variable.  Sets of right-hand sides are then paired together to form new equations.

Often, with multiple equations and unknown variables in the workspace, it is useful to know just how much is unknown!  The "list" command is not especially helpful because it does not identify unknowns.  The "info" command is the "list" command's counterpart.  It shows what and how many unresolved equations and variables there are.

`> info   2 equations in 2 variables (0 locked) with 2 unknowns. * Unresolved equations and their unknowns:   (Eq. 1)   x+y=3   {xy}   (Eq. 2)   x=2y    {xy} * Unknown variables:   x y `

With this information, it is clear that there are as many unresolved equations as unknowns.  The criteria for simultaneous equations has been met.  Further, both variables are common to both equations, so either could be "eliminate"d.  In this case, a variable will be chosen arbitrarily:

`> eliminate x   Solving for x:           x + y = 3               x = 3 - y               x = 2 y   Replacement:           3 - y = 2 y   Solving for y:           3 - y = 2 y             - y = - 3 + 2 y       - 2 y - y = - 3     y (- 2 - 1) = - 3           - 3 y = - 3         y (- 3) = - 3             3 y = 3           y (3) = 3               y = 1       y = 1`

The equations involving the "eliminate"d variable were "solve"d for that variable, and the two right-hand sides (both equivalent to the eliminated variable) were combined into a single equation.  In this case, the result was a single equation with a single unknown, which was solved as usual...

`> list       y = 1`

Unfortunately, elimination automatically "remove"s the original equations.  The "eliminate"d variable is lost and is still unknown!  However, since a variable is now known, the other can be found by re-entering one of the original equations.

`> x+y=3   Solving for x:           x + y = 3               x = 3 - y       x = 2> list (Eq. 1)          x + y = 3       y = 1       x = 2`

The result was that variable values satisfying all original equations were found, although the original equations were drastically changed.

Simplifying Systems of Equations

The method of elimination is also useful for simplifying systems of equations to remove references to a variable.  In the previous example, the complete removal of a variable through elimination was not particularly useful, but sometimes that is exactly the intent!

The temperature example will be used to illustrate simplifying a system:

`> clear all> remove all> F=32+9/5C> C+273=K> list (Eq. 1)                        9 C               F = 32 + ---                         5  (Eq. 2)         273 + C = K> info   2 equations in 3 variables (0 locked) with 3 unknowns. * Unresolved equations and their unknowns:   (Eq. 1)   F=32+9C/5   {FC}   (Eq. 2)   273+C=K     {CK} * Unknown variables:   F C K `

If an equation showing the direct relationship between "K" and "F" were needed (i.e. not involving "C"), the equations could be streamlined by eliminating "C" from the workspace.  The "info" command showed that "C" is common to multiple equations, so it is a valid candidate for elimination.

`> eliminate C   Solving for C:                        9 C               F = 32 + ---                         5              9 C            32 + --- = F              5                  9 C                        --- = - 32 + F              5                           9                        C - = - 32 + F               5                        9 C = 5 (- 32 + F)           C (9) = 5 (- 32 + F)                   5 (- 32 + F)               C = ------------                        9                         5 (F - 32)               C = ----------                       9        Solving for C:         273 + C = K               C = - 273 + K               C = K - 273   Replacement:      5 (F - 32)                ---------- = K - 273          9               > list (Eq. 1)      5 (F - 32)                ---------- = K - 273          9               > info   1 equation in 2 variables (0 locked) with 2 unknowns. * Unresolved equations and their unknowns:   (Eq. 1)   5(F-32)/9=K-273   {FK} * Unknown variables:   F K `

The remaining equation represents a direct relationship between the variables that are left.  Either variable could be found directly if the other were known.  Furthermore, no work would be wasted evaluating an unimportant variable.

`> K=388               K = 388       K = 388   Solving for F:    5 (- 32 + F)                ------------ = - 273 + K         9                         5 F   160                   --- - --- = - 273 + K        9     9                          5 F           160                 --- = - 273 + --- + K              9             9                    5           160                 F - = - 273 + --- + K               9            9                  5 F = 160 + 9 (- 273 + K)           F (5) = 160 + 9 (- 273 + K)                   160 + 9 (- 273 + K)               F = -------------------                            5                            160 + 9 (K - 273)               F = -----------------                           5               F = 239> list (Eq. 1)      5 (F - 32)                ---------- = K - 273          9                      K = 388       F = 239`

Note that eliminating a variable that appears in only one equation will remove that equation!  A prompt will ask if the elimination should proceed:

`> eliminate K   Eliminate the single occurrence of 'K'?  [y]/n: n * Variable 'K' preserved.`