Overview - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


solve

solve one or more equations

 

Calling Sequence

Parameters

Basic Information

Examples

Details

Calling Sequence

solve(equations, variables)

Parameters

equations

-

equation or inequality, or set or list of equations or inequalities

variables

-

(optional) name or set or list of names; unknown(s) for which to solve

Basic Information

Description

• 

The solve command solves one or more equations or inequalities for their unknowns.

Output

• 

If the second argument is a name or a set of names, then the solutions to a single equation are returned as an expression sequence. If the second argument is a list, then the solutions are returned as a list.

• 

If the second argument is a name or a set of names, then the solutions to a set or list of equations are returned as sets of equation sequences. If the second argument is a list, then the solutions are returned as a sorted listlist of equations.

• 

If the solve command does not find any solutions, then if the second argument is a name or set of names, then the empty sequence (NULL) is returned; if the second argument is a list, then the empty list is returned. This means that there are no solutions, or the solve command cannot find the solutions. In the second case, a warning is issued, and the global variable _SolutionsMayBeLost is set to true.

• 

If the output of the solve command is a piecewise-defined expression, then the assuming command can be used to isolate the desired solution(s). If the output is not piecewise-defined, in particular, if the output is constant, assumptions on the independent variables may be ignored. If there are parameters in the input equations, the solve command will use those assumptions in its computations. See examples below.

• 

For higher degree polynomial equations, Maple returns implicit solutions in terms of RootOf.

Examples

Simple Examples

  

Solve for x.

solve2x=3,x

32

(1)
  

Solve for a.

solvef=ma,a

fm

(2)

Solve a quadratic equation

solvex23x+2=0,x

2,1

(3)

Specifying variables

  

To ignore parameters, specify the variables for which to solve.

solvea2c24b2b=a6b4a3b,c

c=ba32a,c=ba32a

(4)

Solving linear systems

  

The solve command can solve linear systems.

solvez=1,2x+y=3,x+y+z=2,x,y,z

x=2,y=−1,z=1

(5)

Solving inequations

  

The solve command can solve inequations.

solvex+y<10&comma;x2=9&comma;x&comma;y

x=−3&comma;y<13,x=3&comma;y<7

(6)

Using the assuming command to isolate a solution

  

Assumptions on parameters can be used to get more specific solutions.  Note also, the form of the output changes when variables are given in a list.

solvex2=a&comma;xassuminga::negative

x=Ia&comma;x=−Ia

(7)

solveb<ax&comma;xassuming1<a

ba<x

(8)

Using RootOf expressions as placeholders to solutions of  high-degree polynomials

  

The explicit solutions to high-degree polynomials can be very large, so Maple may return a solution using RootOf expressions as placeholders.

solvex4x3+1&comma;x

RootOf_Z4_Z3+1&comma;index=1,RootOf_Z4_Z3+1&comma;index=2,RootOf_Z4_Z3+1&comma;index=3,RootOf_Z4_Z3+1&comma;index=4

(9)
  

Maple may also use RootOf expressions as placeholders when it cannot find an explicit form for the solution of a non-algebraic equation in one variable.

solvecosx2=2cosx+x&comma;x

RootOf2cos_Zcos_Z2+_Z

(10)

No solutions found

  

In the following example, solve does not find a solution to the set of equations, and as mentioned above in the Description section, if the second argument variables is a set, the empty sequence is returned.

solvex+y=1&comma;2x+2y=4&comma;x&comma;y

  

Here, solve does not find a solution to the list of equations. Since more than one variable is received in a list, the empty list is returned.

solvex+y=1&comma;2x+2y=4&comma;x&comma;y

(11)

Details

  

For detailed information including:

• 

A complete description of all calling sequences and resulting output forms

• 

How to use units in the input of solve

• 

Shortcuts for specifying equations and unknowns

• 

Controlling the form and number of solutions returned

  

see the solve/details help page.

See Also

assuming

dsolve

eliminate

fsolve

intsolve

LinearAlgebra[LinearSolve]

pdsolve

RealDomain

RootOf

singular

solve/details

SolveTools