# How to | Use Rule Solutions

Since many functions in *Mathematica* give solutions in the form of rules, you need to be able to use these rules to explore and interpret your results. Although many of the methods for using such solutions are specific to the type of problem being solved, you will consistently perform two basic steps: getting rule solutions from lists and then applying them to an expression.

Solve the simple equation for :

In[62]:= |

Out[62]= |

The solution to this equation is contained in a nested list, which is a list of lists. Lists in *Mathematica* are represented by . Items in lists are called elements and can be referred to by their position.

To use the solution, you must first get it out of the nested list. Use (the short form for Part), with the position of the solution in the nested list. The solution here is the first (and only) element in the nested list:

In[63]:= |

Out[63]= |

You can now use the solution with (the short form of ReplaceAll) to substitute the solution into the expression :

In[73]:= |

Out[73]= |

Two solutions are returned for a quadratic equation. There are two sublists, one per solution:

In[77]:= |

Out[77]= |

This uses the second solution:

In[78]:= |

Out[78]= |

A solution set is returned in one sublist when you solve a system of linear equations.

Set up a list of a simple system of linear equations to solve:

In[78]:= |

Out[78]= |

Solve the equations. A nested list containing the one unique solution set is returned:

In[79]:= |

Out[79]= |

The inner list containing the solution set is the first (and only) element in the nested list. Thus, using with the nested list will return the list of solutions:

In[80]:= |

Out[80]= |

In[81]:= |

Out[81]= |

You can get the parts of the solution set by extending the syntax to include the position of the solution within the inner list.

Get the solution for the first variable:

In[83]:= |

Out[83]= |

In[84]:= |

Out[84]= |

Similarly, this substitutes for the second and third variables:

In[91]:= |

Out[91]= |

These equations have two solution sets:

In[2]:= |

Out[2]= |

This substitutes both of the solution sets:

In[3]:= |

Out[3]= |

This shows how to verify solutions to an equation.

First, solve a quadratic equation depending on a parameter:

In[96]:= |

In[97]:= |

Out[97]= |

Verify the results by substitution:

In[98]:= |

Out[98]= |

Note that the result of the substitution is in the form of an equation, instead of True or False.

Use Simplify to determine if the substitution satisfies the equation. Each substitution evaluates to True, indicating that the solutions satisfy the equation:

In[99]:= |

Out[99]= |

Here is how to plot the solutions as a function of the parameter by substituting:

In[70]:= |

Out[70]= |

Similarly, plot just the first solution in :

In[72]:= |

Out[72]= |