You are on page 1of 9

The University of Sydney

School of Mathematics and Statistics

Solutions to Tutorial 2 (Week 3)


MATH2961: Linear Mathematics and Vector Calculus (Advanced) Semester 1, 2012
Lecturers: Daniel Daners and James Parkinson

Topics covered and aims


In lectures last week:

 Partial and directional derivatives. Tangent planes to level surfaces using ∇f .


 Higher order partials, The Mixed Derivatives Theorem.
 Taylor polynomials of order 1 and 2 and the Hessian matrix Hf (a).
 Taylor’s Theorem for functions f : Rn → R.
 Critical points of a function f : Rn → R.
 Quadratic forms, positive definite, negative definite, and indefinite matrices.
 Second derivative test for functions f : Rn → R (to be continued this week).

After completing this tutorial sheet you will be able to:

 Compute tangent planes to implicitly defined surfaces and graphs of functions.


 Find Taylor polys and understand how to create higher order approximations.
 Be able to work with the remainder term.
 Apply properties of the gradient vector to solve problems.
 Find the critical points of a function f : Rn → R.
 Apply the second derivatives test to functions f : Rn → R (more this week).
Preparation questions to do before class

1. Compute the second order Taylor polynomial of f (x, y) = cos(2x + y − 1) + yex


around (x, y) = (0, 1). Make a statement about the size of the remainder term.
Solution: Recall that the second order Taylor polynomial about (0, 1) is

T2 (x; (0, 1)) = f (0, 1) + fx (0, 1)x + fy (0, 1)(y − 1)


1 2 2

+ fxx (0, 1)x + 2fxy (0, 1)x(y − 1) + fyy (0, 1)(y − 1) .
2
Calculating all of the partial derivatives gives
3 1
T2 (x; (0, 1)) = 2 + x + (y − 1) − x2 − x(y − 1) − (y − 1)2 .
2 2
By Taylor’s Theorem the remainder term R2 (x; (0, 1)) = f (x, y) − T2 (x; (0, 1))
satisfies
R2 (x; (0, 1))
lim = 0.
(x,y)→(0,1) x2 + (y − 1)2

Copyright
c 2012 The University of Sydney 1
2. Find the tangent plane to the surface z cos x − sin y + z 2 tan−1 x = 1 at (0, π, 1).
Solution: The surface is implicitly defined by f (x, y, z) = 1. The gradient vector
is
z2
 
−1
∇f (x, y, z) = −z sin x + , − cos y, cos x + 2z tan x ,
1 + x2
and so ∇f (0, π, 1) = (1, 1, 1). Therefore we are looking for the equation of the
plane through (0, π, 1) with normal vector (1, 1, 1), and so the equation is

x + (y − π) + (z − 1) = 0, or x + y + z = π + 1.

3. I’m skiing on a mountain with equation z = 100 − 2x2 − 3y 4 + x − 2y. My current


location is (x, y) = (2, −1). Being adventurous I’d like to tackle the steepest slope
down the mountain. Which way should I ski initially? What slope will I encounter?
Solution: The gradient vector points in the direction of steepest ascent, and so
the negative of the gradient vector points in the direction of the steepest descent.
We have
∇f (x, y) = (−4x + 1, −12y 3 − 2),
and so I should ski in the
√ direction −∇f
√ (2, −1) = (7, −10). I’ll be tackling a slope
of −k∇f (2, −1)k = − 49 + 100 = − 149. This sounds pretty frightening – I’d
call this a cliff.

Questions to attempt in class

4. Find the equation of the tangent plane to the surface x3 − y 2 + xyz = 0 at the
point (1, 1, 0). Do this in two ways:
(a) by thinking of the surface as a level surface g(x, y, z) = 0, and
Solution: A surface defined by an equation g(x, y, z) = C is a level surface
of the function g. If a = (a, b, c) is a point on this surface then the gradient
vector of g at (a, b, c) is normal to the tangent plane of this level surface
at (a, b, c). So the tangent plane has equation

∇g(a) · (x − a) = 0.

In this case
∇g = (3x2 + yz, −2y + xz, xy).
Evaluating at (a, b, c) = (1, 1, 0), we get ∇g(a) = (3, −2, 1). So the plane
has equation

3(x − 1) − 2(y − 1) + (z − 0) = 0, equivalently 3x − 2y + z = 1.

(b) by thinking of the surface as the graph of a function z = f (x, y).


Solution: Solving the equation x3 − y 2 + xyz = 0 for z in terms of x and
y we get z = (y 2 − x3 )/xy = f (x, y) provided x, y 6= 0. Then

