Solutions to Math 51 Final Exam — December 7, 2015

Solutions to Math 51 Final Exam — December 7, 2015
1. (10 points)
3
(a) Let P bethe
in R
 plane 3x + 2y − z = 4 
 . Find the real number a for which the line L that passes
1
1
through 1 with direction vector 3 does not intersect the plane P. Show all reasoning.
0
a
 
1
Since 1 is clearly not contained in P (as 3 · 1 + 2 · 1 − 0 6= 4), the line L is parallel to the plane
0
 
 
1
1



P if and only if its direction vector 3 is parallel to P , or in other words if 3 is equal to the
a
a
 
1
vector connecting two points of P . Thus we need the vector 3 to lie in the nullspace of the
a
matrix 3 2 −1 , that is,
 
1
3 2 −1 3 = 3 · 1 + 2 · 3 + (−1) · a = 0,
a
so a = 9.
(b) The lines L1 and L2 in R4 , defined parametrically by
L1 = {(s, s, s, s) : s ∈ R} and L2 = {(2t, −t, 6 − t, 2) : t ∈ R},
do not have any points in common; find the length of the shortest line segment joining a point
on L1 and a point on L2 . Show all of your reasoning; you may assume that such a shortest line
segment exists. Simplify your answer as much as possible.
Solution 1: Set f (s, t) = k(s, s, s, s) − (2t, −t, 6 − t, 2)k. We just need to minimize the two
variable function f (s, t).
f (s, t) = k(s − 2t, s + t, s + t − 6, s − 2)k
p
= (s − 2t)2 + (s + t)2 + (s + t − 6)2 + (s − 2)2
p
= 4s2 + 6t2 − 16s − 12t + 40
p
= 4(s − 2)2 + 6(t − 1)2 + 18
√
√
≥ 18 = 3 2,
with equality when s = 2 and t = 1. The corresponding points on L1 and L2 are (2, 2, 2, 2)
and (2, −1, 5, 2), respectively, and the vector
p connecting them
√ is (2, 2, 2, 2) − (2, −1, 5, 2) =
(0, 3, −3, 0), which does indeed have length 32 + (−3)2 = 3 2.
 
 
 
1
2
0
1
−1
0

  ~ =  , so L1 = {s~u : s ∈ R} and L2 = {t~v + w
Solution 2: Let ~u = 
~ : t ∈ R}.
1 , ~v = −1 , w
6
1
0
2
We want to minimize the length of the vector t~v + w
~ − s~u = w
~ − (s~u − t~v ), so s, t should be
chosen such that
s~u − t~v = ProjSpan(~u,~v) (w).
~
In order to compute this projection, we first try to find an orthogonal basis for Span(~u, ~v ).
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 2 of 17
Luckily, we have
   
2
1
1 −1
  
~u · ~v = 
1 · −1 = 1 · 2 + 1 · (−1) + 1 · (−1) + 1 · 0 = 0,
0
1
so the basis {~u, ~v } is already an orthogonal basis for Span(~u, ~v )! Thus, we have
ProjSpan(~u,~v) (w)
~ = Proj~u (w)
~ + Proj~v (w)
~
~u · w
~
~v · w
~
~u +
~v
~u · ~u
~v · ~v
2 · 0 + (−1) · 0 + (−1) · 6 + 0 · 2
1·0+1·0+1·6+1·2
~u +
~v
=
12 + 1 2 + 1 2 + 1 2
22 + (−1)2 + (−1)2
= 2~u − ~v
 
0
3

=
3 .
2
=
Thus s = 2 and t = 1, and the difference between the corresponding points of L1 and L2 is
     
0
0
0
0 3  3 
    
1~v + w
~ − 2~u = w
~ − (2~u − 1~v ) = 
6 − 3 = −3 ,
2
2
0
p
√
√
which has length 32 + (−3)2 = 18 = 3 2.
Solution 3: Name vectors ~u, ~v , w
~ as in the second solution, and define a matrix A by A =


1 −2
↑ ↑


