Chapter 5. Finding Roots

“Solve for x” is typically what we're asked to do when given an equation involving x as the unknown. One way to do it is to rewrite the equation into the form f(x) = 0, and then find the roots, or the zeros, of the function. In other words, we want to find the values of x such that f(x) = 0. Depending on the function, there may be more than one root, and they can be either real or complex, or there may be no roots at all. If we draw a graph of f(x) in the xy plane, then the real roots are those values of x wherever the plot crosses the x axis. This chapter explores various algorithms for finding real roots that are suitable for a computer.

Traditionally, these algorithms are called methods, as in bisection method and Newton's ...

Get Java™ Number Cruncher: The Java Programmer's Guide to Numerical Computing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.