When I faced this problem, I used the root-finder implemented in programs like Mathematica, matlab, etc. This way is very easy and pragmatic. This is the link for FindRoot coomand in Mathematica. http://reference.wolfram.com/mathematica/ref/FindRoot.html