∂f 2x3 + y 2 ∂f x3 + y 2
=− and =
∂x x2 y ∂y xy 2

2
Using the formula for the tangent plane to a graph we see that
∂f ∂f
z = f (1, 1) + (1, 1)(x − 1) + (1, 1)(y − 1)
∂x ∂y
= 0 − 3(x − 1) + 2(y − 1)
= −3x + 2y + 1.

Rearranging this we get 3x − 2y + z = 1, as before.

5. Find all points on the circle x2 + y 2 = 1 where the circle is tangent to a level curve
of the function x2 + 6xy + y 2 .
Solution: At a point with the required property ∇(x2 + y 2 − 1) = (2x, 2y) must
be a scalar multiple of ∇(x2 + 6xy + y 2 ) = (2x + 6y, 2y + 6x). Hence we need to
solve the system

2x = λ(2x + 6y), 2y = λ(2y + 6x), x2 + y 2 = 1.

We can rewrite the system as

0 = (λ − 1)x + 3λy, 0 = 3λx + (λ − 1)y, x2 + y 2 = 1.

For fixed λ the first two equations are a linear system for x, y. One obvious solution
is (x, y) = (0, 0), but this does not satisfy the third equation. To ensure the
existence of a non-trivial solution of the linear system we need that the determinant
of the coefficient matrix is zero. Hence we require that (λ − 1)2 − 9λ2 = 0. Solving
this quadratic equation for λ we get λ1 = −1/2 and λ2 = 1/4. Substituting
λ1 = −1/2 into √ the first equation we get x = −y, and so from the last equation
x√ = −y = ± 2/2. If λ2 = 1/4 then x = y, and by the last equation x = y =
2 2 2 2
± 2/2. Hence the contour
√ lines
√ of x +6xy+y √ are√tangent to the circle x +y = 1
at the four points ±( 2/2, − 2/2) and ±( 2/2, 2/2).

6. Let f (x, y) = 2 cos(x + y 2 ) − y 2 + 3.


(a) Find all critical points of f .
Solution: We need to find the points where fx = 0 and fy = 0. Thus

fx = −2 sin(x + y 2 ) = 0
fy = −4y sin(x + y 2 ) − 2y = 0.

The first equation says that sin(x + y 2 ) = 0, and so x + y 2 = kπ for some


k ∈ Z. Then the second equation says that −2y = 0, and so y = 0. Thus
the critical points are (x, y) = (kπ, 0) with k ∈ Z.
(b) You should have found (0, 0) to be a critical point in part (a). Compute the
second order Taylor polynomial of f around this critical point.

3
Solution: We have

f (x, y) = 2 cos(x + y 2 ) − y 2 + 3
fx (x, y) = −2 sin(x + y 2 )
fy (x, y) = −4y sin(x + y 2 ) − 2y
fxx (x, y) = −2 cos(x + y 2 )
fyy = −4 sin(x + y 2 ) − 8y 2 cos(x + y 2 ) − 2
fxy (x, y) = −4y cos(x + y 2 ).

Let’s choose the critical point (0, 0). Thus the Taylor polynomial is

T2 (x, 0) = f (0, 0) + fx (0, 0)x + fy (0, 0)y


1
fxx (0, 0)x2 + 2fxy (0, 0)xy + fyy (0, 0)y 2

+
2
= 5 − (x2 + y 2 ).

(c) Use your answer from (b) to have a guess about the nature of the critical
point (0, 0) (is it a local max, min, or saddle?). Now use Taylor’s Theorem
to prove your claim.
Solution: I’m guessing that (0, 0) is going to be a local maximum. This
is because

f (x, y) = T2 (x, 0) + R2 (x, 0) = 5 − (x2 + y 2 ) + R2 (x, 0),

and Taylor’s Theorem tells us that R2 (x, 0) is small compared to x2 + y 2 .


Therefore the function f (x, y) behaves like 5 − (x2 + y 2 ) for (x, y) close to
(0, 0), and I know that this graph is an ‘upside down’ paraboloid.
To make this idea rigorous, by Taylor’s Theorem we have

R2 (x, 0)
lim = 0.
(x,y)→(0,0) x2 + y 2

Thus by the definition of limits there is a δ > 0 such that



R2 (x, 0)
x2 + y 2 < 1 whenever 0 < kxk < δ.

Thus
|R2 (x, 0)| < (x2 + y 2 ) whenever 0 < kxk < δ.
Therefore if 0 < kxk < δ we have

