844 Appendix A Numerical Methods
B
´
ezout matrix for d and e, the 4 ×4 matrix M = [m
ij
] with
m
ij
=
min(4,7−i−j)
k=max(4−j ,4−i)
w
k,7−i−j−k
for 0 ≤ i ≤ 3 and 0 ≤ j ≤ 3, with w
i,j
= d
i
e
j
− d
j
e
i
for 0 ≤ i ≤ 4 and 0 ≤ j ≤ 4. In
expanded form,
M =
w
4,3
w
4,2
w
4,1
w
4,0
w
4,2
w
3,2
+ w
4,1
w
3,1
+ w
4,0
w
3,0
w
4,1
w
3,1
+ w
4,0
w
2,1
+ w
3,0
w
2,0
w
4,0
w
3,0
w
2,0
w
1,0
Thedegreeofw
i,j
is 8 −i −j . The B
´
ezout determinant det(M(z)) is a polynomial of
degree 16 in z. For each solution ¯z to det(M(z)) = 0, we need to find corresponding
values ¯x and ¯y.
Using the B
´
ezout method hides the intermediate polynomials that were con-
veniently used in the previous cases to compute the other variables. Let us find
them explicitly. The elimination process may be applied directly to d(y) = d
0
+
d
1
y +d
2
y
2
+d
3
y
3
+d
4
y
4
and e(y) =e
0
+e
1
y +e
2
y
2
+e
3
y
3
+e
4
y
4
. Define f(y)=
e
4
d(y) − d
4
e(y) = f
0
+f
1
y +f
2
y
2
+f
3
y
3
. The coefficients are f
i
=e
4
d
i
−e
i
d
4
for
all i. Define g(y) = f
3
d(y) − d
4
yf (y) = g
0
+ g
1
y + g
2
y
2
+ g
3
y
3
. The coefficients
are g
0
=f
3
d
0
, g
1
=f
3
d
1
−f
0
d
4
, g
2
=f
3
d
2
−f
1
d
4
, and g
3
=f
3
d
3
−f
2
d
4
.Nowf(y)
and g(y) are cubic polynomials. The process is repeated. Define h(y) = g
3
f(y)−
f
3
g(y) =h
0
+h
1
y +h
2
y
2
,whereh
i
=g
3
f
i
−f
3
g
i
for all i. Define m(y) =h
2
f(y)−
f
3
yh(y) =m
0
+m
1
y +m
2
y
2
,wherem
0
=h
2
f
0
, m
1
=h
2
f
1
−h
0
f
3
, and m
2
=h
2
f
2
−
h
1
f
3
.Nowh(y) and m(y) are quadratic polynomials. As we saw earlier, if the poly-
nomials have a common solution, it must be ¯y = (h
2
m
0
− h
0
m
2
)/(h
1
m
2
− h
2
m
1
).
Because the d
i
and e
i
coefficients depend on ¯z, the values h
i
and m
i
depend on ¯z.
Thus, given a value for ¯z, we compute a corresponding value ¯y.Tocompute ¯x for
a specified pair ( ¯y, ¯z), F(x, ¯y, ¯z) = a
2
x
2
+ a
1
x + a
0
= 0 and G(x, ¯y, ¯z) = b
2
x
2
+
b
1
x + b
0
= 0 are two quadratic equations in the unknown x, so a common solution
is ¯x = (a
2
b
0
− a
0
b
2
)/(a
1
b
2
− a
2
b
1
).
Example Let F(x, y, z) = (x − 1)
2
+y
2
+z
2
−4 (sphere), G(x, y, z) = x
2
+4y
2
−4z (para-
boloid), and H(x, y, z) = x
2
+ 4(y − 1)
2
+ z
2
− 4 (ellipsoid). The polynomial d(y)
with coefficients dependent on z that represents D(y, z) has coefficients d
0
=−9 +
40z −10z
2
−8z
3
−z
4
, d
1
=0, d
2
=−34 +24z +6z
2
, d
3
=0, and d
4
=−9. The poly-
nomial e(y) with coefficients dependent on z that represents E(y, z) has coefficients
e
0
=−9 −4z
2
, e
1
= 80, e
2
= 98, e
3
= 48, and e
4
=−9. The w terms for the matrix
M are