Skip to main content

6.2 Bisection search

Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §6.2. Rewritten in original wording — not a paste of Bisection.py. Continues 6.1 Quantum bound states. Labs: 6.2b Bisection labs.

Interval halving​

Suppose ff is continuous on [x−,x+][x_{-},x_{+}]. The intermediate-value theorem plus repeated discarding of the unsigned half traps a root. Pick the sign condition and the midpoint update among lookalikes.

Figure 6.1 — evaluate the midpoint; keep the half where the endpoint product stays negative.

Stop when (x+−x−)/2<ε(x_{+}-x_{-})/2<\varepsilon (or ∣f(x)∣|f(x)| is tiny). The reported root is the final midpoint.

Implementation notes​

  • Pick ε\varepsilon from the physics (energy to 10−1010^{-10} or better), not from “as small as possible.”
  • Poles of tan⁡\tan / cot⁡\cot can fake sign changes — use the equivalent residual
g(E)=E cot⁡10−E−10−Eg(E)=\sqrt{E}\,\cot\sqrt{10-E}-\sqrt{10-E}

and a bracket already known to have opposite signs (e.g. [8.0,8.8][8.0,8.8] for V0=10V_0=10).

  • Bisection needs only the sign of ff, so mild evaluation noise is usually tolerable.

Warm-up polynomial​

Before the well, practice on

h(x)=x3−x−2=0,x∈[1,2].h(x)=x^{3}-x-2=0,\qquad x\in[1,2].

h(1)=−2h(1)=-2, h(2)=4h(2)=4, so a root is trapped; bisection yields x≈1.5213797068x\approx 1.5213797068.

Back to the well​

With g(E)g(E) from §6.1 on [8.0,8.8][8.0,8.8], the same loop returns

EB≈8.5927852752.E_{B}\approx 8.5927852752.

Check ∣g(EB)∣|g(E_{B})| in scientific notation — it should sit near machine round-off for a tight ε\varepsilon.

Quiz

Bisection

1 / 4

Bisection requires…

Pick an answer to see if you are right.

Next: 6.2b Bisection labs — implement generic bisection, probe g(E)g(E), and lock EBE_{B}. Then 6.3 Newton–Raphson.