Numerical Root Finding

(RefLink[NSolve, paclet:ref/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". (RefLink[FindRoot, paclet:ref/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.

Numerical root finding.

The curves for cos(x) and x intersect at one point:

Plot[{Cos[x],x},{x,-1,1}]

This finds a numerical approximation to the value of x at which the intersection occurs. The 0 tells (RefLink[FindRoot, paclet:ref/FindRoot]) what value of x to try first:

FindRoot[Cos[x]==x,{x,0}]

In trying to find a solution to your equation, (RefLink[FindRoot, paclet:ref/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, (RefLink[FindRoot, paclet:ref/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, (RefLink[FindRoot, paclet:ref/FindRoot]) will usually return that solution.

The function sin(x) has an infinite number of roots of the form x==n π. If you start sufficiently close to a particular root, (RefLink[FindRoot, paclet:ref/FindRoot]) will give you that root:

FindRoot[Sin[x],{x,3}]

If you start with x==6, you get a numerical approximation to the root x==2π:

FindRoot[Sin[x],{x,6}]

If you want (RefLink[FindRoot, paclet:ref/FindRoot]) to search for complex solutions, then you have to give a complex starting value:

FindRoot[Sin[x]==2,{x,I}]

This finds a zero of the Riemann zeta function:

FindRoot[Zeta[1/2+I t],{t,12}]

This finds a solution to a set of simultaneous equations:

FindRoot[{Sin[x]==Cos[y],x+y==1},{{x,1},{y,1}}]

The variables used by (RefLink[FindRoot, paclet:ref/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 x:

FindRoot[{{1,2},{3,4}}.x=={5,6},{x,{1,1}}]

This finds a normalized eigenvector x and eigenvalue a:

FindRoot[{{{1,2},{3,4}}.x==a x,x.x==1},{{x,{1,1}},{a,1}}]