What is Halley's method?
Halley's method is an iterative numerical technique for solving an equation of the form \(f(x) = 0\). It is a third-order (cubic-convergence) relative of the Newton-Raphson method: where Newton uses only the function and its first derivative, Halley additionally uses the second derivative, which typically lets it reach a given accuracy in fewer iterations. This is a universal mathematics / numerical-analysis tool and applies anywhere; angles inside trigonometric functions are interpreted in radians.
How to use it
Enter the function whose root you want as \(f(x)\), then supply its first derivative \(f'(x)\) and second derivative \(f''(x)\) as expressions in \(x\). Supported syntax includes +, -, *, /, ^ for powers, parentheses, and functions such as sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, log/ln, log10, sqrt and abs, plus the constants pi and e. Pick a starting guess \(x_0\) close to the root you want, choose a maximum iteration count \(n\), and select how many significant digits to display.
The formula explained
Each step computes $$x_{n+1} = x_n - \frac{2\,f(x_n)\,f'(x_n)}{2\,[f'(x_n)]^2 - f(x_n)\,f''(x_n)}.$$ The numerator is the usual Newton correction (scaled), while the denominator's extra term \(- f(x_n)\,f''(x_n)\) corrects for the curvature of \(f\), accelerating convergence. The loop stops when the change in \(x\) or the residual \(f(x)\) drops below a tiny tolerance, or when the iteration limit is reached. If the denominator becomes zero the method breaks down and you should try a different \(x_0\).
Worked example
For \(f(x) = x - \cos(x)\), \(f'(x) = 1 + \sin(x)\), \(f''(x) = \cos(x)\), starting at \(x_0 = 1\): the first step gives $$x_1 = 1 - \frac{2 \cdot 0.4596977 \cdot 1.8414710}{2 \cdot 1.8414710^2 - 0.4596977 \cdot 0.5403023} = 1 - \frac{1.6930504}{6.5336550} = 0.7408769.$$ The iteration quickly settles on the Dottie number \(x = 0.7390851332151607\), the unique solution of \(x = \cos(x)\).
FAQ
How is Halley's method different from Newton's method? Newton's method ignores curvature; Halley's adds the second-derivative term, giving cubic instead of quadratic convergence, usually fewer iterations per correct digit.
Why must I enter the derivatives? This calculator trusts the derivatives you provide. If they are wrong, convergence will be poor or fail. Compute \(f'(x)\) and \(f''(x)\) by differentiating \(f(x)\) carefully.
What if it does not converge? The method finds the root nearest \(x_0\). A poor starting point can diverge or land on a different root, and a vanishing denominator stops it entirely. Change \(x_0\) or check your derivative expressions.