Simultaneous Equations

You can give Solve a list of simultaneous equations to solve. Solve can find explicit solutions for a large class of simultaneous polynomial equations.

Here is a simple linear equation with two unknowns.
In[1]:=
Click for copyable input
Out[1]=
Here is a more complicated example. The result is a list of solutions, with each solution consisting of a list of transformation rules for the variables.
In[2]:=
Click for copyable input
Out[2]=
You can use the list of solutions with the operator.
In[3]:=
Click for copyable input
Out[3]=
Even when Solve cannot find explicit solutions, it often can "unwind" simultaneous equations to produce a symbolic result in terms of Root objects.
In[4]:=
Click for copyable input
Out[4]=
You can then use N to get a numerical result.
In[5]:=
Click for copyable input
Out[5]=

The variables that you use in Solve do not need to be single symbols. Often when you set up large collections of simultaneous equations, you will want to use expressions like as variables.

Here is a list of three equations for the a[i].
In[6]:=
Click for copyable input
Out[6]=
This solves for some of the a[i].
In[7]:=
Click for copyable input
Out[7]=
Solve[eqns,{x1,x2,}]solve eqns for the specific objects
Solve[eqns]try to solve eqns for all the objects that appear in them

Solving simultaneous equations.

If you do not explicitly specify objects to solve for, Solve will try to solve for all the variables.
In[8]:=
Click for copyable input
Out[8]=
Solve[{lhs1==rhs1,lhs2==rhs2,},vars]
Solve[lhs1==rhs1&&lhs2==rhs2&&,vars]
Solve[{lhs1,lhs2,}=={rhs1,rhs2,},vars]

Ways to present simultaneous equations to Solve.

If you construct simultaneous equations from matrices, you typically get equations between lists of expressions.
In[9]:=
Click for copyable input
Out[9]=
Solve converts equations involving lists to lists of equations.
In[10]:=
Click for copyable input
Out[10]=
You can use LogicalExpand to do the conversion explicitly.
In[11]:=
Click for copyable input
Out[11]=

In some kinds of computations, it is convenient to work with arrays of coefficients instead of explicit equations. You can construct such arrays from equations by using CoefficientArrays.