Quadratic Interpolation
Quadratic Interpolation
KELLER VANDEBOGERT
1. Introduction
2. Methods of Interpolation
q(x) = ax2 + bx + c
f1 − f2 − f10 (x1 − x2 )
(2.2) a=
−(x1 − x2 )2
f1 − f2 − f10 (x1 − x2 )
b = f10 + 2 x1
(x1 − x2 )2
METHOD OF QUADRATIC INTERPOLATION 3
−b 1 (x1 − x2 )f10
(2.3) xmin = = x1 −
2a 2 f10 − xf1 −f 2
1 −x2
0
1 (xk−1 − xk )fk−1
(2.4) xk+1 = xk−1 −
2 fk−1
0
− fk−1 −fk
xk−1 −xk
With (2.4), we generate xk+1 and compare it with the previous two
points to find our new bracketing interval, and then continue the iter-
ation.
2.2. Method 2. This method is very similar to our first method but
instead generates q(x) by solving a different set of equations. We have:
We can of course solve these for a and b in the same way as in Section
2.1. We find the explicit form of the minimizer of q(x) to be:
x1 − x2 0
(2.6) xmin = x1 − f
f10 − f20 1
In an identical manner to (2.4), we generate a recursion by defining
xmin = x3 , and we have:
4 KELLER VANDEBOGERT
xk−1 − xk 0
(2.7) xk+1 = xk−1 − f
0
fk−1 − fk0 k−1
Which is commonly called the secant formula.
fk0
xk+1 = xk − 00
fk
But this is precisely the iteration defined by Newton’s method. This
motivates calling (2.7) the secant method, because it is just Newton’s
method with the secant approximation of f 00 (xk ) instead.
(2.8)
(x − x2 )(x − x3 ) (x − x1 )(x − x3 ) (x − x1 )(x − x2 )
q(x) = f1 + f2 + f3
(x1 − x2 )(x1 − x3 ) (x2 − x1 )(x2 − x3 ) (x3 − x1 )(x3 − x2 )
To find the minimum, we of course take the derivative of (2.8) and
set it to 0. By doing this, we obtain:
(2.10)
1 1 (fk−1 − fk )(fk − fk+1 )(fk+1 − fk−1 )
xk+2 = (xk−1 +xk )+
2 2 (xk − xk+1 )fk−1 + (xk+1 − xk−1 )fk + (xk−1 − xk )fk+1
This method differs slightly from the previous two methods, because
it is not as simple to determine the new bracketing interval. If xmin
lies between x1 and x3 , then we want to compare the distance between
xmin and x2 . If
|xmin − x2 | <
3. Convergence Rates
We will also need the following result, which we shall state without
proof:
Lemma 3.2. Let f ∈ C n+1 [a, b], and let p be the polynomial of degree
≤ n that interpolates f at n + 1 distinct points x0 , x1 , ..., xn ∈ [a, b].
Then, to each x ∈ [a, b] there exists a ξx ∈ (a, b) such that
k
f (n+1) (ξx ) Y
f (x) − p(x) = (x − xi )
(n + 1)! i=0
Where f (n) (x) denotes the nth derivative of f . This remainder term
will often be denoted Rn+1 .
Proof. We first want to prove that (2.7) does indeed converge to our
minimizer, x∗ .
Let L(x) be the 2 point interpolant for f 0 (x). Then, with Lemma
3.2, we have:
f 000 (ξ)
f 0 (x) − L(x) = (x − xk−1 )(x − xk )
2
Since xk+1 is generated by maximizing q(x), we have that L(xk+1 ) =
0. Thus,
f 000 (ξ)
f 0 (xk+1 ) = (xk+1 − xk−1 )(xk+1 − xk )
2
If we substitute the recursion for xk+1 given by (2.7) into the above
equation, we can simplify this into:
METHOD OF QUADRATIC INTERPOLATION 7
1 (xk − xk−1 )2
(3.1) 0
f 0 (xk+1 ) = f 000 (ξ)fk0 fk−1
2 (fk0 − fk−1
0
)2
We now want to take advantage of the Mean Value Theorem. We
have:
fk0 − fk−1
0
= f 00 ξ0
xk − xk−1
Where ξ0 ∈ (xk , xk−1 ). Also note that since f 0 (x∗ ) = 0, we have:
0 < m2 ≤ |f 00 (x)| ≤ M2
m1 m22 M1 M22
(3.4) e e
k k−1 ≤ e k+1 ≤ ek ek−1
2M23 2m32
However, using (3.3):
8 KELLER VANDEBOGERT
ek+1 ≤ M δ 2 → 0
yk+1 = yk + yk−1
√
1+ 5
This is of course a simple a recurrence relation. Let φ = 2
and
√
1− 5
φ̄ = 2
. We easily find the closed form of yk to be:
M ek+1 exp(αφk+1 )
≈ →1
M φ eφk exp(αφkφ )
With this:
|xk+1 − x∗ |
→ M φ−1
|xk − x∗ |φ
And with Definition 3.1, this implies that xk → x∗ with order φ =
√
1+ 5
2
.
Where R3 in the third degree remainder term for the Lagrange inter-
polant. Now, since x∗ is a critical point, we clearly have that f 0 (x∗ ) = 0.
With this and (3.8):
10 KELLER VANDEBOGERT
(3.9)
2x∗ − (x2 + x3 ) 2x∗ − (x1 + x3 ) 2x∗ − (x1 + x2 )
f1 +f2 +f3 +R30 (x∗ ) = 0
(x1 − x2 )(x1 − x3 ) (x2 − x1 )(x2 − x3 ) (x3 − x1 )(x3 − x2 )
We now use (3.9) to solve for x∗ :
∗ f1 f2 f3
2x + + +R30 (x∗ )
(x1 − x2 )(x1 − x3 ) (x2 − x1 )(x2 − x3 ) (x3 − x1 )(x3 − x1 )
f1 (x2 + x3 ) f2 (x1 + x3 ) f3 (x1 + x2 )
= + +
(x1 − x2 )(x1 − x3 ) (x2 − x1 )(x2 − x3 ) (x3 − x1 )(x3 − x2 )
Which then gives:
1 R30 (x∗ )
(3.10) x∗ = − f1 f2 f3
2 (x1 −x2 )(x1 −x3 )
+ (x2 −x1 )(x2 −x3 )
+ (x3 −x1 )(x3 −x1 )
f1 (x2 +x3 ) f2 (x1 +x3 ) f3 (x1 +x2 )
+ +
1 (x1 −x2 )(x1 −x3 ) (x2 −x1 )(x2 −x3 ) (x3 −x1 )(x3 −x2 )
+ f1 f2 f3
2 (x1 −x2 )(x1 −x3 )
+ (x2 −x1 )(x2 −x3 )
+ (x3 −x1 )(x3 −x1 )
1 R30 (x∗ )
(3.11) x∗ − x4 = − f1 f2 f3
2 (x1 −x2 )(x1 −x3 )
+ (x2 −x1 )(x2 −x3 )
+ (x3 −x1 )(x3 −x1 )
METHOD OF QUADRATIC INTERPOLATION 11
(3.12)
1
e4 f1 (e2 −e3 )+f2 (e3 −e1 )+f3 (e1 −e2 ) = − R30 (x∗ )(e1 −e2 )(e2 −e3 )(e3 −e1 )
2
By means of the Taylor expansion about x∗ , it is clear that
1
fi = f (x∗ ) + e2i f 00 (x∗ ) + O(e3i )
2
Where we’ve used the fact that f 0 (x∗ ) = 0. Now, for ei sufficiently
small, we have neglect the third order term of the Taylor expansion.
Substituting each respective Taylor expansion into (3.12), we get the
following:
1 1 1
f (x∗ )+ e21 f 00 (x∗ ) (e2 −e3 )+ f (x∗ )+ e22 f 00 (x∗ ) (e3 −e1 )+ f (x∗ )+ e23 f 00 (x∗ ) (e1 −e2 )
e4
2 2 2
1
= − R30 (x∗ )(e1 − e2 )(e2 − e3 )(e3 − e1 )
2
Now examine the coefficient of e4 in the above expression. We find:
(3.13)
1 1 1
f (x∗ )+ e21 f 00 (x∗ ) (e2 −e3 )+ f (x∗ )+ e22 f 00 (x∗ ) (e3 −e1 )+ f (x∗ )+ e23 f 00 (x∗ ) (e1 −e2 )
2 2 2
1 00 ∗ 2
= f (x ) e1 (e2 − e3 ) + e22 (e3 − e1 ) + e23 (e1 − e2 )
2
1
= f 00 (x∗ ) (e22 − e21 )e3 + (e23 − e21 )e2 + (e23 − e22 )e1
2
1
= f 00 (x∗ )(e1 − e2 )(e2 − e3 )(e3 − e1 )
2
12 KELLER VANDEBOGERT
1
(3.14) e4 = − R0 (x∗ )
f 00 (x∗ ) 3
We now seek an explicit form of the derivative of our remainder term.
From the form given by Lemma 3.2, it can be found that
1 1
(3.15) R30 (x∗ ) = − f 000 (ξx∗ )(e1 e2 + e2 e3 + e3 e1 ) + f (4) (η)e1 e2 e3
6 24
Where η is some constant. We now want to to neglect the fourth
order term, because the fourth derivative is bounded and the product
e1 e2 e3 will become arbitrarily small much faster than the first term.
Using (3.15) and (3.14):
f 000 (ξx∗
(3.16) e4 = (e1 e2 + e2 e3 + e3 e1 )
6f 00 (x∗ )
Which easily generalizes to:
f (ξx∗ 000
Where we define M = − 6f 00 (x∗ ) . It is also clear that for sufficiently
In a similar fashion to the proof for Theorem 3.3, we can easily define
δi = log(M̄ |ei |). By doing so, we easily see that:
METHOD OF QUADRATIC INTERPOLATION 13
δk+2 = δk + δk−1
M̄ |ek+1 |
δk+1 − τ1 δk → 0 =⇒ →1
M̄ τ1 |ek |τ1
But then we have that
|xk − x∗ |
(3.20) → M̄ τ1 −1
|xk−1 − x∗ |τ1
But of course by Definition 3.1, this implies xk → x∗ with order τ1 .
Numerically, we see that τ1 ≈ 1.3247, and we are done.
14 KELLER VANDEBOGERT
From these two results we see that having knowledge of the derivative
of f does indeed allow for a more accurate interpolant and thus a faster
rate of convergence to the minimizer x∗ .
4. Numerical Tests
√ √
(2) f (x) = −2e− x
( x + 1) + cos(x)
1
(3) f (x) = 720
x6 − 36x5 + 450x4 − 2400x3 + 5400x2 − 4320x + 720
(The 6th Laguerre Polynomial)
1
(4) f (x) = Γ(x)
(Reciprocal of the Gamma Function)
16 KELLER VANDEBOGERT
(6) f (x) = x log(x) − 1 − sin(x)
1√ x3
(9) f (x) = 2
πerf(x) − 3
(erf(x) denotes the Error Function)
1√
(10) f (x) = 2
πerf(x) − sin(x)
5. Conclusion
Appendix
Secant Method.
this programs will still find the optimizer, but it takes more iterations
than normal.
METHOD OF QUADRATIC INTERPOLATION 21
3-Point Method.
given interval. Also, another possible reason for the discrepancy in it-
erations is the tolerance values. Choosing the tolerance too small in
some cases would cause the bracketing interval to become too small
and it was difficult for MATLAB to distinguish between points when
the tolerance was right at machine precision.
References
[1] Optimization Theory and Methods: Nonlinear Programming. Wenyu Sun, Ya-
Xiang Yuan. 89-98.