f (x, y) = 5 − (x2 + y 2 ) + R2 (x, 0)


< 5 − (x2 + y 2 ) + (x2 + y 2 )
= 5 = f (0, 0).

So f (x, y) < f (0, 0) for all (x, y) near (0, 0) (with (x, y) 6= (0, 0)), and so
f (0, 0) is a (strict) local maximum.

4
(d) Now apply the second derivatives test to get the same answer (hopefully!).
Solution: The Hessian matrix at (0, 0) is
   
fxx (0, 0) fyx (0, 0) −2 0
Hf (0, 0) = = .
fxy (0, 0) fyy (0, 0) 0 −2

This matrix has eigenvalues λ = −2, −2 (repeated), and hence is negative


definite. Thus the second derivatives test tells us that (0, 0) is a local maxi-
mum (as we expected).
Note that the argument in (b) is actually a special case of how the proof of
the second derivatives test goes.

7. Find all critical points of f (x, y, z) = x2 +y 2 +z 2 +2xy +2yz −4z +x and determine
their nature using the second derivatives test.
Solution: We need to solve the equation ∇f (x, y, z) = 0. So we have the
equations

2x + 2y + 1 = 0
2y + 2x + 2z = 0
2z + 2y − 4 = 0.

The first two equations imply that z = 12 . Then the third equation implies that
y = 23 , and the first implies that x = −2. So the only critical point is (x, y, z) =
(−2, 32 , 21 ). The Hessian matrix is
 
2 2 0
3 1
Hf (−2, , ) = 2 2 2 .
2 2
0 2 2
√ √
It has eigenvalues λ = 2 − 2 2, 2, 2 + 2 2. Since λmin < 0 and λmax > 0 we see
that Hf (−2, 32 , 21 ) is indefinite, and so (−2, 32 , 21 ) is a saddle point.

8. The temperature in Nemo’s tank at the point (x, y, z) is governed by the equation
T (x, y, z) = x2 + 2y 2 − xyz. Nemo is at (x, y, z) = (1, 2, −1). It is way too cold!
(T (1, 2, −1) = 11 degrees). Which way should he swim?
Solution: Nemo decides to swim in the direction of the gradient vector, because
he remembers that this vector points in the direction of the most rapid rate of
increase in temperature. He carefully calculates that

∇T (x, y, z) = (2x − yz, 4y − xz, −xy).

Unfortunately he dies mid-calculation. Had he been able to finish the computation,


he would have plugged in his current coordinates (x, y, z) = (1, 2, −1) and swam
in the direction
∇T (1, 2, −1) = (4, 9, −2).

5
Questions for extra practice

9. Let f : R2 → R. Decide what the 3rd order Taylor polynomial of f centered at


(x, y) = (a, b) should be, and say what Taylor’s Theorem says about the remainder
term (you are not asked to prove this - just make an educated guess).
Use your formula to give a cubic approximation to

f (x, y) = cos(2x + y − 1) + yex around the point (x, y) = (0, 1).

Solution: Let x = (x, y) and a = (a, b). The third order Taylor Polynomial
should be
T3 (x; a) = T2 (x; a) + cubic terms,
where T2 (x; a) = f (a) + ∇f (a) · (x − a) + 12 (x − a)T Hf (a)(x − a), and

cubic terms = c30 (x − a)3 + c21 (x − a)2 (y − b) + c12 (x − a)(y − b)2 + c03 (y − b)3

for constants yet to be determined. If we try to write

f (x) = T3 (x; a) + higher terms

then repeated differentiation gives

fxxx (a) = 6c30


fxxy (a) = 2c21
fxyy (a) = 2c12
fyyy (a) = 6c03 .

Therefore we set
1
T3 (x; a) = T2 (x; a) + fxxx (a)(x − a)3 + 3fxxy (a)(x − a)2 (y − b)
6
+ 3fxyy (a)(x − a)(y − b)2 + fyyy (a)(y − b)3 .


Let R3 (x, a) = f (x) − T3 (x, a). Taylor’s Theorem says that if the third order
partials exist around x = a and are continuous at x = a then

R3 (x, a)
lim = 0.
x→a kx − ak3

For the function in question, In Question 1 you computed


3 1
T2 (x; a) = 2 + x + (y − 1) − x2 − x(y − 1) − (y − 1)2
2 2
(where a = (0, 1)) and so computing all of the third order partial derivatives gives
3 1 1 1
T3 (x; a) = 2 + x + (y − 1) − x2 − x(y − 1) − (y − 1)2 + x3 + x2 (y − 1).
2 2 6 2