~u −~v  = 1 1 . We want to solve the least-squares problem
1 1 
↓ ↓
1 0
A
s
≈ w.
~
t
s
The least-squares solution has A
− w ∈ C(A)⊥ = N (AT ), so
t
s
A A
= AT w.
~
t
T
We have
~u · ~u −~u · ~v
4 0
A A=
=
,
−~v · ~u ~v · ~v
0 6
T
while
AT w
~=
so
4 0
0 6
~u · w
~
8
=
,
−~v · w
~
6
s
8
=
.
t
6
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 3 of 17
Thus s = 2 and t = 1, etc.
Solution 4: Name vectors ~u, ~v , w
~ as in the second solution, and set ~x = s~u − (t~v + w)
~ =

s − 2t
 s+t 


s + t − 6. The shortest segment between two lines is perpendicular to the directions of both
s−2
lines, so we have
~u · ~x = 1 · (s − 2t) + 1 · (s + t) + 1 · (s + t − 6) + 1 · (s − 2) = 4s − 8 = 0
and
~v · ~x = 2 · (s − 2t) + (−1) · (s + t) + (−1) · (s + t − 6) + 0 · (s − 2) = −6t + 6 = 0.
Thus s = 2 and t = 1, etc.
Solution 5: Name vectors ~u, ~v , w
~ as in the second solution. For each t, we will find the point
s~u on L1 which is closest to t~v + w. Since L1 is a line passing through the origin, we can use the
projection formula to find
Proj~u (t~v + w)
~ =
~u · (t~v + w)
~
0t + 8
~u =
~u,
~u · ~u
4
so for each t the best choice of s turns out to be
minimize
8
4
= 2. Plugging in s = 2, we are trying to
f (2, t) = k(2, 2, 2, 2) − (2t, −t, 6 − t, 2)k
= k(−2t + 2, 2 + t, t − 4, 0)k
p
= (−2t + 2)2 + (t + 2)2 + (t − 4)2 + 02
p
= 6t2 − 12t + 24
p
= 6(t − 1)2 + 18
√
√
≥ 18 = 3 2,
so the minimum occurs when t = 1, etc.
Solution 6: Define f (s, t) as in the first solution, and write g(s, t) = f (s, t)2 . As in the first
solution, we have
g(s, t) = 4s2 + 6t2 − 16s − 12t + 40.
If either s or t has absolute value at least 100 then we have
g(s, t) = 4(s − 2)2 + 6(t − 1)2 + 18 > (100 − 2)2 > 40 = g(0, 0),
so we look for the smallest value of g(s, t) such that (s, t) is in the closed and bounded region
{(s, t) | −100 ≤ s ≤ 100, −100 ≤ t ≤ 100}. Since this region is closed and bounded, we know
that g(s, t) has a minimum value somewhere in the region, and since the minimum obviously
can’t be on the boundary of the region, the minimum must be one of the critical points of g.
Taking the gradient and setting it equal to 0, we have
8s − 16
0
∇g(s, t) =
=
,
12t − 12
0
so s = 2 and t = 1, etc.
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 4 of 17
2. (8 points) Let P be the plane in R4 defined by equations
x1 + x2 = 0,
x3 + x4 = 0.
(a) It is a fact (which you do not have to prove) that P is a subspace of R4 . Find a basis for P .
It is straight-forward to see that

  
1
0 −1  0 
 , 
0 1
0
−1
serves as a basis for the plane P .
(b) Suppose T : R4 → R4 is orthogonal projection onto theplane
P . Find the matrix of T ; in other
x1
x2
words, find the matrix A so that T (x) = Ax for all x = x3 ∈ R4 . Simplify your answer as much
x4
as possible.
Let A be the matrix


1
0
−1 0 
,
A=
0
1
0 −1
whose column is a basis of the plane (vector space)

1

1
−1
A(At A)−1 At = 
2 0
0
P . Then the projection matrix is given by

