{
  "id": "newtons-method",
  "version": "10d74d48a9f2",
  "status": "published",
  "name": "Newton’s Method Calculator",
  "question": "Where does Newton’s method lead?",
  "summary": "Runs Newton’s method xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ) from a first guess x₀ and shows every step.",
  "category": "math",
  "subcategory": "calculus",
  "url": "https://www.acalculator.org/math/newtons-method-calculator",
  "markdown": "https://www.acalculator.org/math/newtons-method-calculator.md",
  "kind": "function",
  "method": "xₖ₊₁ = xₖ − f(xₖ)/f′(xₖ), with f′ from a computer algebra system, checked numerically.",
  "assumptions": [
    "Steps run in double precision; angles in radians.",
    "It stops when f′(xₖ) = 0 or f(xₖ) = 0."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "f": {
        "title": "Function f(x)",
        "description": "The function whose zero you want.",
        "type": "string",
        "maxLength": 200
      },
      "x0": {
        "title": "First guess x₀",
        "description": "Where to start.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "n": {
        "title": "Steps",
        "description": "How many steps to take (it stops early when xₙ₊₁ = xₙ).",
        "type": "integer",
        "minimum": 1,
        "maximum": 50
      }
    }
  },
  "outputs": {
    "root": {
      "label": "Last estimate xₙ",
      "description": "The last value of x Newton’s method reached.",
      "format": "number"
    },
    "settled": {
      "label": "Settled?",
      "description": "Whether the last step changed x by at most 10⁻¹⁰ of its size.",
      "format": "text"
    },
    "steps": {
      "label": "Steps",
      "description": "Each estimate xₖ.",
      "format": "text"
    },
    "derivative": {
      "label": "f′(x) =",
      "description": "The derivative used in each step.",
      "format": "math"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "f": "x^3 - 3x + 1",
      "x0": 2,
      "n": 6
    },
    "outputs": {
      "root": 1.532088886237956,
      "settled": "yes",
      "steps": "x₀ = 2; x₁ = 1.666666667; x₂ = 1.548611111; x₃ = 1.532390162; x₄ = 1.532088989; x₅ = 1.532088886; x₆ = 1.532088886",
      "derivative": "3x^2 - 3"
    },
    "text": "After the steps from x₀ = 2, Newton’s method for x^3 - 3x + 1 reaches 1.532088886."
  },
  "examples": [
    {
      "given": {
        "f": "x^3 - 3x + 1",
        "x0": 2,
        "n": 6
      },
      "expect": {
        "root": 1.532088886237956,
        "settled": "yes"
      },
      "source": "OpenStax, Calculus Volume 1, section 4.9 Newton’s Method (https://openstax.org/books/calculus-volume-1/pages/4-9-newtons-method), Example 4.46: x₆ ≈ 1.532088886; the root is 2cos(2π/9) (Python 3)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "f": "x^2 - 2",
        "x0": 2,
        "n": 3
      },
      "expect": {
        "root": 1.4142156862745099,
        "steps": "x₀ = 2; x₁ = 1.5; x₂ = 1.416666667; x₃ = 1.414215686"
      },
      "source": "OpenStax, Calculus Volume 1, section 4.9 Newton’s Method (https://openstax.org/books/calculus-volume-1/pages/4-9-newtons-method), Example 4.47: x₁ = 1.5, x₂ ≈ 1.416666667, x₃ ≈ 1.414215686 (exactly 577/408)"
    },
    {
      "given": {
        "f": "x^3 - 2x + 2",
        "x0": 0,
        "n": 4
      },
      "expect": {
        "root": 0,
        "settled": "not yet: take more steps or try another x₀"
      },
      "source": "OpenStax, Calculus Volume 1, section 4.9 Newton’s Method (https://openstax.org/books/calculus-volume-1/pages/4-9-newtons-method), Example 4.48: x₀ = 0, x₁ = 1, x₂ = 0, … the estimates swing between 0 and 1"
    }
  ],
  "sources": [
    "OpenStax, Calculus Volume 1, section 4.9 Newton’s Method (retrieved 2026-10-03): https://openstax.org/books/calculus-volume-1/pages/4-9-newtons-method"
  ],
  "related": [
    "equation-solver",
    "derivative",
    "tangent-line",
    "linear-approximation"
  ],
  "changelog": []
}
