# Solve

Solve[expr,vars]

attempts to solve the system expr of equations or inequalities for the variables vars.

Solve[expr,vars,dom]

solves over the domain dom. Common choices of dom are Reals, Integers, and Complexes.

# Details and Options

• The system expr can be any logical combination of:
•  lhs==rhs equations lhs!=rhs inequations lhs>rhs or lhs>=rhs inequalities expr∈dom domain specifications {x,y,…}∈reg region specification ForAll[x,cond,expr] universal quantifiers Exists[x,cond,expr] existential quantifiers
• Solve[{expr1,expr2,},vars] is equivalent to Solve[expr1&&expr2&&,vars].
• A single variable or a list of variables can be specified.
• Solve gives solutions in terms of rules of the form:
•  {} no solutions {{x->solx,y->soly,…},…} several solutions {{}} solution set is full dimensional
• When a single variable is specified and a particular root of an equation has multiplicity greater than one, Solve gives several copies of the corresponding solution.
• Solve[expr,vars] assumes by default that quantities appearing algebraically in inequalities are real, while all other quantities are complex.
• Solve[expr,vars,dom] restricts all variables and parameters to belong to the domain dom.
• If dom is Reals, or a subset such as Integers or Rationals, then all constants and function values are also restricted to be real.
• Solve[expr&&varsReals,vars,Complexes] solves for real values of variables, but function values are allowed to be complex.
• Solve[expr,vars,Integers] solves Diophantine equations over the integers.
• Solve[,xreg,Reals] constrains x to be in the region reg. The different coordinates for x can be referred to using Indexed[x,i].
• Algebraic variables in expr free of the and of each other are treated as independent parameters.
• Solve deals primarily with linear and polynomial equations.
• When expr involves only polynomial equations and inequalities over real or complex domains, then Solve can always in principle solve directly for all the .
• When expr involves transcendental conditions or integer domains, Solve will often introduce additional parameters in its results.
• Solve can give explicit representations for solutions to all linear equations and inequalities over the integers and can solve a large fraction of Diophantine equations described in the literature.
• When expr involves only polynomial conditions over real or complex domains, Solve[expr,vars] will always be able to eliminate quantifiers.
• Solve gives generic solutions only. Solutions that are valid only when continuous parameters satisfy equations are removed. Other solutions that are only conditionally valid are expressed as ConditionalExpression objects.
• Conditions included in ConditionalExpression solutions may involve inequalities, Element statements, equations and inequations on non-continuous parameters, and equations with full-dimensional solutions. Inequations and NotElement conditions on continuous parameters and variables are dropped.
• Solve uses non-equivalent transformations to find solutions of transcendental equations and hence it may not find some solutions and may not establish exact conditions on the validity of the solutions found.
• Solve uses special efficient techniques for handling sparse systems of linear equations with approximate numerical coefficients.
• The following options can be given:
•  Cubics False whether to use explicit radicals to solve all cubics GeneratedParameters C how to name parameters that are generated InverseFunctions Automatic whether to use symbolic inverse functions MaxExtraConditions 0 how many extra equational conditions on continuous parameters to allow Method Automatic what method should be used Modulus 0 modulus to assume for integers Quartics False whether to use explicit radicals to solve all quartics VerifySolutions Automatic whether to verify solutions obtained using non-equivalent transformations WorkingPrecision Infinity precision to be used in computations
• With , only solutions that require the minimal number of equational conditions on continuous parameters are included.
• With , solutions that require arbitrary conditions on parameters are given and all conditions are included.
• With , only solutions that require at most k equational conditions on continuous parameters are included.
• With , Solve uses only equivalent transformations and finds all solutions.
• Solve[eqns,,Modulus->m] solves equations over the integers modulo m. With , Solve will attempt to find the largest modulus for which the equations have solutions.

# Examples

open allclose all

## Basic Examples(5)

 In[1]:=
 Out[1]=

Solve simultaneous equations in and :

 In[1]:=
 Out[1]=

Solve an equation over the reals:

 In[1]:=
 Out[1]=

Solve an equation over the positive integers:

 In[1]:=
 Out[1]=

Solve equations in a geometric region:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]=