Halley's Method Solver
Solve f(x)=0 with Halley's method. Enter the expression, an initial guess, a tolerance, and the iteration limit to get the approximate root, f(root), iteration count, error, an iteration table, and a convergence chart.
Input
e.g. x^2 - 2, cos(x) - x, exp(x) - 3x, sin(x). Supports + - * / ^, functions like sin/cos/log/sqrt, and the constants pi and e.
e.g. 1e-10
Result
Approximate root x
1.41421356237
Converged within the tolerance.
f(root) value
4.4409e-16
Iterations
3
Final step size
3.6438e-7
Convergence of the residual |f(x)| (log-scale vertical axis)
Iteration steps
| n | x | f(x) | Step |Δx| |
|---|---|---|---|
| 1 | 1 | -1 | 0.3999999 |
| 2 | 1.39999990456 | -0.040000267 | 0.014213293 |
| 3 | 1.414213198 | -1.0306e-6 | 3.6438e-7 |
Note: the derivatives f′ and f″ are approximated by central-difference numerical differentiation. Depending on the shape of f(x) the iteration may not converge, so placing the initial guess near the root makes it more stable.
How it works
- Enter a function f(x), an initial guess x₀, a tolerance, and a maximum iteration count, and the tool finds an approximate root of f(x)=0 using Halley's method.
- Expressions may use the four basic operations (+ - * /), exponentiation (^ or **), parentheses, the variable x, the constants pi and e, plus functions such as sin, cos, tan, exp, log (natural log), sqrt, and abs. Implicit multiplication like 2x or 2sin(x) is also understood.
- Halley's method is an iterative scheme that uses the first and second derivatives, giving cubic convergence that is faster than Newton's method (quadratic convergence). Near the root, the number of correct digits roughly triples with each iteration.
- Alongside the approximate root, the tool shows the value of f(root), the iteration count, and the final step size, and lets you inspect x and the residual at each iteration in a table and convergence chart.
- If the initial guess is far from the root, or depending on the shape of the function, the method may not converge. In that case, move the initial guess closer to the root or revise the tolerance and iteration count.
- The derivatives are approximated by central-difference numerical differentiation, so the results are approximate values that contain a small amount of error.
Related calculators
Bisection Method Equation Solver
NumericalSolve f(x)=0 with the bisection method. Enter a function and an interval to get the approximate root, f(root), the iteration count, and the error, plus a per-step table of intervals and midpoints and a function graph.
Open calculator →False Position Method (Regula Falsi) Solver
NumericalA numerical tool that solves your equation f(x)=0 with the false position method (linear interpolation, regula falsi). Enter an interval and a tolerance to get the approximate root, f(root), the iteration count, and a table and chart of the iteration process.
Open calculator →Newton's Method (specify f(x) and f'(x))
NumericalEnter f(x) and its derivative f'(x) as expressions and use Newton's method to find an approximate root of f(x)=0. Includes an iteration table and a convergence chart.
Open calculator →Newton's Method Calculator (f(x) only, numerical derivative)
NumericalSolve f(x) = 0 with Newton's method. Just enter the equation, initial guess, tolerance, and max iterations - the derivative is approximated automatically by numerical differentiation. Shows the approximate root, f(root), iteration count, error, plus a step table and a graph.
Open calculator →