Maths WorkshopMaths problems with full solutions
Exercise 392Calculus › Single-variable calculus › Continuity › Intermediate Value TheoremL1Added 2 Nov 2026

The bisection method in practice

#bisection#numerical methods#intermediate value theorem

Statement

  1. Show that cos⁡x=x\cos x=x has exactly one solution α\alpha in [0,1][0,1].
  2. Perform ten steps of the bisection method starting from [0,1][0,1].
  3. How many steps are needed to locate α\alpha within 10−610^{-6}?
Hint

Study g(x)=cos⁡x−xg(x)=\cos x-x. At each step, cut the interval in half and keep the half where gg changes sign.

Show solutionHide solution

Solution

1. Existence and uniqueness. g(x)=cos⁡x−xg(x)=\cos x-x is continuous with g(0)=1>0g(0)=1>0 and g(1)=cos⁡1−1<0g(1)=\cos1-1<0, so a root exists by the intermediate value theorem. Moreover g′(x)=−sin⁡x−1≤0g'(x)=-\sin x-1\le0, and it vanishes only at isolated points, so gg is strictly decreasing and the root is unique.

2. Bisection. At each step compute the midpoint mm of [a,b][a,b]; keep [a,m][a,m] if g(a)g(a) and g(m)g(m) have opposite signs, else keep [m,b][m,b].

  • Step 1: [0.5, 1][0.5,\ 1]
  • Step 2: [0.5, 0.75][0.5,\ 0.75]
  • Step 3: [0.625, 0.75][0.625,\ 0.75]
  • Step 4: [0.6875, 0.75][0.6875,\ 0.75]
  • Step 5: [0.71875, 0.75][0.71875,\ 0.75]
  • Step 6: [0.734375, 0.75][0.734375,\ 0.75]
  • Step 7: [0.734375, 0.7421875][0.734375,\ 0.7421875]
  • Step 8: [0.73828125, 0.7421875][0.73828125,\ 0.7421875]
  • Step 9: [0.73828125, 0.740234375][0.73828125,\ 0.740234375]
  • Step 10: [0.73828125, 0.7392578125][0.73828125,\ 0.7392578125]

The true value is α≈0.7390851\alpha\approx0.7390851, inside the last interval.

3. Number of steps. After nn steps the interval has length 2−n2^{-n}. We need 2−n≤10−62^{-n}\le10^{-6}, that is n≥6ln⁡10/ln⁡2≈19.9n\ge6\ln10/\ln2\approx19.9. So 2020 steps are enough.

Remark. The method is slow (about three steps per decimal digit) but it is guaranteed to converge as soon as the function is continuous and changes sign.