Solve
Solve[eqns, vars] attempts to solve an equation or set of equations for the variables vars.
Solve[eqns, vars, elims] attempts to solve the equations for vars, eliminating the variables elims.
Equations are given in the form lhs == rhs.
Simultaneous equations can be combined either in a list or with &&.
A single variable or a list of variables can be specified.
Solve[eqns] tries to solve for all variables in eqns.
Example: Solve[3 x + 9 == 0, x].
Solve gives solutions in terms of rules of the form x -> sol.
When there are several variables, the solution is given in terms of lists of rules:
x ->
, y ->
, ...
.
When there are several solutions, Solve gives a list of them.
When a particular root has multiplicity greater than one, Solve gives several copies of the corresponding solution.
Solve deals primarily with linear and polynomial equations.
Solve gives generic solutions only. It discards solutions that are valid only when the parameters satisfy special conditions. Reduce gives the complete set of solutions.
Solve will not always be able to get explicit solutions to equations. It will give the explicit solutions it can, then give a symbolic representation of the remaining solutions in terms of Root objects. If there are sufficiently few symbolic parameters, you can then use N to get numerical approximations to the solutions.
Solve gives {} if there are no possible solutions to the equations.
Solve uses special efficient techniques for handling sparse systems of linear equations with approximate numerical coefficients.
See The Mathematica Book on the web: Section 1.5.7 and Section 3.4.4.
Implementation Notes: see Section A.9.5.
See also: Reduce, Eliminate, Roots, NSolve, FindRoot, LinearSolve, RowReduce, DSolve.
Further Examples