Numerical Root Finding

NSolve gives you a general way to find numerical approximations to the solutions of polynomial equations. Finding numerical solutions to more general equations, however, can be much more difficult, as discussed in "Equations in One Variable". FindRoot gives you a way to search for a numerical root of a function or a numerical solution to an arbitrary equation, or set of equations.

FindRoot[f,{x,x0}]search for a numerical root of f, starting with
FindRoot[lhs==rhs,{x,x0}]search for a numerical solution to the equation , starting with
FindRoot[f1,f2,,{{x,x0},{y,y0},}]
search for a simultaneous numerical root of all the
FindRoot[{eqn1,eqn2,},{{x,x0},{y,y0},}]
search for a numerical solution to the simultaneous equations

Numerical root finding.

The curves for and intersect at one point.
In[1]:=
Click for copyable input
Out[1]=
This finds a numerical approximation to the value of at which the intersection occurs. The tells FindRoot what value of to try first.
In[2]:=
Click for copyable input
Out[2]=

In trying to find a solution to your equation, FindRoot starts at the point you specify, and then progressively tries to get closer and closer to a solution. Even if your equations have several solutions, FindRoot always returns the first solution it finds. Which solution this is will depend on what starting point you chose. If you start sufficiently close to a particular solution, FindRoot will usually return that solution.

The function has an infinite number of roots of the form . If you start sufficiently close to a particular root, FindRoot will give you that root.
In[3]:=
Click for copyable input
Out[3]=
If you start with , you get a numerical approximation to the root .
In[4]:=
Click for copyable input
Out[4]=
If you want FindRoot to search for complex solutions, then you have to give a complex starting value.
In[5]:=
Click for copyable input
Out[5]=
This finds a zero of the Riemann zeta function.
In[6]:=
Click for copyable input
Out[6]=
This finds a solution to a set of simultaneous equations.
In[7]:=
Click for copyable input
Out[7]=

The variables used by FindRoot can have values that are lists. This allows you to find roots of functions that take vectors as arguments.

This is a way to solve a linear equation for the variable .
In[8]:=
Click for copyable input
Out[8]=
This finds a normalized eigenvector and eigenvalue .
In[9]:=
Click for copyable input
Out[9]=