Numerical Equation Solving

NSolve[lhs==rhs,x]solve a polynomial equation numerically
NSolve[{lhs1==rhs1,lhs2==rhs2,},{x,y,}]
solve a system of polynomial equations numerically
FindRoot[lhs==rhs,{x,x0}]search for a numerical solution to an equation, starting at
FindRoot[{lhs1==rhs1,lhs2==rhs2,},{{x,x0},{y,y0},}]
search for numerical solutions to simultaneous equations

Numerical root finding.

NSolve gives you numerical approximations to all the roots of a polynomial equation.
In[1]:=
Click for copyable input
Out[1]=
You can also use NSolve to solve sets of simultaneous equations numerically.
In[2]:=
Click for copyable input
Out[2]=

If your equations involve only linear functions or polynomials, then you can use NSolve to get numerical approximations to all the solutions. However, when your equations involve more complicated functions, there is in general no systematic procedure for finding all solutions, even numerically. In such cases, you can use FindRoot to search for solutions. You have to give FindRoot a place to start its search.

This searches for a numerical solution, starting at .
In[3]:=
Click for copyable input
Out[3]=
The equation has several solutions. If you start at a different , FindRoot may return a different solution.
In[4]:=
Click for copyable input
Out[4]=
You can search for solutions to sets of equations. Here the solution involves complex numbers.
In[5]:=
Click for copyable input
Out[5]=