Week 3 Roots of Polynomials
Week 3 Roots of Polynomials
𝑓 𝑥 = 𝑎% + 𝑎'𝑥 + 𝑎(𝑥 ( + ⋯ + 𝑎* 𝑥 *
Remember linear ordinary differential
equations (or linear ODEs)?
First-order ODE.
𝑑𝑦 𝑑𝑦
= 𝑓(𝑥, 𝑦) or + 𝑝 𝑥 𝑦 = 𝑞(𝑥)
𝑑𝑥 𝑑𝑥
Second-order ODE.
𝑑(𝑦 𝑑𝑦
𝑝 𝑥 ( +𝑞 𝑥 + 𝑟 𝑥 𝑦 = 𝑔(𝑥)
𝑑𝑥 𝑑𝑥
Let’s focus on a simple second-order
system
𝑑(𝑦 𝑑𝑦
𝑎( ( + 𝑎' + 𝑎%𝑦 = 𝑓(𝑡)
𝑑𝑡 𝑑𝑡
𝑑𝑦 𝑑𝑧
𝑧= 𝑎( + 𝑎'𝑧 + 𝑎%𝑦 = 𝑓(𝑡)
𝑑𝑡 𝑑𝑡
𝑑𝑧 𝑓 𝑡 − 𝑎'𝑧 − 𝑎%𝑦
=
𝑑𝑡 𝑎(
A system of n first-order ODEs
We converted a second-order ODE to a system of first-order
ODEs as below
𝑑𝑧 𝑓 𝑡 − 𝑎'𝑧 − 𝑎%𝑦
=
𝑑𝑡 𝑎(
𝑑𝑦
=𝑧
𝑑𝑡
Newton-Raphson method
𝑓(𝑥D )
𝑥DE' = 𝑥D − F
𝑓 𝑥D
Secant method
What if when using the Newton-Raphson method, it was
difficult to take the derivate of f(x)?
𝑓 𝑥DH' − 𝑓(𝑥D )
𝑓F 𝑥D ≅
𝑥DH' − 𝑥D
(𝑥DH'−𝑥D )
𝑥DE' = 𝑥D − 𝑓(𝑥D )
𝑓 𝑥DH' − 𝑓(𝑥D )
Müller’s method
Secant’s method projects a straight line to the x axis through
two function values while Müller's method takes a similar
approach, but projects a parabola through three points.
Müller’s method
We need to derive the coefficients
of the parabola that goes through
the three points. These coefficients
are substituted into the quadratic
formula where the parabola
intercepts the x axis – that is, the
root estimate.
𝑓 𝑥 = 𝑎(𝑥 − 𝑥()(+𝑏 𝑥 − 𝑥( + 𝑐
Intersecting 3 points
𝑓 𝑥% = 𝑎(𝑥% − 𝑥()(+𝑏 𝑥% − 𝑥( + 𝑐
𝑓 𝑥' = 𝑎(𝑥' − 𝑥()(+𝑏 𝑥' − 𝑥( + 𝑐
𝑓 𝑥( = 𝑎(𝑥( − 𝑥()(+𝑏 𝑥( − 𝑥( + 𝑐
𝑐 = 𝑓(𝑥()
𝑓 𝑥 = 𝑎(𝑥 − 𝑥()(+𝑏 𝑥 − 𝑥( + 𝑐
Root estimate
−2𝑐
𝑥M = 𝑥( +
𝑏 ± 𝑏 ( − 4𝑎𝑐
𝛿' − 𝛿%
𝑎=
ℎ' + ℎ%
𝑏 = 𝑎ℎ'+ 𝛿'
𝑐 = 𝑓(𝑥()
Example
User Muller’s method with guesses of 𝑥%=4.5, 𝑥'=5.5 and
𝑥(=5 to determine a root of the following equations.
𝑓 𝑥 = 𝑥 M − 13𝑥 − 12
Example
Let’s first evaluate the function at the three guess points:
𝑓 4.5 = 20.625
𝑓 5.5 = 82.875
𝑓 5 = 48
We then calculate
𝑓(𝑥') − 𝑓(𝑥%)
ℎ% = 𝑥' − 𝑥% = 1 𝛿% = = 62.25
𝑥' − 𝑥%
ℎ' = 𝑥( − 𝑥' = −0.5 𝑓(𝑥() − 𝑓(𝑥')
𝛿' = = 69.75
𝑥( − 𝑥'
Example
We can now calculate
𝛿' − 𝛿%
𝑎= = 15
ℎ' + ℎ%
𝑏 = 𝑎ℎ'+ 𝛿' = 62.25
𝑐 = 𝑓(𝑥()=48
First root estimate
So the first estimate of the root is
−2(48)
𝑥M = 5 +
62.25 ± 31.54461
𝑥M = 3.976487
−1.023513
𝜀Y = 100% = 25.74%
3.976487
The error is probably too large still. We should do another
iteration.
More iterations
So, the new three guess points are
𝑥% = 5.5
iteration 𝑥9 𝜀Y %
𝑥' = 5 0 5 -
𝑥( = 3.976487 1 3.976487 25.74
2 4.00105 0.6139
3 4 0.0262
4 4 0.0000119
Bairstow’s method
Bairstow’s method is an iterative approach related loosely to
both the Muller and Newton-Raphson methods.
𝑓* 𝑥 = 𝑎% + 𝑎'𝑥 + 𝑎(𝑥 ( + ⋯ + 𝑎* 𝑥 *
with a remainder 𝑅 = 𝑏%
𝑏* = 𝑎*
𝑏D = 𝑎D + 𝑏DE'𝑡 𝑓𝑜𝑟 𝑖 = 𝑛 − 1 𝑡𝑜 0
Allowing for complex roots
Let’s still consider a general polynomial
𝑓* 𝑥 = 𝑎% + 𝑎'𝑥 + 𝑎(𝑥 ( + ⋯ + 𝑎* 𝑥 *
𝜕𝑏' 𝜕𝑏'
𝑏' 𝑟 + ∆𝑟, 𝑠 + ∆𝑠 = 𝑏' + ∆𝑟 + ∆𝑠
𝜕𝑟 𝜕𝑠
𝜕𝑏% 𝜕𝑏%
𝑏% 𝑟 + ∆𝑟, 𝑠 + ∆𝑠 = 𝑏% + ∆𝑟 + ∆𝑠
𝜕𝑟 𝜕𝑠
How to minimize R?
𝜕𝑏' 𝜕𝑏'
𝑏' 𝑟 + ∆𝑟, 𝑠 + ∆𝑠 = 𝑏' + ∆𝑟 + ∆𝑠
𝜕𝑟 𝜕𝑠
𝜕𝑏% 𝜕𝑏%
𝑏% 𝑟 + ∆𝑟, 𝑠 + ∆𝑠 = 𝑏% + ∆𝑟 + ∆𝑠
𝜕𝑟 𝜕𝑠
We now somehow “magically” solve this system of two
equations to obtain ∆𝑟 and ∆𝑠.
Note we try to achieve: 𝑏'= 𝑏% = 0.
Obtaining ∆𝑟 and ∆𝑠
𝒄𝒏 = 𝒃 𝒏
𝒄𝒏H𝟏 = 𝒃𝒏H𝟏 + 𝒓𝒄𝒏
𝒄𝒊 = 𝒃𝒊 + 𝒓𝒄𝒊E𝟏 + 𝒔𝒄𝒊E𝟐 𝒇𝒐𝒓 𝒊 = 𝒏 − 𝟐 𝒕𝒐 𝟏
𝒄𝟐 ∆𝒓 + 𝒄𝟑 ∆𝒔 = −𝒃𝟏
𝒄𝟏 ∆𝒓 + 𝒄𝟐 ∆𝒔 = −𝒃𝟎
Example
User Bairstow’s method with initial guesses of 𝑟 = 𝑠 = −1 to
determine a root of the following polynomial.
𝑏w = 𝑎w = 1
𝑏` = 𝑎` − 𝑏w = −4.5
𝑏M = 𝑎M + 𝑟𝑏` + 𝑠𝑏w = 6.25
𝑏( = 𝑎( + 𝑟𝑏M + 𝑠𝑏` = 0.375
𝑏' = −10.5
𝑏% = 11.375
Example
𝑓w 𝑥 = 𝑥 w − 3.5𝑥 ` + 2.75𝑥 M + 2.125𝑥 ( − 3.875𝑥 + 1.25
𝑐w = 𝑏w = 1
𝑐` = 𝑏` + 𝑟𝑐w = −5.5
𝑐M = 10.75
𝑐( = −4.875
𝑐' = −16.375
Example
Now that we have b and c values, let’s put together the
simultaneous equations.
𝑐(∆𝑟 + 𝑐M∆𝑠 = −𝑏'
𝑐'∆𝑟 + 𝑐(∆𝑠 = −𝑏%
𝑟 = −0.5
𝑠 = 0.5
𝑥 ( − 𝑟𝑥 − 𝑠 = 𝑥 ( + 0.5𝑥 − 0.5