Solve equations (solve)
Solve equations for one or more unknowns.
With this function, the solver shows the steps whenever it finds them.
How to write it
solve(equations, variables)
Solve for the unknowns.
- equations
- What to solve; a list of equations is a system. Takes an equation, or a list of equations in brackets.
- variables
- A variable, or a list of variables such as [x, y]. Takes a variable, or a list of variables.
solve(equations, variables, domain = real|complex)
Solve over the real or over the complex numbers.
- equations
- What to solve; a list of equations is a system. Takes an equation, or a list of equations in brackets.
- variables
- A variable, or a list of variables such as [x, y]. Takes a variable, or a list of variables.
- domain = real|complex
- Where to work: the real or the complex numbers. Takes real or complex.
Examples
solve(x^2 - 4 = 0, x)In the solver,
Open in the solversolve(x^2 - 4 = 0, x)gives[[x -> -2], [x -> 2]].solve([x + y = 3, x - y = 1], [x, y])In the solver,
Open in the solversolve([x + y = 3, x - y = 1], [x, y])gives[[x -> 2, y -> 1]].solve(x^2 + 1 = 0, x, domain = complex)In the solver,
Open in the solversolve(x^2 + 1 = 0, x, domain = complex)gives[[x -> -i], [x -> i]].
Related functions
- solve_all
Describe the complete solution set of equations and inequalities.
- numeric_solve
Solve equations numerically.
- solve_identity
Find the values of the parameters that make an equation true for every value of the variable.
- linear_solve
Solve a linear system A x = b given by its matrix and right-hand side.
- eliminate
Eliminate variables from a system of equations, leaving equations in the others.
- least_squares
The least-squares solution of A x = b.