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


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==rhsequations
    lhs>rhs or lhs>=rhs inequalities
    exprdomdomain specifications
    {x,y,}regregion 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:
  • CubicsFalsewhether to use explicit radicals to solve all cubics
    GeneratedParametersChow to name parameters that are generated
    InverseFunctionsAutomaticwhether to use symbolic inverse functions
    MaxExtraConditions0how many extra equational conditions on continuous parameters to allow
    MethodAutomaticwhat method should be used
    Modulus0modulus to assume for integers
    QuarticsFalsewhether to use explicit radicals to solve all quartics
    VerifySolutionsAutomaticwhether to verify solutions obtained using non-equivalent transformations
    WorkingPrecisionInfinityprecision to be used in computations
  • With MaxExtraConditions->Automatic, only solutions that require the minimal number of equational conditions on continuous parameters are included.
  • With MaxExtraConditions->All, solutions that require arbitrary conditions on parameters are given and all conditions are included.
  • With MaxExtraConditions->k, only solutions that require at most k equational conditions on continuous parameters are included.
  • With Method->Reduce, Solve uses only equivalent transformations and finds all solutions.
  • Solve[eqns,,Modulus->m] solves equations over the integers modulo m. With Modulus->Automatic, Solve will attempt to find the largest modulus for which the equations have solutions.


open all close all

Basic Examples  (5)

Solve a quadratic equation:

Click for copyable input

Solve simultaneous equations in and :

Click for copyable input

Solve an equation over the reals:

Click for copyable input

Solve an equation over the positive integers:

Click for copyable input

Solve equations in a geometric region:

Click for copyable input
Click for copyable input

Scope  (73)

Generalizations & Extensions  (1)

Options  (15)

Applications  (6)

Properties & Relations  (13)

Possible Issues  (4)

Introduced in 1988
Updated in 2014