6
10. Find a point on the surface
√ x2 /9 + y 2 /4 + z 2 = 1 at which the tangent plane is
perpendicular to (1, 1, 3). Write down an equation of the tangent plane.
Solution: Set f (x, y, z) = x2 /9+y 2 /4+z 2 −1. Then ∇f (x, y, z) = (2/9x, 1/2y, 2z)
is perpendicular to the surface x2 /9 + y 2 /4 + z 2 = 1 at (x, y, z). We need to find a
point (x,
√ y, z) satisfying f (x, y, z) = 0 and for which ∇f (x, y, z) = (2/9x, 1/2y, 2z) =
λ(1, 1, 3) for some λ ∈ R. Hence we need to solve the following system of equa-
tions:
√ x2 y 2
2x = 9λ, y = 2λ, 2z = 3λ, + + z 2 = 1.
9 4
If we solve the first three equations for x, y and z, respectively, and substitute them
into the last we get
9 3
1 = λ2 + λ2 + λ2 = 4λ2 .
4 4
Solving for λ we get λ = ±1/2. Hence the √ tangent plane to the surface√ x2 /9 +
y 2 /4 + z 2√= 1 is perpendicular to (1, 1, 3) at the points (9λ/2, √ 2λ, 3λ/2) =
±(9/4, 1,√ 3/4). An equation √ for the tangent plane at (9/4,√1, 3/4) is therefore
x + y + 3z = 4, at −(9/4, 1, 3/4) an equation is x + y + 3z = −4.

4
11. Find all critical points of the function f (x, y) = −xy + x
+ y2 .

Solution: We need to find the points for which ∇f (x, y) = (−y − 4/x2 , −x −
2/y 2 ) = (0, 0), that is,

y + 4/x2 = 0 and x + 2/y 2 = 0.

Note that x 6= 0 and y 6= 0 as otherwise the function is not defined. From the first
equation y = −4/x2 . Substituting this into the second equation we get x+2x4 /16 =
x(1 + x3 /8) = 0. As x 6= 0 we have 1 + x3 /8 = 0, so x3 = −8 and therefore x = −2.
Now y = −4/x2 = −4/4 = −1. Hence (−2, −1) is the only critical point of f .

12. (a) Let f , g : R → Rn be differentiable. Prove that (f · g)′ = f ′ · g + f · g ′ .


Solution: We have

(f · g)′ = (f1 g1 + · · · + fn gn )′
= (f1 g1 )′ + · · · + (fn gn )′
= f1′ g1 + · · · + fn′ gn + f1 g1′ + · · · + fn gn′ = f ′ · g + f · g ′ .
 

(b) Let f , g : R → R3 be differentiable. Prove that (f × g)′ = f ′ × g + f × g ′ .



Solution: We have f × g = f2 g3 − f3 g2 , f3 g1 − f1 g3 , f1 g2 − f2 g1 , and so

(f × g)′ = f2′ g3 − f3′ g2 , f3′ g1 − f1′ g3 , f1′ g2 − f2′ g1




+ f2 g3′ − f3 g2′ , f3 g1′ − f1 g3′ , f1 g2′ − f2 g1′




= f ′ × g + f × g′.

 
a c
13. Let A = be a 2 × 2 real symmetric matrix. Show that:
c b

7
(a) A is positive definite if and only if det(A) > 0 and a > 0.
Solution: The characteristic equation of the matrix A is λ2 − (a + b)λ +
(ab−c2 ). Therefore by the root-coefficient relations the eigenvalues λmax and
λmin satisfy
λmin + λmax = a + b and λmin λmax = ab − c2 .
Suppose that A is positive definite. Then λmin , λmax > 0, and so a + b > 0
and ab − c2 > 0. Thus det(A) = ab − c2 > 0, and since ab > c2 we know that
a, b 6= 0 and that they have the same sign, and hence a > 0 by the inequality
a + b > 0.
Conversely, if det(A) = ab − c2 > 0 and a > 0 then b > 0 (by ab > c2 ) and
thus λmax + λmin = a + b > 0 and λmax λmin = ab − c2 > 0. Therefore λmin
and λmax are nonzero and have the same sign, and therefore λmin , λmax > 0
since λmin + λmax > 0. Hence A is positive definite.
(b) A is negative definite if and only if det(A) > 0 and a < 0.
Solution: This is very similar to (a).
(c) A is indefinite if and only if det(A) < 0.
Solution: Suppose that A is indefinite. Then λmin < 0 and λmax > 0.
Hence ab − c2 = λmin λmax < 0, and so det(A) < 0. Conversely, if det(A) < 0
then ab − c2 < 0, and so λmin λmax = ab − c2 < 0, and so λmin and λmax have
opposite signs, and so A is indefinite.
This checks the ‘quick version’ of the 2nd derivatives test for functions f : R2 → R.