−1 0
0
1
0
0
.
0
1 −1
0 −1 1
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 5 of 17
3. (8 points) Each of the statements below is either always true (“T”), or always false (“F”), or sometimes
true and sometimes false, depending on the situation (“MAYBE”). For each part, decide which and
circle the appropriate choice; you do not need to justify your answers.
(a) Given a matrix A, then C(A) = C(rref(A)).
T
F
MAYBE
1 0
1 1
1 1
True when A =
(= rref(A)); but false when A =
(and rref(A) =
).
0 0
1 1
0 0
(b) Given a matrix A, then C(AT ) = C((rref(A))T ).
T
F
MAYBE
The row space of A is always equal to the row space of rref(A), because performing a row
operation on a matrix does not change its row space.
(c) Given an m × n matrix A and vectors x 6= y in Rn for which Ax = Ay,
then x − y lies in the null space of A.
This follows because 0 = Ax − Ay = A(x − y).
T
F
MAYBE
(d) Given an m × n matrix A and a vector v 6= 0 in Rm for which AT v = 0,
then v lies in the column space of A.
T
F
MAYBE
Since AT v = 0, we know v lies in N (AT ) = C(A)⊥ , i.e., v is orthogonal to every vector in C(A).
The only vector that simultaneously lies in the column space of A, and is orthogonal to every
vector in the column space of A, is the zero vector; but here we are given v 6= 0.
(e) Given two nonzero matrices A, B such that AB is equal to the zero matrix, T
F
MAYBE
then the columns of A are linearly independent.
Every column of AB takes the form Ab for some column b of B; since B is nonzero it follows that
there is a nonzero column vector bi , and since AB is the zero matrix we have Abi = 0. Thus,
the null space of A contains a nonzero vector, and so the columns of A are linearly dependent
by Proposition 8.3.
(f) Given two nonzero matrices A, B such that AB is equal to the zero matrix, T
F
MAYBE
then the rows of A are linearly independent.


1 1
2 −1 −1
1 1
1
1


True when A =
and B = 1 1 ; but false when A =
and B =
.
1 1 −2
2 2
−1 −1
1 1
MAYBE
(g) Given an m × n matrix A and a vector v in Rm such that AT v = 0,
T
F
then v = 0.
Certainly this is sometimes true (i.e.,when v = 0 and A is any matrix of the given size); but it
1 0
0
can be false when, for example, A =
and v =
.
0 0
1
(h) Given an m × n matrix A and a vector x in Rn such that ATAx = 0,
T
F
MAYBE
then Ax = 0.
One way to see that this is always true is to note that v = Ax lies in the column space of A and
also satisfies AT v = 0; now part (d) implies that having v 6= 0 is impossible in such a situation.
For another way, note that ATAx = 0 implies that
0 = xT 0 = xT (ATAx) = (xTAT )Ax = (Ax)TAx = (Ax) · (Ax) = kAxk2 ,
and this can only be true if Ax = 0.
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 6 of 17
4. (9 points)
(a) Show that, for each choice of fixed vectors b ∈ R3 and c ∈ R2 , the formula T (x) = (x · b)c defines
a linear transformation T : R3 → R2 .
For any vector x ∈ R3 , the dot product with b ∈ R3 gives a scalar. Multiplying that scalar
times c ∈ R2 gives a vector in R2 so T goes from R3 to R2 . We must show that it is a linear
transformation. By definition, this means that we must show that, for vectors x, y ∈ R3 , and for
a scalar k ∈ R:
T (x + y) = T (x) + T (y)
and
T (kx) = k T (x).
To show these properties we calculate:
T (x + y) = ((x + y) · b)c = ((x · b) + (y · b))c = (x · b)c + (y · b)c = T (x) + T (y).
T (k x) = ((k x) · b)c = (k(x · b))c = k(x · b)c = kT (x).
(b) Let
 
3

b = 5
2
1
.
c=
−3
Find the matrix A such that T (x) = Ax, where T is the linear transformation defined in part (a).
Simplify your answer as much as possible.
Any linear transformation T can be represented by matrix multiplication. Since T goes from R3
to R2 , the matrix A is 2 × 3. The ith column of A is given by applying T to the vector
 ei , which
3

