Newton's method, also known as the Newton-Raphson method, is one of the most powerful and widely used algorithms for finding where a function equals zero. Starting from an initial guess x0, it repeatedly improves the estimate by following the tangent line at the current point to where it intersects the x-axis. The update formula is x1 = x0 minus f(x0) divided by f prime(x0). Because the method is based on a linear approximation of the function at each step, it converges quadratically near a simple root: the number of correct decimal places approximately doubles with each iteration. This means a few iterations from a reasonable starting point are usually enough to get many decimal places of accuracy. The classic example is finding the square root of 2 by solving x squared minus 2 = 0. Starting at x0 = 1.5, Newton's method converges to sqrt(2) = 1.4142135... in just a few steps. This calculator lets you enter any function f(x) using JavaScript math notation, an initial guess x0, and a maximum number of iterations up to 20. It computes the derivative numerically using the central difference formula and shows a table of each iteration with the x value, f(x) value, derivative value and the change in x. The iteration stops early if the change is smaller than 1e-12, indicating convergence.
Use x for the variable. Examples: x*x-2, Math.sin(x)-0.5, x**3-x-1. Use Math.pow(x,n), Math.sqrt(x), Math.log(x) etc.
Convergence is declared when |x1 - x0| < 1e-12. The derivative is computed numerically by central difference.
| n | x | f(x) | f'(x) | step |
|---|
Newton's method iterates the formula xn+1 = xn - f(xn) / f'(xn). The derivative f'(x) is approximated numerically using the central difference formula: f'(x) ≈ (f(x+h) - f(x-h)) / (2h) with h = 1×10-7. Iteration stops when |step| < 1×10-12 or the maximum number of iterations is reached. If the derivative is zero or near zero at any step, the method cannot continue and a warning is shown.
f(x) = x² - 2, x0 = 1.5, 10 iterations. Step 1: x1 = 1.5 - (1.5² - 2)/(2 × 1.5) = 1.5 - 0.25/3 = 1.4167. Step 2: x2 = 1.4167 - (1.4167² - 2)/(2 × 1.4167) = 1.4142. Step 3: the change is already less than 1e-12, so the method converges in about 3 to 4 steps to 1.4142 (√2), matching the defaults pre-filled above.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-07-02 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.