
290 • Optimization and Linearization
It might seem confusing to reuse a and b like this. A way around it is
to use x
0
as the initial guess and x
1
as the first improvement; then x
2
is the
second improvement, starting with x
1
; and so on. The formula can now be
written like this:
x
1
= x
0
−
f(x
0
)
f
0
(x
0
)
, x
2
= x
1
−
f(x
1
)
f
0
(x
1
)
, x
3
= x
2
−
f(x
2
)
f
0
(x
2
)
, and so on.
Here’s another example. To find an approximate solution of the equation
x = cos(x), first set f(x) = x −cos(x). If we can estimate the zero of f, then
the same number will be an approximate solution of x = cos(x). (We already
used this trick in Section 5.1.4 of Chapter 5.) Let’s make the guess x
0
= π/2;
then f(π/2) = π/2 − cos(π/2) = π/2. That’s a pretty lousy guess. Never
mind; since f
0
(x) = 1 + sin(x), we have f
0
(π/2) = 1 + sin(π/2) = 2. This
means that
x
1
= x
0
−
f(x
0
)
f
0
(x
0
)
=
π
2
−
π/2
2
=
π
4
.
So x
1
= π/4 is a better approximation; indeed, f(π/4) works out to be the
quantity π/4 − 1/
√
2, which is about 0.08. Now repeat:
x
2
= x
1
−
f(x
1
)
f
0
(x
1
)
=
π
4
−
f(π/4)
f
0
(π/4)
=
π
4
−
π/4 − 1/
√
2
1 + 1/
√
2
,
since f
0
(π/4) = 1 + sin(π/4) = 1 + 1/
√
2. The above equation simplifies to
x
2
=
1 + π/4
1 +
√
2
= (1 + π/4)(
√
2 − 1),
which is actually a little less than π/4. Also, f (x
2
) turns out to be about
0.0008. This means that x −cos(x
2
) is about 0.0008, so the number x
2
above
is a pretty good approximation to the solution of the equation x = cos(x).
Of course, we could repeat the method to find an even better approximation
x
3
, but the calculations become horrible. Computers and calculators are
very good at it, though, and in fact often use Newton’s method to give good
approximations. (Remember, a calculator only gives approximations! Even
10 or 12 decimal places is still not exact, although it’s close enough in most
situations.)
As we noted before (but never explained), sometimes Newton’s method
doesn’t work. Here are four different things that could go wrong:
PSfrag replacements
(
a, b)
[
a, b]
(
a, b]
[
a, b)
(
a, ∞)
[
a, ∞)
(
−∞, b)
(
−∞, b]
(
−∞, ∞)
{
x : a < x < b}
{
x : a ≤ x ≤ b}
{
x : a < x ≤ b}
{
x : a ≤ x < b}
{
x : x ≥ a}
{
x : x > a}
{
x : x ≤ b}
{
x : x < b}
R
a
b
shadow
0
1
4
−
2
3
−
3
g(
x) = x
2
f(
x) = x
3
g(
x) = x
2
f(
x) = x
3
mirror (
y = x)
f
−
1
(x) =
3
√
x
y = h
(x)
y = h
−
1
(x)
y = (
x − 1)
2
−
1
x
Same height
−
x
Same length,
opposite signs
y = −
2x
−
2
1
y =
1
2
x − 1
2
−
1
y = 2
x
y = 10
x
y = 2
−
x
y = log
2
(
x)
4
3 units
mirror (
x-axis)
y = |
x|
y = |
log
2
(x)|
θ radians
θ units
30
◦
=
π
6
45
◦
=
π
4
60
◦
=
π
3
120
◦
=
2
π
3
135
◦
=
3
π
4
150
◦
=
5
π
6
90
◦
=
π
2
180
◦
= π
210
◦
=
7
π
6
225
◦
=
5
π
4
240
◦
=
4
π
3
270
◦
=
3
π
2
300
◦
=
5
π
3
315
◦
=
7
π
4
330
◦
=
11
π
6
0
◦
= 0 radians
θ
hypotenuse
opposite
adjacent
0 (
≡ 2π)
π
2
π
3
π
2
I
II
III
IV
θ
(
x, y)
x
y
r
7
π
6
reference angle
reference angle =
π
6
sin +
sin −
cos +
cos −
tan +
tan −
A
S
T
C
7
π
4
9
π
13
5
π
6
(this angle is
5
π
6
clockwise)
1
2
1
2
3
4
5
6
0
−
1
−
2
−
3
−
4
−
5
−
6
−
3π
−
5
π
2
−
2π
−
3
π
2
−
π
−
π
2
3
π
3
π
5
π
2
2
π
3
π
2
π
π
2
y = sin(
x)
1
0
−
1
−
3π
−
5
π
2
−
2π
−
3
π
2
−
π
−
π
2
3
π
5
π
2
2
π
2
π
3
π
2
π
π
2
y = sin(
x)
y = cos(
x)
−
π
2
π
2
y = tan(
x), −
π
2
< x <
π
2
0
−
π
2
π
2
y = tan(
x)
−
2π
−
3π
−
5
π
2
−
3
π
2
−
π
−
π
2
π
2
3
π
3
π
5
π
2
2
π
3
π
2
π
y = sec(
x)
y = csc(
x)
y = cot(
x)
y = f(
x)
−
1
1
2
y = g(
x)
3
y = h
(x)
4
5
−
2
f(
x) =
1
x
g(
x) =
1
x
2
etc.
0
1
π
1
2
π
1
3
π
1
4
π
1
5
π
1
6
π
1
7
π
g(
x) = sin
1
x
1
0
−
1
L
10
100
200
y =
π
2
y = −
π
2
y = tan
−
1
(x)
π
2
π
y =
sin(
x)
x
, x > 3
0
1
−
1
a
L
f(
x) = x sin (1/x)
(0 < x < 0
.3)
h
(x) = x
g(
x) = −x
a
L
lim
x
→a
+
f(x) = L
lim
x
→a
+
f(x) = ∞
lim
x
→a
+
f(x) = −∞
lim
x
→a
+
f(x) DNE
lim
x
→a
−
f(x) = L
lim
x
→a
−
f(x) = ∞
lim
x
→a
−
f(x) = −∞
lim
x
→a
−
f(x) DNE
M
}
lim
x
→a
−
f(x) = M
lim
x
→a
f(x) = L
lim
x
→a
f(x) DNE
lim
x
→∞
f(x) = L
lim
x
→∞
f(x) = ∞
lim
x
→∞
f(x) = −∞
lim
x
→∞
f(x) DNE
lim
x
→−∞
f(x) = L
lim
x
→−∞
f(x) = ∞
lim
x
→−∞
f(x) = −∞
lim
x
→−∞
f(x) DNE
lim
x →a
+
f(
x) = ∞
lim
x →a
+
f(
x) = −∞
lim
x →a
−
f(
x) = ∞
lim
x →a
−
f(
x) = −∞
lim
x →a
f(
x) = ∞
lim
x →a
f(
x) = −∞
lim
x →a
f(
x) DNE
y = f (
x)
a
y =
|
x|
x
1
−
1
y =
|
x + 2|
x + 2
1
−
1
−
2
1
2
3
4
a
a
b
y = x sin
1
x
y = x
y = −
x
a
b
c
d
C
a
b
c
d
−
1
0
1
2
3
time
y
t
u
(
t, f(t))
(
u, f(u))
time
y
t
u
y
x
(
x, f(x))
y = |
x|
(
z, f(z))
z
y = f(
x)
a
tangent at x = a
b
tangent at x = b
c
tangent at x = c
y = x
2
tangent
at x = −
1
u
v
uv
u + ∆
u
v + ∆
v
(
u + ∆u)(v + ∆v)
∆
u
∆
v
u
∆v
v∆
u
∆
u∆v
y = f(
x)
1
2
−
2
y = |
x
2
− 4|
y = x
2
− 4
y = −
2x + 5
y = g(
x)
1
2
3
4
5
6
7
8
9
0
−
1
−
2
−
3
−
4
−
5
−
6
y = f (
x)
3
−
3
3
−
3
0
−
1
2
easy
hard
flat
y = f
0
(
x)
3
−
3
0
−
1
2
1
−
1
y = sin(
x)
y = x
x
A
B
O
1
C
D
sin(
x)
tan(
x)
y =
sin(
x)
x
π
2
π
1
−
1
x = 0
a = 0
x > 0
a > 0
x < 0
a < 0
rest position
+
−
y = x
2
sin
1
x
N
A
B
H
a
b
c
O
H
A
B
C
D
h
r
R
θ
1000
2000
α
β
p
h
y = g(
x) = log
b
(x)
y = f(
x) = b
x
y = e
x
5
10
1
2
3
4
0
−
1
−
2
−
3
−
4
y = ln(
x)
y = cosh(
x)
y = sinh(
x)
y = tanh(
x)
y = sech(
x)
y = csch(
x)
y = coth(
x)
1
−
1
y = f(
x)
original function
inverse function
slope = 0 at (
x, y)
slope is infinite at (
y, x)
−
108
2
5
1
2
1
2
3
4
5
6
0
−
1
−
2
−
3
−
4
−
5
−
6
−
3π
−
5
π
2
−
2π
−
3
π
2
−
π
−
π
2
3
π
3
π
5
π
2
2
π
3
π
2
π
π
2
y = sin(
x)
1
0
−
1
−
3π
−
5
π
2
−
2π
−
3
π
2
−
π
−
π
2
3
π
5
π
2
2
π
2
π
3
π
2
π
π
2
y = sin(
x)
y = sin(
x), −
π
2
≤ x ≤
π
2
−
2
−
1
0
2
π
2
−
π
2
y = sin
−
1
(x)
y = cos(
x)
π
π
2
y = cos
−
1
(x)
−
π
2
1
x
α
β
y = tan(
x)
y = tan(
x)
1
y = tan
−
1
(x)
y = sec(
x)
y = sec
−
1
(x)
y = csc
−
1
(x)
y = cot
−
1
(x)
1
y = cosh
−
1
(x)
y = sinh
−
1
(x)
y = tanh
−
1
(x)
y = sech
−
1
(x)
y = csch
−
1
(x)
y = coth
−
1
(x)
(0
, 3)
(2
, −1)
(5
, 2)
(7
, 0)
(
−1, 44)
(0
, 1)
(1
, −12)
(2
, 305)
y = 1
2
(2
, 3)
y = f(
x)
y = g(
x)
a
b
c
a
b
c
s
c
0
c
1
(
a, f(a))
(
b, f(b))
1
2
1
2
3
4
5
6
0
−
1
−
2
−
3
−
4
−
5
−
6
−
3π
−
5
π
2
−
2π
−
3
π
2
−
π
−
π
2
3
π
3
π
5
π
2
2
π
3
π
2
π
π
2
y = sin(
x)
1
0
−
1
−
3π
−
5
π
2
−
2π
−
3
π
2
−
π
−
π
2
3
π
5
π
2
2
π
2
π
3
π
2
π
π
2
c
OR
Local maximum
Local minimum
Horizontal point of inflection
1
e
y = f
0
(
x)
y = f (
x) = x ln(x)
−
1
e
?
y = f(
x) = x
3
y = g(
x) = x
4
x
f(
x)
−
3
−
2
−
1
0
1
2
1
2
3
4
+
−
?
1
5
6
3
f
0
(
x)
2 −
1
2
√
6
2 +
1
2
√
6
f
00
(
x)
7
8
g
00
(
x)
f
00
(
x)
0
y =
(
x − 3)(x − 1)
2
x
3
(
x + 2)
y = x ln(x)
1
e
−
1
e
5
−108
2
α
β
2 −
1
2
√
6
2 +
1
2
√
6
y = x
2
(x − 5)
3
−
e
−1/2
√
3
e
−1/2
√
3
−e
−3/2
e
−3/2
−
1
√
3
1
√
3
−1
1
y = xe
−3x
2
/2
y =
x
3
− 6x
2
+ 13x − 8
x
28
2
600
500
400
300
200
100
0
−100
−200
−300
−400
−500
−600
0
10
−10
5
−5
20
−20
15
−15
0
4
5
6
x
P
0
(x)
+
−
−
existing fence
new fence
enclosure
A
h
b
H
99
100
101
h
dA/dh
r
h
1
2
7
shallow
deep
LAND
SEA
N
y
z
s
t
3
11
9
L(11)
√
11
y = L(x)
y = f (x)
11
y = L(x)
y = f(x)
F
P
a
a + ∆x
f(a + ∆x)
L(a + ∆x)
f(a)
error
df
∆x
a
b
y = f(x)
true zero
starting approximation
better approximation
1. The value of f
0
(a) could be near 0. Clearly, if
b = a −
f(a)
f
0
(a)
,
then f
0
(a) can’t be 0 or else b isn’t even defined. In that case, the tangent
line at x = a doesn’t even intersect the x-axis, since it’s horizontal! Even
if f
0
(a) is close, but not equal to 0, Newton’s method can still give a
whacked-out result; for example, check out this picture: