Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Equation Solving >

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 lhsEqualrhs.
  • 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.
  • 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->sx, y->sy, ...}.
  • 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 gives {{}} if all variables can have all possible values.  »
  • Solve[eqns, ..., Mode->Modular] solves equations with equality required only modulo an integer. You can specify a particular modulus to use by including the equation ModulusEqualp. If you do not include such an equation, Solve will attempt to solve for the possible moduli.  »
  • Solve uses special efficient techniques for handling sparse systems of linear equations with approximate numerical coefficients.
Solve a quadratic equation:
Solve simultaneous equations in x and y:
Solutions are given as lists of replacements:
Replace x by solutions:
Replace combinations of x and y by solutions, and simplify the results:
Plot the real parts of the solutions for y as a function of the parameter a:
Pick out the third solution:
Solve a quadratic equation:
In[1]:=
Click for copyable input
Out[1]=
 
Solve simultaneous equations in x and y:
In[1]:=
Click for copyable input
Out[1]=
 
Solutions are given as lists of replacements:
In[1]:=
Click for copyable input
Out[1]=
Replace x by solutions:
In[2]:=
Click for copyable input
Out[2]=
Replace combinations of x and y by solutions, and simplify the results:
In[3]:=
Click for copyable input
Out[3]=
Plot the real parts of the solutions for y as a function of the parameter a:
In[4]:=
Click for copyable input
Out[4]=
 
Pick out the third solution:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Polynomial equations solvable in radicals:
General polynomial equations:
Polynomial equations with multiple roots:
Polynomial equations with symbolic coefficients:
Algebraic equations:
Transcendental equations:
Symbolic functions:
Systems of linear equations:
Linear equations with symbolic coefficients:
Underdetermined systems of linear equations:
Linear equations with no solutions:
Systems of polynomial equations:
Polynomial equations with symbolic coefficients:
Algebraic equations:
Transcendental equations:
A linear system:
Univariate polynomial equation:
A system of polynomial equations and inequations:
All variables are solved for:
By default, Solve uses inverse functions but prints warning messages:
With InverseFunctions->True, Solve does not print inverse function warning messages:
With InverseFunctions->False, Solve does not use inverse functions:
Solving algebraic equations does not require using inverse functions:
Find a modulus for which a system of equations has a solution:
By default, Solve heuristically selects a variable order which makes the problem easier:
This forces Solve to find solutions for y first, and solve for x in terms of these solutions:
Solve verifies solutions obtained using non-equivalent transformations:
With VerifySolutions->False, Solve does not verify the solutions:
Some of the solutions returned with VerifySolutions->False are not correct:
This uses a fast numeric test in an attempt to select correct solutions:
In this case numeric verification gives the correct solution set:
By default, Solve does not verify solutions of equations with inexact coefficients:
In some of the solutions returned, polys are quite far from zero:
With VerifySolutions->True, Solve increases the precision of computations when needed:
The values of polys at the solutions are now much closer to zero:
By default, Solve finds exact solutions of equations:
Computing the solution using 100-digit numbers is faster:
The result agrees with the exact solution in the first 100 digits:
Computing the solution using machine numbers is much faster:
The result is still quite close to the exact solution:
Solve a quadratic equation:
Find intersection points of a circle and a parabola:
Solutions satisfy the equations:
Solutions are given as replacement rules and can be directly used for substitution:
Solve uses {} to represent the empty or no solution:
Solve uses {{}} to represent the universal solution or that all points satisfy the equations:
Solve will produce solutions according to their multiplicity:
Solutions of algebraic equations are often given in terms of Root objects:
Use N to compute numeric approximations of Root objects:
Root objects may involve parameters:
Use Series to compute series expansions of Root objects:
The series satisfies the equation up to order 11:
Solve represents solutions in terms of replacement rules:
Reduce represents solutions in terms of Boolean combinations of equations and inequalities:
Use Reduce to solve equations and inequalities over specified domains:
Use FindInstance to find solution instances:
Like Reduce, FindInstance can be given inequalities and domain specifications:
Use DSolve to solve differential equations:
Use RSolve to solve recurrence equations:
SolveAlways gives the values of parameters for which complex equations are always true:
This solves the same problem using Reduce:
Resolve eliminates quantifiers, possibly without solving the resulting quantifier-free system:
Eliminate eliminates variables from systems of complex equations:
This solves the same problem using Resolve:
Reduce additionally solves the resulting equations:
Solve gives generic solutions; solutions involving equations on parameters are not given:
Reduce gives all solutions, including those that require equations on parameters:
Solve does not eliminate solutions that are neither generically correct nor generically incorrect:
The solutions are correct for 0<|a|<1 and incorrect for |a|>1:
Input equations involving only parameters are treated as assumptions:
Without the assumption on parameters Solve gives no solutions:
Reduce gives the solution together with the condition on parameters:
For transcendental equations Solve may not give all solutions:
Using inverse functions allows Solve to find some solutions fast:
Finding the complete solution may take much longer and the solution may be large:
This finds the values of n for which xEqual2 is a solution:
A polynomial modular equation with symbolic coefficients generates an implicit solution:
Get explicit solutions:
New in 1 | Last modified in 5
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team