has a 1 in the ith place and 0 in the other places. Taking the dot product of b = 5 with ei
2
1
gives its ith entry and this is then multiplied times the vector c =
. So the columns of A
−3
are 3c, 5c, and 2c, respectively, and we obtain:
A=
3
5
2
.
−9 −15 −6
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 7 of 17
5. (8 points) Let A be a 2 × 3 matrix and B a 3 × 2 matrix.
(a) The product BA is a 3 × 3 matrix. Is it possible that BA is invertible? If so, give examples of
matrices A and B such that BA is invertible, and write down its inverse. If not, explain why not.
The answer is no. We will give four possible arguments:
• Way 1: Note that since A is 2-by-3, it has at most 2 pivots so at least one free column, hence
N (A) is non-trivial. Since Av = 0 implies BAv = 0 we conclude N (A) ⊆ N (BA) so N (BA) is
also non-trivial. But a matrix with non-trivial nullspace is not invertible.
• Way 2: Again, since A is 2-by-3 it has at most 2 pivots so the columns space of A has dimension
at most 2. This means there are (at most) two vectors v1 , v2 such that the columns of A are
linear combinations of v1 , v2 . The columns of BA equal B times the columns of A, hence they
are linear combinations of Bv1 , Bv2 . It follows that the column space of BA has a spanning
set of (at most) two vectors, which means the rank of BA is at most 2. This means BA is not
invertible, since an invertible 3-by-3 matrix has rank 3.
• Way 3: Since B is 3-by-2, its rank is at most 2, so dimC(B) ≤ 2. But C(BA) ⊆ C(B):
every vector x ∈ C(BA) can be written, by definition, as v = BAx for x ∈ R2 . This means
b = By where y = Ax ∈ R2 so this places it in C(B). Since C(BA) ⊆ C(B) we deduce
dimC(BA) ≤ dimC(B) ≤ 2. Thus BA is not invertible, as an invertible 3-by-3 matrix would
have dimC(BA) = 3.
Note: The arguments in way 2 and way 3 generalized to arbitrary matrices produce the theorem
rank(BA) ≤ rank(B), rank(A)
• Way 4: Let


b11 b12
a11 a12 a13
A=
, B = b21 b22 
a21 a22 a23
b31 b32
Then we compute


b11 a11 + b12 a12 b11 a12 + b12 a22 b11 a13 + b12 a23
BA = b21 a11 + b22 a12 b21 a12 + b22 a22 b21 a13 + b22 a23 
b31 a11 + b32 a12 b31 a12 + b32 a22 b31 a13 + b32 a23
We compute its determinant:
det(BA) = (b11 a11 +b12 a12 )(b21 a12 +b22 a22 )(b31 a13 +b32 a23 )+(b11 a12 +b12 a22 )(b21 a13 b22 a23 )(b31 a11 +b32 a12 )+
+(b11 a13 +b12 a23 )(b21 a11 +b22 a12 )(b31 a12 +b32 a22 )−(b11 a13 +b12 a23 )(b21 a12 +b22 a22 )(b31 a11 +b32 a12 )−
−(b11 a12 +b12 a22 )(b21 a11 +b22 a12 )(b31 a13 +b32 a23 )−(b11 a11 +b12 a12 )(b21 a13 +b22 a23 )(b31 a12 +b32 a22 )
If we open the brackets there will be 48 terms - 24 positive and 24 negative - but they will all cancel
out. For example, the very first term obtained by opening the first product is b11 a11 b21 a12 b31 a13
which will cancel out with b11 a12 b21 a11 b31 a13 from the fourth product. Therefore the determinant
is 0, which means the matrix is NOT invertible.
Note: brute-forcing this is quite inefficient on a timed exact, but there are some short-cuts which
reduce the amount of computation. If you do row expansion, then each of the 2-by-2 minors
will already involve some cancellation so the expression will not be as long. Alternatively,
note that if the columns of B are B1 , B2 then we are computing the determinant of (a11 B1 +
a12 B2 , a21 B1 + a22 B2 , a31 B1 + a32 B2 ). Using the linearity of determinant, we can rewrite this
as a linear combinations (with coefficients depending on the aij ) of determinants of matrices of
form (B1 , B2 , B1 ) etc. - either way since we only have two columns one of them will be repeated
so all these will be zero.
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 8 of 17
(b) The product AB is a 2 × 2 matrix. Is it possible that AB is invertible? If so, give examples of
matrices A and B such that AB is invertible, and write down its inverse. If not, explain why not.
Yes, it is possible.
An example is


1 0
1 0 0
A=
, B = 0 1 
0 1 0
0 0
Then
1 0
AB =
0 1
is the identity matrix which is invertible. Its inverse equals itself.
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 9 of 17
6. (10 points)
(a) Suppose A and B are 2 × 2 matrices such that det(A) = 3 and det(B) = 5. Find the following, or
state that there is not enough information given to do so.
(i) det(−2A)
(ii) det(A + B)
(iii) det(A−1 B T )
(i) Since the determinant of a matrix is linear in each column of a matrix, given an n × n
matrix M and scalar c, det(cM ) = cn det(M ). In this case we have:
det(−2A) = (−2)2 det(A) = (−2)2 (3) = 12.
(ii) The determinant of a sum of matrices det(A + B) is not a function of the determinants
of
3 0
the matrices A and B. To see this, in our case, observe that for example the matrix
0 1
1 0
5 0
both have determinant 5, but
and
has determinant 3 and the matrices
0 5
0 1
3
det
0
3
0
0
5
+
1
0
1
0
+
0
1
8
= det
0
4
0
= det
0
5
0
1
0
2
0
6
= 16
= 24
Hence knowing det(A) = 3 and det(B) = 5 cannot be enough information to compute
det(A + B).
(iii) We compute det(A−1 B T ) = det(A−1 )det(B T ) =
1
5
det(B) = .
det(A)
3


1 2 −1
(b) Compute det 1 3 1 .
0 t −1
Use your solution to determine the value(s) of t for which this matrix is not invertible.
One way to compute the

1
det 1
0
determinant is by expansion down the first column:

