Percentages and Math

Root Finder

Type a function and an interval to find where it crosses zero and compare three methods.

Your numbers

Finds x where f(x) = 0. Use x, + - * / ^, parentheses and functions such as sin, cos, exp, ln, sqrt. Radians. Example function.

Bisection needs f to change sign between the two ends. The secant method starts from both.

Leave blank to start in the middle of the interval.

More options

Result

Root of f(x) = cos(x) - x

0.7390851332

Bisection took 34 iterations and f at the root is -5.11e-11.

Root (bisection)
0.739085133246
f at the root
-5.11e-11
Bisection iterations
34
Newton iterations
4
Secant iterations
6
Methods that agree
3 of 3, within 3.1e-11

Methods compared

MethodRootf(root)IterationsResult
Bisection0.739085133246-5.11e-1134converged
Newton0.73908513321504converged
Secant0.73908513321506converged

Bisection iterations

StepLowHighxf(x)
1010.50.3776
20.510.75-0.01831
30.50.750.6250.186
40.6250.750.68750.08533
50.68750.750.718750.03388
60.718750.750.7343750.007875
70.7343750.750.7421875-0.005196
80.7343750.74218750.738281250.001345
90.738281250.74218750.740234375-0.001924
100.738281250.7402343750.7392578125-0.000289
110.738281250.73925781250.738769531250.0005282
120.73876953130.73925781250.7390136718750.0001196
130.73901367190.73925781250.739135742188-0.0000847
140.73901367190.73913574220.7390747070310.00001745
150.7390747070.73913574220.739105224609-0.00003363
160.7390747070.73910522460.73908996582-8.088e-6
170.7390747070.73908996580.7390823364264.681e-6
180.73908233640.73908996580.739086151123-1.704e-6
190.73908233640.73908615110.7390842437741.489e-6
200.73908424380.73908615110.739085197449-1.075e-7
210.73908424380.73908519740.7390847206126.905e-7
220.73908472060.73908519740.739084959032.915e-7
230.7390849590.73908519740.7390850782399.201e-8
240.73908507820.73908519740.739085137844-7.747e-9
250.73908507820.73908513780.7390851080424.213e-8
260.7390851080.73908513780.7390851229431.719e-8
270.73908512290.73908513780.7390851303944.722e-9
280.73908513040.73908513780.739085134119-1.512e-9
290.73908513040.73908513410.7390851322561.605e-9
300.73908513230.73908513410.7390851331874.634e-11
310.73908513320.73908513410.739085133653-7.33e-10
320.73908513320.73908513370.73908513342-3.433e-10
330.73908513320.73908513340.739085133304-1.485e-10
340.73908513320.73908513330.739085133246-5.108e-11
How this was calculated
  1. Bisection halves an interval where f changes sign until it is smaller than the tolerance. It always succeeds when the sign change is real, but gains about one binary digit per step.
  2. Newton's method follows the tangent line: x(next) = x - f(x) / f'(x), with the slope taken from a central difference. It converges very fast near a simple root and can wander when started far away.
  3. The secant method replaces the slope with the line through the two latest points. It needs no slope and converges almost as fast as Newton.
  • A method that ends at a point where f is not exactly zero has only located a root to within the tolerance. When methods disagree, they may have found different roots of the same function.

Calculated using SumPanda.com · https://sumpanda.com/root-finder-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the root finder

  1. Type a function f(x), such as cos(x) - x. The page looks for x where f(x) = 0.
  2. Enter an interval where the function changes sign. Bisection needs this, and the secant method starts from both ends.
  3. Optionally set a starting guess for Newton's method, choose which method's iterations to display, and open More options to change the stopping size or the iteration limit.
  4. Compare the three methods in the table. They should agree on the root, and the iteration counts show how fast each converges.

Formula

bisection: halve [a, b] by keeping the half where f changes sign

Newton: x(next) = x - f(x) / f'(x)

secant: x(next) = x - f(x) (x - x(prev)) / (f(x) - f(x(prev)))

stop when the step is below tolerance x max(1, |x|)

The slope f'(x) in Newton's method is a central difference with a small step, so you can type any function without giving its derivative. Trigonometric functions use radians.

Where cosine meets the line y = x

The default function cos(x) - x on the interval 0 to 1 has its root at 0.7390851332, a number whose digits agree with the known fixed point of cosine. Bisection needs 34 halvings to bring the interval below 1e-10 and ends with f at the root equal to -5.11e-11.

Newton's method started in the middle of the interval takes only 4 iterations and the secant method takes 6. Both land on 0.739085133215 with f equal to 0 to the digits shown. The three roots agree within about 3e-11.

Choosing a method

Bisection is slow but sure. As long as the function is continuous and has opposite signs at the two ends, it must find a root, and each step gains one binary digit. Newton's method is very fast near a simple root but can jump far away if started where the slope is small. The secant method is nearly as fast without needing a slope.

When the methods disagree, they may have found different roots of the same function. Try a narrower interval or a different starting guess. For all the roots of a polynomial at once, the Polynomial Root Finder is better suited.

What a failure message means

If the function has the same sign at both ends, the page says so and does not run bisection. If a step lands where the function is not defined, such as the logarithm of a negative number, that method stops and says why. A zero slope stops Newton's method. Draw the function first with the Graphing Calculator to find a good interval.

More math tools

For other numerical questions, try the Numerical Integration Calculator, Error Propagation Calculator and Minimum Spanning Tree Calculator.

Assumptions and limits

  • The function is typed with the variable x and the operators and functions listed on the page, in radians.
  • The function is continuous on the interval for bisection to be reliable.
  • The tolerance is relative to the size of x, so very large roots need fewer digits of accuracy.
  • A converged method has found a point where f is within the tolerance of zero, not exactly zero.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

Why do the methods give slightly different roots?

Each stops when its own step is below the tolerance. Bisection stops when the interval is small, while Newton and secant often end closer to the true root because their last step is very accurate.

What if the function crosses zero more than once?

Each method finds one root, usually the one nearest to where it started. Use separate intervals around each crossing to find the others.

Why does bisection need a sign change?

The sign change is how it knows a root lies between the ends. If both ends have the same sign, there may be no root, or an even number of roots, in between.

Can I solve an equation such as x^2 = 5 - x?

Move everything to one side and type x^2 - 5 + x. The root of that function is the solution of the equation.