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 >

NSolve

NSolve[lhsEqualrhs, var]
gives a list of numerical approximations to the roots of a polynomial equation.
NSolve[{eqn1, eqn2, ...}, {var1, var2, ...}]
solves a system of polynomial equations.
  • NSolve[eqns, vars, n] gives results to n-digit precision.
  • NSolve[eqns, vars] gives the same final result as N[Solve[eqns, vars]], apart from issues of numerical precision.
Approximate solutions to a polynomial equation:
Approximate solutions to a system of polynomial equations:
Approximate solutions to a polynomial equation:
In[1]:=
Click for copyable input
Out[1]=
Approximate solutions to a system of polynomial equations:
In[2]:=
Click for copyable input
Out[2]=
A univariate polynomial equation:
A system of polynomial equations with a finite number of solutions:
A system of polynomial equations with infinitely many solutions:
Polynomial equations with inexact coefficients:
Equations involving radicals:
Eliminate a variable and solve the resulting system:
Polynomial equations with parameters:
Transcendental equations:
By default NSolve computes a Gröbner basis in DegreeReverseLexicographic order:
Here using the Lexicographic order is faster, since polys already form a Gröbner basis:
By default the solutions are machine-precision numbers:
The values of polys at some of the machine precision-solutions are relatively large:
This computes solutions using 50 digits of precision:
The solutions computed with 50 digits of precision satisfy the equations much more accurately:
Solve a polynomial equation with inexact coefficients:
Find intersection points of a circle and a parabola:
NSolve gives approximate solutions to the equations:
Solutions are given as replacement rules and can be directly used for substitution:
NSolve uses {} to represent the empty or no solution:
NSolve uses {{}} to represent the universal solution or that all points satisfy the equations:
NSolve will produce solutions according to their multiplicity:
NSolve computes numeric approximations of solutions:
Use Solve to get exact values of solutions:
NSolve finds solutions in complex numbers:
Use Reduce to find solutions over specified domains:
Use N and ToRules to get approximations of the solutions given as replacement rules:
Use FindRoot to find an approximate solution instance starting the search at x=1 and y=-1:
Use FindInstance to find exact solution instances:
Use N to get a numeric approximation of the solution:
Use NDSolve to solve differential equations numerically:
If the solutions set is infinite, NSolve gives its intersection with random hyperplanes:
Solutions obtained with machine-precision numeric computations may not be accurate:
New in 2 | Last modified in 4.1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team