2 −1
3 1 
t −1
3 1
2 −1
2 −1
= (1)det
− (1)det
+ (0)det
t −1
t −1
3 1
= (1) (3)(−1) − (t)(1) − (1) (2)(−1) − (−1)(t) + 0
= (−3 − t) − (−2 + t)
= −3 − t + 2 − t
= −1 − 2t
A matrix is not invertible if and only if its determinant is zero, and so our matrix is non-invertible
for exactly the t-values where −1 − 2t = 0. This has a single solution t = −1
2 .
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 10 of 17
7. (12 points) Consider the function f (x, y) = xy.
(a) Find all the critical points of f , and determine with justification if they are points of local maximum, local minimum, or saddle points.
y
0
Note that ∇f =
which should equal
at critical points. This shows that (x, y) = (0, 0) is
x
0
the only critical point.
0 1
Check that the Hessian matrix Hf =
has determinant −1, thus the Hessian test says
1 0
that the quadratic form is indeterminate thus the critical point is a saddle point.
(b) Now let D be the closed and bounded region in R2 that lies below the parabola y = 3 − x2 and
above the horizontal line y = −1. In other words,
D = {(x, y) ∈ R2 : − 1 ≤ y ≤ 3 − x2 }.
Find the largest and smallest values that f attains on D, and give all of the points in D where
these extrema are attained. Give complete reasoning; you may assume that these extrema exist.
We compile a list of possible candiates for maximum/minimum:
• Interior of D: only critical point is (0, 0) by part (a), which cannot be a candidate for
global maximum/minimum since it is a saddle point.
• Interior of y = −1. f (x, y) restricted to this line becomes x(−1) = −x. Derivative of −x
is -1, which never vanishes, so there is no critical point in this open line segment.
• Interior of the parabola y = 3 − x2 and y > −1. f (x, y) restricted to this arc is x(3 − x2 ) =
3x − x3 . Derivative of it is 3 − 3x2 , which vanishes precisely when x = ±1. So there are
two critical points (1, 2) and (−1, 2) in this case.
• Corner points. There are two corner points occuring as the intersection of y = 3 − x2 and
y = −1. Solving it gives the corner points (2, −1) and (−2, −1).
So the only possible candidates for maximum/minimum are (1, 2), (−1, 2), (2, −1) and (−2, −1).
Checking them point by point gives:
• f (x, y) attains maximum 2 on D at (1, 2) and (−2, −1).
• f (x, y) attains minimum -2 on D at (−1, 2) and (2, −1).
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 11 of 17
8. (12 points) Below is a collection of level sets of a function f : R2 → R at equally-spaced levels; darker
shading represents smaller values of f , and lighter shading represents larger values. (You may assume
that f and its first and second derivatives are continuous.) The length scales in the x- and y-directions
are equal.
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 12 of 17
Please refer to the contour map of the function f : R2 → R as given on the facing page; as stated, you
may assume that f and its first and second derivatives are continuous. The levels are equally spaced;
darker shading represents smaller values of f , and lighter shading represents larger values. The length
scales in the x- and y-directions are equal.
For the questions below, you do not need to justify your answers.
∂f
(a) (Circle one)
at D is: NEGATIVE ZERO
POSITIVE
∂x
Moving rightward from D, the value of f increases (i.e., the shading gets lighter).
∂f
NEGATIVE ZERO POSITIVE
at D is:
∂y
Moving upward from D, the value of f decreases (i.e., the shading gets darker).
(b) (Circle one)
(c) Which of the following could be ∇f (H), the gradient of f at H? Circle your answer:
−2
2
0
0
0
0
0
0
−2
2
The gradient is perpendicular to the level set, directed toward increasing f (i.e., lighter shading).
1
1
√
(d) (Circle one)
Let v = 2
; then Dv f at C is:
NEGATIVE
ZERO POSITIVE
1
At C, moving in this direction is tangent to the level set, so f is (instantaneously) unchanging.
1
1
√
; then Dw f at C is:
NEGATIVE ZERO
(e) (Circle one)
Let w = 2
POSITIVE
−1
Moving in this direction from C, the value of f increases.
∂ 2f
at E is:
∂x2
Moving rightward through E,
(f) (Circle one)
(g) (Circle one)
∂ 2f
at E is:
∂y 2
Moving upward through E,
(h) (Circle one)
(i) (Circle one)
∂f
∂x
∂f
∂y
∂f
∂x
POSITIVE
is decreasing (changes from positive to negative).
NEGATIVE
∂ 2f
at G is:
∂x∂y
Moving upward through G,
NEGATIVE
POSITIVE
is decreasing (changing from less negative to more negative).
NEGATIVE
POSITIVE
is increasing (changing from more negative to less negative).
The determinant of the Hessian of f at A is:
NEGATIVE
POSITIVE
f has a critical point at A but not a local max/min, so its Hessian can’t have positive determinant.
(j) (Circle one)
The determinant of the Hessian of f at B is:
NEGATIVE
POSITIVE
f has a local extremum (in fact, minimum) at B, so its Hessian can’t have negative determinant.
∂ 2f
∂ 2f
at
A
at A
∂x2
∂y 2
The 2nd derivative in the y-direction is negative; the 2nd derivative in the x-direction is positive.
(k) Which of the following values is smaller ? Circle your answer:
∂ 2f
∂ 2f
at
B
at B
∂x2
∂y 2
Both quantities are positive, but the derivative increases less quickly in the y-direction.
(l) Which of the following values is smaller ? Circle your answer:
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 13 of 17
9. (13 points)
(a) A differentiable real-valued function f (x, y) is defined on the xy-plane. The gradient of f at
various points (x, y) is depicted by a vector in the plot below.
Consider the restriction of f to the curve shown on the plot.
E
A
D
B
C
At which of the points A, B, C, D, and/or E does the restriction of f to this curve ...
... attain a local minimum?
... attain a local maximum?
(Each question should have one or more answers among A,B,C,D,E.)
Explain your reasoning for each (required):
C and E are the only labeled points at which the gradient of f is perpendicular to the ellipse,
so they are the only places at which we could possibly find local extrema.
If we start at C and move away from C along the curve (in either direction), the direction of
motion makes an obtuse angle with the gradient of f . Since the directional derivative is obtained
by dotting the direction vector with the gradient of the function, this tells us that as we move
away from C, the directional derivative in the direction of motion is always negative, indicating
that the function values are decreasing. Thus C must be a local maximum.
For similar reasons (except now we have direction vectors forming acute angles with the gradient
vectors), we can see that E is a local minimum, as when we move away from this point along
the curve, the function values increase.
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 14 of 17
(b) The plane x + 2y − z = −1 intersects the paraboloid z = (x + 1)2 + 4y 2 in an ellipse. Find the
points (x, y, z) on this ellipse that are highest and lowest, as measured by the z-coordinate. Give
complete reasoning; you may assume that such points exist.
First we identify the relevant constraint functions. These are:
g1 (x, y, z) = x + 2y − z + 1
g2 (x, y, z) = (x + 1)2 + 4y 2 − z.
Next we determine the function we are trying to maximize/minimize. This is just:
f (x, y, z) = z.
Next we take the gradients of all of these functions. These are:
∇g1 (x, y, z) = (1, 2, −1)
∇g2 (x, y, z) = (2x + 2, 8y, −1)
∇f (x, y, z) = (0, 0, 1).
We next check when ∇g1 and ∇g2 are linearly dependent. Since they are equal and non-zero in
the last coordinate, this will only happen when 1 = 2x + 2 and 2 = 8y. In other words, when
x = −1/2 and y = 1/4. But if x and y have these values, g1 tells us that at such a point on our
curve we must have z = 1, while g2 tells us that z must equal 1/2. Therefore there is no such
point on our curve at which the gradients of g1 and g2 are linearly dependent.
Therefore, in order to find possible locations of extrema, we would like to solve:
∇f = λ1 ∇g1 + λ2 ∇g2 ,
for some λ1 , λ2 . Plugging in our previously calculated gradients, this gives:
(0, 0, 1) = λ1 (1, 2, −1) + λ2 (2x + 2, 8y, −1).
By equality in the first coordinate, we have that λ1 + (2x + 2)λ2 = 0. Letting λ = λ2 and
rewriting λ1 in terms of λ in the above expression, we obtain:
(0, 0, 1) = −λ(2x + 2)(1, 2, −1) + λ(2x + 2, 8y, −1)
= λ(0, −4x + 8y − 4, 2x + 1).
Since clearly we cannot have λ = 0 (since then equality in the third coordinate will fail), in order
to obtain equality in the second coordinate, we must have:
−4x + 8y − 4 = 0.
In other words, we have that x = 2y − 1. Plugging this into our original constraints g1 and g2 ,
we have:
4y − z = 0
8y 2 − z = 0.
Thus, plugging in z = 4y into the second equation, we have:
8y 2 − 4y = 0,
implying that either y = 0 or 1/2.
If y = 0, then we have z = 4(0) = 0 and x = 2(0) − 1 = −1. If y = 1/2, then z = 4(1/2) = 2, and
x = 2(1/2)−1 = 0. Therefore our possible locations for extrema are (−1, 0, 0) and (0, 1/2, 2). By
comparing their z coordinates, we see that the first has the lowest z coordiante, and the second
has the highest.
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 15 of 17
10. (8 points) Find, showing all steps, the curve of the form “ y = a · 2x + b ” that best fits the following
points:
(x1 , y1 ) = (0, −1), (x2 , y2 ) = (1, 0), and (x3 , y3 ) = (2, 1).
(“Best fit” means that the sum of the squares of the differences (a · 2xi + b) − yi is minimized.) You
may assume that such a best-fit curve exists.
There are a couple ways you could do this problem. You could reduce itto the
 standard
 least