14. Suppose that f : R2 → R has continuous second order partial derivaties. Suppose
that z = f (u, v) and that u = x + y and v = x − y. Show that
∂z ∂z  ∂z 2  ∂z 2 ∂ 2z ∂ 2z ∂ 2z
= − and = − .
∂x ∂y ∂u ∂v ∂x∂y ∂u2 ∂v 2

Solution: By the Chain Rule,


∂z ∂z ∂u ∂z ∂v ∂z ∂z
= + = +
∂x ∂u ∂x ∂v ∂x ∂u ∂v
and
∂z ∂z ∂u ∂z ∂v ∂z ∂z
= + = −
∂y ∂u ∂y ∂v ∂y ∂u ∂v
The first result follows by multiplying both sides of the last two equations.
∂z
For the second formula we use the chain rule again to differentiate ∂y with respect
to x. Thus
∂ 2z
 
∂ ∂z ∂z
= −
∂x∂y ∂x ∂u ∂v
 2
∂ 2 z ∂v
  2
∂ z ∂u ∂ 2 z ∂v

∂ z ∂u
= + − +
∂u2 ∂x ∂v∂u ∂x ∂u∂v ∂x ∂v 2 ∂x
∂ 2z ∂ 2z ∂ 2z ∂ 2z
= + − − .
∂u2 ∂v∂u ∂u∂v ∂v 2
Assuming equality of the mixed derivatives the middle terms cancel.

8
15. A function f : RN → R is radial if f (x) depends only on kxk, i.e., if f (x) = g(kxk),
where g(r) is some function, which we shall assume to be differentiable. Show that
if f is radial then ∇f (x) is a scalar multiple of x.
p 
Solution: Write f (x) = g x21 + · · · + x2N . Then by the Chain Rule,
∂f ′
q
2 2
 ∂ q
=g x1 + · · · + xN x21 + · · · + x2N
∂xj ∂xj

q  xj g ′ (kxk)
=g x21 + · · · + x2N p 2 = xj .
x1 + · · · + x2N kxk
g ′ (kxk)
Hence ∇f (x) = kxk
x.

Challenging problems

16. Let f : R2 → R and assume that the mixed partial derivatives fxy and fyx both
exist in a disc around (a, b). Let h, k > 0, and let
∆(h, k) = f (a + h, b + k) − f (a, b + k) − f (a + h, b) + f (a, b).
(a) Write ∆(h, k) as F (a + h) − F (a) where F (x) = f (x, b + k) − f (x, b). Use
the Mean Value Theorem twice to prove that
∆(h, k)
= fxy (α, β)
hk
where α = α(h, k) and β = β(h, k) with (α, β) → (a, b) as (h, k) → (0, 0).
Solution: We have
F ′ (x) = fx (x, b + k) − fx (x, b).
By the Mean Value Theorem, F (a + h) − F (a) = F ′ (α)h for some α between
a and a + h. Hence
∆(h, k) = F (a + h) − F (a) = F ′ (α)h = fx (α, b + k) − fx (α, b) h


Now apply the Mean Value Theorem again, this time to ϕ(y) = fx (α, y).
Thus ϕ(b + k) − ϕ(b) = ϕ′ (β)k for some β between b and b + k. But

ϕ′ (y) = fx (α, y) = fxy (α, y),
∂y
and so ∆(h, k) = fxy (α, β)hk, where (α, β) → (a, b) as (h, k) → (0, 0).
(b) Argue analogously to show that
∆(h, k)
= fyx (γ, δ)
hk
where γ = γ(h, k) and δ = δ(h, k) with (γ, δ) → (a, b) as (h, k) → (0, 0).
Solution: The same reasoning, starting with ∆(h, k) = G(b + k) − G(b)
where G(y) = f (a + h, y) − f (a, y).
(c) Deduce that if fxy and fyx are continuous at (a, b) then fxy (a, b) = fyx (a, b).
Solution: By parts (a) and (b) we have fxy (α, β) = fyx (γ, δ) where (α, β)
and (γ, δ) tend to (a, b) as (h, k) → (0, 0). Therefore by the assumed conti-
nuity of fxy and fyx at (a, b) we have fxy (a, b) = fyx (a, b).

You might also like