E21 Computer Engineering Fundamentals
October 22, 2026

At each subsequent bisection step, the bisection window is halved.

In all root-finding approaches, we:
while or for loop.Start with two estimates of the root.
Evaluate the function at both \(x_1\) and \(x_2\)
Draw a straight line between the two points. This is an estimate of the function’s behavior.
Locate the point \((x_3,0)\) where this line crosses the x-axis. Call this \(x_3\).
Let \((x_3,f_3)\) be a new point. Forget about \((x_1,f_1)\).
Repeat the process above, using the points \((x_2,f_2)\) and \((x_3,f_3)\)

from numpy import linspace
def f(x):
return -(x+1.5)*(x+2.5)
x1 = -2
x2 = -1
fx1 = f(x1)
fx2 = f(x2)
# Find equation of straight line
# thru (x1,fx1) and (x2,fx2)
m = (fx2-fx1)/(x2-x1)
print(f"Slope of the line btwn 2 points is {m}")
# To find y-intercept, use one of the points
# y = mx + c
# fx1 = m*x1 + c
# c = fx1 - m*x1
c = fx1 - m*x1
# equation of straight line is y = mx + c
# Now find the point where this line intscts
# the x-axis
# y = mx + c
# 0 = m*x_intercept + c
# x_intercept = - c/m
x_int = -c/m
print(f"The line intersects x-axis at {x_int}")Evaluate the function at your first guess.
Make a straight line tangent to \((x_1,f_1)\)
Find location where this line intersects x-axis. This is the 2nd guess, call it \(x_2\).
Repeat.

Derive an equation for \(x_{n+1}\) given \(x_n\)
Equation of the tangent line is \(y = mx+c\),
where \(m = f'(x_n)\). So we get \[y = f'(x_n) x + c\]
and \(c\) can be found by substituting a known point into the equation:
\(\underbrace{f(x_n)}_{\text{y coordinate}} = f'(x_n) \underbrace{x_n}_{\text{x coordinate}} + c \implies c = f(x_n) - f'(x_n) x_n\).
Thus, the equation of the straight line is \(\displaystyle{\color{red}{y}} = \overbrace{f'(x_n)}^{m} {\color{red}{x}} + \overbrace{f(x_n) - f'(x_n) x_n}^{c}\)
The intersection of this line with the \(x\) axis occurs when \(y=0\), i.e.:
\(0 =f'(x_n) {\color{red}{x}} + f(x_n) - f'(x_n) x_n\)
Recognizing that the unknown \({\color{red}{x}}\) is \(x_{n+1}\), we get \[f'(x_n) x_n - f(x_n)= f'(x_n) {\color{red}{x}} \implies \frac{f'(x_n) x_n - f(x_n)}{f'(x_n)} = {\color{red}{x}}\]
\[\implies \boxed{x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}}\]
If a root-finding program does not find a solution, it could be because:
A well-executed numerical method can solve problems 2-4 but cannot solve problem 1.
Suppose an equation is known to have multiple solutions, but only one of them is physically meaningful. A root-finding program will not necessarily find the solution we care about.
In the neighborhood of zero-slope points, these methods run into problems.
E21 • Fall 2026 • Lecture 14 • October 22, 2026 • ↩︎