1 1
−1
a
square set-up by noting that we’re trying to minimize the squared norm of 2 1
−  0 ,
b
4 1
1


 
1 1
−1
so that letting A = 2 1 , b =  0  , we have a formula for the least-squares solution to this
4 1
1
a
21 7
3
T
−1
T
T
T
problem given by
= (A A) A b, so computing A A =
,A b =
, we find
b
7 3
0
3
9/14
3 −7
9
a
1
1
= 14
.
=
= 14
0
−3/2
−7 21
−21
b
Alternatively, we could just realize we want to minimize the function f (a, b) = (a + b + 1)2 + (2a +
b)2 + (4a + b − 1)2 = 21a2 + 14ab + 3b2 − 6a + 2; the function clearly goes to infinity as we go
to infinity in
so the minimum must occur at an interior critical point and setting
any direction,
42a + 14b − 6
, we can solve the ensuing system of equations to find a unique critical
0 = ∇f =
14a + 6b
point at a = 9/14, b = −3/2 as before.
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 16 of 17
11. (10 points) Consider the quadratic function f (x, y) = 6x2 − 4xy + 9y 2 .
(a) Find a symmetric matrix A whose associated quadratic form equals f ; that is, a matrix with
AT = A such that
x
f (x, y) = x y A
for all (x, y) in R2 .
y
The matrix is
A=
6 −2
.
−2 9
[Grading note: 2 points are awarded for the correct answer, and none otherwise.]
(b) Find the maximum and minimum values of f (x, y) subject to the constraint x2 + y 2 = 1; also find
the points at which these extrema are attained. Show all reasoning; you may assume that such
extrema exist.
We use the method of Lagrange multipliers. (One can also approach the problem by parametrizing the boundary.) We want to maximize/minimize f (x, y) such that g(x, y) := x2 + y 2 = 1.
Then at any extremum (x, y) we must have either ∇g(x, y) = 0 or ∇f (x, y) = λ∇g(x, y) for
some constant λ, and g(x, y) = 1. Compute that
2x
∇g(x, y) =
2y
This can only vanish if x = y = 0, but that violates the constraint. Next we consider
∇f (x, y) = 2λ∇g(x, y)
(1)
(We have used 2λ instead of λ for convenience; it doesn’t really matter.) Since f is a quadratic
function corresponding to the matrix from part (a),
x
.
∇f (x, y) = 2A
y
Therefore, any solution to ∇f (x, y) = λ∇g(x, y) is an eigenvector for A. (This is terminology,
not needed for the solution.) We can rewrite the equation (1) as
6 − λ −2
x
= 0.
−2 9 − λ
y
The existence of a non-zero solution to this equation(which any solution
satisfying the constraint
6 − λ −2
g(x, y) = 1 must be) is equivalent to the matrix
having nullity at least one,
−2 9 − λ
hence vanishing determinant. The determinant is (6 − λ)(9 − λ) − 4 = 0. This factors as
(5 − λ)(10 − λ) = 0, so λ = 5 or λ = 10.
Before solving for the points attaining the extrema, note that we can say what the value of f is
at them without even solving for their coordinates. If ∇f (x, y) = λ(x, y) then
x
x
f (x, y) =
·A
y
y
x
x
=
·λ
y
y
= λ(x2 + y 2 )
=λ
Math 51, Autumn 2015
Solutions to Final Exam — December 7, 2015
Page 17 of 17
because the constraint is x2 + y 2 = 1.
It only remains to solve for (x, y) from λ. First taking λ = 5, we want to solve
6 −2
x
x
=5
.
−2 9
y
y
Moving everything to the left hand side, this becomes
1 −2
x
−2 4
y
That gives x − 2y = 0, or x = 2y. Plugging in to the constraint g(x, y) = 1, we find that 5y 2 = 1,
so y = ± √15 and x = ± √25 . These are the minima, with minimum value 5.
Next consider λ = 10, which (arguing as before) reduces to
−4 −2
x
−2 −1
y
In this case we have −2x − y = 0, so y = −2x. Plugging in to the constraint as brefore, x = ± √15
and y = ∓ √25 . These ar the maxima, with maximum value 10.
(c) Determine whether or not it is true that f (x, y) > 0 for all (x, y) 6= (0, 0). You must fully justify
your answer.
This question is somewhat tricky. It is tempting to argue that the function is extremized only
at (0, 0), because that is the only place where ∇f vanishes, and that by the Hessian test f has
a minimum there, so that (0, 0) is a global minimum. However, this is incorrect without further
justification because the domain in question is not bounded, so a global minimum need not exist
a priori. It is also insufficient to examine the behavior at infinity along the x and y directions
only. [1 point is awarded for the inadequate reasoning above.]
The cleanest way to argue is by expressing f as a sum of squares. Note that
f (x, y) = (2x − y)2 + 2x2 + 8y 2
which is always non-negative since it is a sum of squares, and positive as long as not all of
x, y, 2x − y are zero, which happens only at x = y = 0. (This is not the only way of “completing
the square”, so other expressions also work.)
It is also possible to argue by homogeneity that any point (x, y) is a scalar multiple of a point
lying on the circle, and its value is the square of that scalar times the value of the corresponding
point on the circle, hence has the same sign. This reduces one to checking that f (x, y) is positive
on the circle [but no points are awarded for doing the latter without justifying why the answer
applies to the whole plane].