WOLFRAM LANGUAGE TUTORIAL

# Generic and Non‐Generic Solutions

If you have an equation like , it is perfectly clear that the only possible solution is . However, if you have an equation like , things are not so clear. If is not equal to zero, then is again the only solution. However, if is in fact equal to zero, then *any* value of is a solution. You can see this by using Reduce.

Solve implicitly assumes that the parameter

does not have the special value

.

Out[1]= | |

Reduce, on the other hand, gives you all the possibilities, without assuming anything about the value of

.

Out[2]= | |

A basic difference between Reduce and Solve is that Reduce gives *all* the possible solutions to a set of equations, while Solve gives only the *generic* ones. Solutions are considered "generic" if they involve conditions only on the variables that you explicitly solve for, and not on other parameters in the equations. Reduce and Solve also differ in that Reduce always returns combinations of equations, while Solve gives results in the form of transformation rules.

Solve[eqns,vars] | find generic solutions to equations |

Reduce[eqns,vars] | reduce equations, maintaining all solutions |

Solving equations.

This is the solution to an arbitrary linear equation given by

Solve.

Out[3]= | |

Reduce gives the full version, which includes the possibility

. In reading the output, note that

has higher precedence than

.

Out[4]= | |

Here is the full solution to a general quadratic equation. There are three alternatives. If

is nonzero, then there are two solutions for

, given by the standard quadratic formula. If

is zero, however, the equation reduces to a linear one. Finally, if

,

, and

are all zero, there is no restriction on

.

Out[5]= | |

When you have several simultaneous equations, Reduce can show you under what conditions the equations have solutions. Solve shows you whether there are any generic solutions.

This shows there can never be any solution to these equations.

Out[6]= | |

There is a solution to these equations, but only when

has the special value

.

Out[7]= | |

The solution is not generic, and is rejected by

Solve.

Out[8]= | |

But if

is constrained to have value

, then

Solve again returns a solution.

Out[9]= | |

This equation is true for any value of

.

Out[10]= | |

This is the kind of result

Solve returns when you give an equation that is always true.

Out[11]= | |

When you work with systems of linear equations, you can use Solve to get generic solutions, and Reduce to find out for what values of parameters solutions exist.

Here is a matrix whose

element is

.

Out[12]= | |

The matrix has determinant zero.

Out[13]= | |

This makes a set of three simultaneous equations.

Out[14]= | |

Solve reports that there are no generic solutions.

Out[15]= | |

Reduce, however, shows that there

*would* be a solution if the parameters satisfied the special condition

.

Out[16]= | |

For nonlinear equations, the conditions for the existence of solutions can be much more complicated.

Here is a very simple pair of nonlinear equations.

Out[17]= | |

Solve shows that the equations have no generic solutions.

Out[18]= | |

Reduce gives the complete conditions for a solution to exist.

Out[19]= | |