h0
R1 (h)
h
where limh0
R2 (h)
h2
= 0.
For us the first and second order Taylors expansions will be the most important ones. For many
functions, and certainly for all functions we encounter, we can let n be infinite and obtain a power
series expansion, called the Taylor series of f :
X
1 (n)
1
1
f (x)hn
f (x + h) = f (x) + f 0 (x)h + f 00 (x)h2 + f 000 (x)h3 + =
2
6
n!
n=0
This is of course provided all derivatives f (n) (x) exist. For example, f (x) = x has no Taylor series
1
around x = 0, as f 0 (x) = 2x is not defined at 0. However, it does have a Taylor series expansion
around x = 1. If in the formulas above we replace x with a fixed number a and x + h with a, we obtain
the perhaps more familiar form of the Taylor series
X 1
1
1
f (n) (a)(x a)n
f (x) = f (a) + f 0 (a)(x a) + f 00 (a)(x a)2 + f 000 (a)(x a)3 + =
2
6
n!
0
In the special case when a = 0, this yields the so called Maclaurin series of f :
X 1
1
f (x) = f (0) + f 0 (0)x + f 00 (0)x2 + =
f (n) (0)xn
2
n!
0
Of course the two formulations are equivalent. We will use the first one, as we are not so much
interested in trying to simplify f (x); rather, we are interested in understanding the behavior of f (x+h)
for small h, knowing f (x).
1
TAYLORS THEOREM
X
1
1
1
1
1 n
f (x) = f (0) + f 0 (0)x + f 00 (0)x2 + f 000 (0)x3 + = 1 + x + x2 + x3 + =
x
2
6
2
6
n!
n=0
Exercise: Expand x as a power series around x = 1. Expand sin x and cos x as power series
around x = 0, and verify that the derivative of cos x is sin x straight from the series.
Recall now the second derivative test for minima and maxima of functions:
Theorem: Suppose x0 is a critical point of y = f (x). Then
(1) x0 is a maximum if f 00 (x0 ) < 0
(2) x0 is a minimum if f 00 (x0 ) > 0
The test yields no information if f 00 (x) = 0.
You probably saw a proof of this result using a geometric argument involving convexity. A simple
proof can be given using Taylors theorem:
Proof of Second Derivative Test: The second Taylors expansion yields at the critical point x0 ,
for any small h:
1
1
f (x0 + h) f (x0 ) = f 0 (x0 )h + f 00 (x0 )h2 + R2 (h) = f 00 (x0 )h2 + R2 (h)
2
2
since f 0 (x0 ) = 0, as we are at a critical point. If f 00 (x0 ) > 0, then 21 f 00 (x0 )h2 > 0, and so
f 00 (x0 )h2 + R2 (h) > 0 for small h (this is because R2 (h) is much smaller than 21 f 00 (x0 )h2 , so, even if it
were a negative number, 12 f 00 (x0 )h2 + R2 (h) would still be positive). Therefore, f (x0 + h) f (x0 ) > 0.
This means that the values of f (x) around the point x0 are in fact bigger than the value f (x0 ), so
f (x0 ) is in fact a minimum.
Exercise: Use a similar argument to show that if f 00 (x0 ) < 0, f (x0 ) is a maximum.
f
f
h+
k + R1 (h, k)
x
y
where
R1 (h, k)
=0
(h,k)(0,0) |(h, k)|
We have already encountered this formula, which we called the theorem of linear approximaf
tion, as in particular it implies that the (linear) function f
x h + y k is a rather good approximation
lim
TAYLORS THEOREM
f
f
f
1 2f
f 2
h+
k + ( 2 h2 + 2
hk + 2 k 2 ) + R2 (h, k)
x
y
2 x
xy
y
where now
lim
(h,k)(0,0)
R2 (h, k)
=0
|(h, k)|2
The second Taylor expansion could also be called for example the theorem of quadratic approximation, as it asserts in particular that
f (x + h, y + k) f (x, y)
f
f
1 2f
f 2
f
h+
k + ( 2 h2 + 2
hk + 2 k 2 )
x
y
2 x
xy
y
is a very good approximation, but by a quadratic function instead of a linear one now. The quadratic
approximation is a much better approximation than the (already good) linear one; of course, it is an
approximation by a more complicated quantity. The first and second Taylor expansions are the two
statements we are after. Only the second one is new, as we already saw linear approximation. I will
now state for completeness the general form of Taylor expansion for z = f (x, y), but you should ignore
these in a first reading. The n-th Taylor expansion is
n
f
f
1 2f
f
f 2
1 X nf
h+ k+ ( 2 h2 +2
hk+ 2 k 2 )+ (
hni k i )+Rn (h, k)
x
y
2 x
xy
y
n! i=0 xni y i
where
lim
(h,k)(0,0)
Rn (h, k)
=0
|(h, k)|n
(so the more terms we consider, the better the approximations become) and the full Taylor Series
expansion is
n
X
f
f
1 2f
f
f 2
1 X f n
h+ k+ ( 2 h2 +2
hk+ 2 k 2 )+ =
(
hni k i )
ni y i
x
y
2 x
xy
y
n!
x
n=0
i=0
1
times the sum of all possible partial derivatives of
So the n-th term of the Taylor expansion is n!
order n, multiplied by the appropriate powers of h and k. For example, the third term explicitly is
1 3f 3
3f 2
3f
3f 3
2
( 3h +
h
k
+
hk
+
k )
6 x
x2 y
xy 2
y 3
Derivation of the Multivariable Taylor Expansion from the Single Variable One:
Consider the function of t defined by g(t) = f (x + th, y + tk). Usual Taylor expansion about t = 0
gives
1
g(t) g(0) = g 0 (0)t + g 00 (0)t2 +
2
By the chain rule,
TAYLORS THEOREM
f
f
h+
k
x
y
2f
2f 2
2f
2f 2
2f
2f 2
2f 2
h
+
k
=
h
+
2
k
hk
+
hk
+
hk
+
g 00 (0) =
x2
yx
xy
y 2
x2
yx
y 2
g 0 (0) =
f
f
= yx
. We set t = 1. We have g(1) g(0) = f (x + h, y + k) f (x, y), so the second
since xy
Taylor expansion follows. The higher Taylor expansions are obtained similiarily (though tediously).
2f
x2
2f
xy
2f
yx
2f
y 2
2f 2f
2f 2
(
)
x2 y 2
xy
(1) If
2f
x2
(2) If
2f
x2
0
2
so 2 f /x2 > 0, = 4 > 0. Thus the point is a minimum (this is geometrically obvious).
Example: Consider the function f (x, y) = 10 x2 2y 2 + 2xy. Its critical points are at (0, 0)
(check this), and the matrix of second partial derivatives is
2
2
2
4
0
2
TAYLORS THEOREM
f
= 2x + 4y = 0
x
f
= 2y + 4x = 0
y
which implies x = 2y = 4x, that is, x = y = 0. The matrix of second partial derivatives is
2
4
4
2
1
2
=
2c/y 3
1
1
2
1 2f 2
2f
2f
1
( 2h +2
hk + 2 k 2 ) = (ah2 + 2bhk + ck 2 )
2 x
xy
y
2
So the question of whether (x0 , y0 ) is a minimum, maximum, or saddle, reduces to the questions,
respectively:
(1) Is (ah2 + 2bhk + ck 2 ) > 0 for all (h, k)?
(2) Is (ah2 + 2bhk + ck 2 ) < 0 for all (h, k)? or
(3) Is (ah2 + 2bhk + ck 2 ) > 0 for some (h, k) and < 0 for others?
TAYLORS THEOREM
This last problem is in fact not so hard - it is essentially the quadratic formula. We can complete
the square and rewrite
b
b2
ah2 + 2bhk + ck 2 = a(h + k)2 + (c )k 2 .
a
a
Note that (h + ab k)2 is always positive. So the sign of a(h + ab k)2 equals the sign of a. Note also
2
that the sign of (c ba ) is the same as the sign of = ac b2 if a is positive and opposite if a is
negative. We have
2
(1) If a > 0, and > 0, both terms in a(h + ab k)2 + (c ba )k 2 are positive, hence ah2 + 2bhk + ck 2
is always positive.
2
(2) If a < 0, and > 0, both terms in a(h + ab k)2 + (c ba )k 2 are negative, hence ah2 + 2bhk + ck 2
is always negative.
(3) If < 0, and a > 0, then the first term is positive and the second negative, and ah2 +2bhk+ck 2
can attain both positive and negative values.
(4) if < 0, and a < 0, the first term is negative and the second positive, and ah2 + 2bhk + ck 2
can attain both positive and negative values.
But this is exactly the second derivative test.