HW8solutionsR-Fall2018
HW8solutionsR-Fall2018
Problem 1
Problem 2
Problem 3
Problem 4. A triangle with sides x, y, and z has fixed perimeter 2s = x + y + z . Its area is given by Heron’s
formula: A = s ( s − x)( s − y )( s − z ) . Use the Method of Lagrange Multipliers to show that, among all
triangles with the given perimeter, the one of largest area is equilateral.
Solution: We minimize f ( x, y, z ) =s ( s − x)( s − y )( s − z ) subject to the constraint g ( x, y, z ) = x + y + z = 2 s .
− s ( s − y )( s − z ) =λ ⋅1
Lagrange multipliers gives the three equations − s ( s − x)( s − z ) =λ ⋅1 . Pairwise division then gives the
− s ( s − x)( s − y ) =λ ⋅1
relations x= y= z , i.e. an equilateral triangle. (The minimum would occur when any side has zero length.)
Problem 5. Find the maximum and minimum volumes of a rectangular box whose surface area is 1500 cm2 and
whose total edge length is 200 cm.
Solution: If we let the edge lengths be x, y, and z, the we wish to maximize the volume V = xyz subject to the
two constraints that the surface area is A = 2 xy + 2 xz + 2 yz = 1500 and the total edge length is
1
L = 4 x + 4 y + 4 z = 200 . We could use the last constraint to reduce this to a problem of finding the extrema
of a function of two variables subject to one constraint; or we can proceed with the Method of Lagrange
yz = λ (2 y + 2 z ) + 4 µ
Multipliers. If we take the latter approach, we get the equations: xz = λ (2 x + 2 z ) + 4 µ . Subtracting the
xy = λ (2 y + 2 x) + 4 µ
) 2λ ( y − x) , so either y = x (two opposite ends are squares) or z = 2λ .
second from the first gives z ( y − x=
The first case gives that 2 x + 4 xz =
2
1500 or x 2 + 2 xz = 750 ; and 8 x + 4 z = 200 or 2 x + z = 50 . Solving for
z and substituting gives x + 2 x(50 − 2 x) =
2
750 or 3 x − 100 x + 750 =
2
0 . The quadratic formula then gives
either:
50 + 5 10 50 − 10 10 50 − 5 10 50 + 10 10
x= y= with z = ; or x= y= with z = .
3 3 3 3
The former describes a 21.9371×21.9371×6.1257 box with volume 2947.937 cm3 (minimum volume).
The latter describes an 11.3962×11.3962×27.2076 box with volume 3533.544 cm3 (maximum volume).
Note: The variables x, y, and z appear entirely symmetrically in the expressions. There are formally
additional solutions with the variables interchanged, but these do not describe fundamentally different
solutions. If you pursue the other case ( z = 2λ ), you will find that this does not yield consistent equations.
Problem 6
2
Here’s an alternative: Use the parameterization from part (a) which gives z and a function of the parameter t, namely
5
z= . Then use ordinary Calculus I methods to find its maximum and minimum values, i.e.
4 cos t − 3sin t + 8
dz −5(−4sin t − 3cos t )
=
calculate the derivative, set it equal to 0, and solve for the critical point. This gives: = 0.
dt (4 cos t − 3sin t + 8) 2
This can only be 0 when the numerator is 0 and this occurs where −4sin t − 3cos t = 0 or, more simply, where
sin t 3
tan t = = − . We can draw two triangles corresponding to the two possible angles where this can happen:
cos t 4
t 4
5
3
t
or
-3
5
-4
5
In the 1st case, we have sin t = 3 5 and cos t = =
− 4 5 which give z = 5 (maximum).
4 ( − 4 5 ) − 3 ( 35 ) + 8 3
5
In the 2nd case, we have sin t = − 3 5 and cos t =
= 4 5 which give z = 5 (minimum).
4 ( 5 ) − 3 ( − 35 ) + 8 13
4
∑ ∑ ∑
n n n
Problem 7. a) Find the extrema of x yi subject to the constraints
i =1 i i =1 i
x 2 = 1 and i =1
yi 2 = 1 .
Solution: This problem is actually a lot easier than it initially looks. The function to be maximized is a
function of 2n variables, f ( x1 , , xn , y1 , , yn ) = ∑ i =1 xi yi . We have two constraints:
n
∑= ∑=
n n
g ( x1 , , xn , y1 ,=
, yn ) x i =1 i
2
1 and h( x1 , , xn , y1 ,=
, yn ) y i =1 i
2
1 . The Method of Lagrange
Multipliers yields 2n equations – n equations of the form yi = λ ⋅ 2 xi + µ ⋅ 0 = 2λ xi and n equations of the
form xi = λ ⋅ 0 + µ ⋅ 2 yi = 2 µ yi . Substitution into the respective constraints gives
∑
n
y = x or y = − x . Substitution into x yi shows that the first case gives the maximum value of 1 and the
i =1 i
second gives the minimum value of –1. Furthermore, we recognize this function as just the dot product, so
we have shown that for unit vectors x and y, −1 ≤ x ⋅ y ≤ +1 or x ⋅ y ≤ 1 .
ai bi
b) Put xi = and yi = to show that ∑a b ≤ ∑a 2
∑b 2
for any numbers a1 , an , b1 , bn .
∑aj ∑ bj
2 2 i i j j
This inequality is known as the Cauchy-Schwartz Inequality. [Note: In vector notation, if we write
a = a1 , , an and b = b1 , , bn and if we use Lagrange Multipliers to determine both the maximum and
minimum values, this says that a ⋅ b ≤ a b , where a ⋅ b is the dot product.]
a1 an a b1 bn b
=
Solution: x =
x1 , , xn , , = = , y =
y1 , , yn , , = are
∑ aj 2
∑ a 2 a
j ∑ bj 2
∑ bj 2 b
a b
unit vectors, so if we apply the previous result we get ⋅ ≤ 1 or a ⋅ b ≤ a b .
a b
3
Problem 8. You have 36 square units of material with which to make a box. You can construct either a
rectangular box or a cylindrical box. Both have a bottom but no top. If you make the box in either case which
contains the most volume, which one will give the greater volume and by how much?
Solution: Rectangular box: Let x and y be the lengths of the edges of the base and let z be the height of the
box. We wish to maximize V = xyz subject to the constraint A =xy + 2 xz + 2 yz =36 . Lagrange Multipliers
= yz λ ( y + 2 z )
gives the equations = xz λ ( x + 2 z ) . Dividing the first by the second gives the relation y = x (square
= xy λ (2 x + 2 y )
base); and dividing the first by the third gives the relation z = 12 x . Substitution into the constraint gives that
x= y= 2 3 and z = 3 , so the maximum volume will be 12 3 ≅ 20.7846 .
Cylindrical box: Let r be the radius of the cylinder and let h be the height of the cylinder. We wish to
maximize V = π r 2 h subject to the constraint A = 2π rh + π r 2 = 36 . Lagrange Multipliers gives the equations
=2π rh λ (2π h + 2π r ) =rh λ (h + r )
. The simplify to r = 2λ . Dividing the first by the second gives the relation
π r = λ (2π r )
2
h = r . Substitution into the constraint gives that r= h= 12 , so the maximum volume will be
π
π ( 12
π= ) 12π 24 π3 ≅ 23.4529 . Intuitively, it should be clear that the cylindrical box will hold the greater
volume (think about what happens to an overstuffed rectangular box – the sides bulge out to give more
circular cross sections). The cylindrical box holds about 2.6683 more volume than the square box.
Problem 9.
a) A dog with some mathematical talent has buried three bones in a field at the coordinates
(−5, −3) , (8, 0) , and (0, 7) . (All coordinates are in meters.) He wants to sit in a good spot, i.e. close to all
three bones. Specifically, he wants to minimize the sum of the squares of the distances between himself and
the bones. Where should this dog sit?
Solution: Minimize
D12 + D2 2 + D32 = ( x + 5) 2 + ( y + 3) 2 + ( x − 8) 2 + y 2 + x 2 + ( y − 7) 2 = f ( x, y ) .
Expanding and simplifying gives f ( x, y ) = 3 x 2 + 3 y 2 − 6 x − 8 y + 147 . This
is unconstrained, so we simply use critical point analysis. Specifically,
f x = 6 x − 6 = 0 gives x = 1 ; and f y = 6 y − 8 = 0 gives y = 43 . So the dog
should sit at the point (1, 43 ) . [It’s easy to check that this is a relative
minimum and, in fact, the absolute minimum.]
b) The dog’s owner secures him on a 1 meter leash tied to a stake at the point (1,1) .
Where should the dog now sit?
Solution: This is now an exercise in finding the minimum in a bounded domain, i.e. a disk of radius 1
centered around the point (1,1) . However, the absolute minimum occurs at (1, 43 ) which is within this disk, so
there’s no additional effort required and the best spot will remain as it was for the unconstrained problem, i.e.
(1, 43 ) .
c) Suppose the stake is moved to the point (0, 0) . Where should the dog now sit?
Solution: Now we have to find the minimum in the disk bounded by the circle x 2 + y 2 =
1 . There are no
critical points within this disk, so the minimum (and maximum) must occur on the boundary of the disk. We
4
must therefore find the extrema of the function f ( x, y ) = 3 x 2 + 3 y 2 − 6 x − 8 y + 147 subject to the constraint
ggg ggg 6x − 6 = λ ⋅ 2x
g ( x, y ) = x 2 + y 2 = 1 . The Lagrange Multiplier condition ∇f = λ∇g gives the equations .
6 y − 8 = λ ⋅ 2 y
6x − 6 x
Dividing respective sides gives that = . Cross-multiplying gives 6xy − 6 y = 6 xy − 8x , so y = 43 x .
6y −8 y
Couple with the constraint (the circular boundary), this gives the two points ( 53 , 54 ) and (− 53 , − 54 ) . The
former gives the minimum (which is where the dog wants to sit), and the latter is the point where the dog
would least like to sit.
Problem 10. Suppose that production (measured in lollipops) at a small lollipop factory is modeled by the
Cobb-Douglas function p ( x, y ) = 500 x 0.7 y 0.5 where x is the number of units of labor and y is the number of
units of capital. Further suppose that the cost of labor is $35 per unit and the cost of capital is $16 per unit.
a) Find the least costly combination of labor and capital needed to produce 40,000 lollipops and find this
minimum cost.
Solution: We seek to minimize b( x,= =
y ) 35 x + 16 y subject to the constraint =
p ( x, y ) 500 x 0.7 y 0.5 40000 .
35= λ ⋅ 350 x −0.3 y 0.5 35 7 y
Lagrange Multipliers gives 0.7 −0.5
⇒ = ⇒ y = 16
25 x . Substitution into the constraint
16= λ ⋅ 250 x y 16 5 x
gives x = 64 ⇒ x = 32 ⇒ y = 50 . The minimum cost is b(32,50) = $1920 .
6
5
b) Now find what combination of labor and capital will yield the maximum number of lollipops with a fixed
budget of $4800 and find this maximum number of lollipops.
Solution: The fact that ∇b and ∇p will be parallel under optimal conditions is true whether we’re
minimizing cost with fixed production or maximizing production with fixed cost. The relation given by
Lagrange Multipliers will therefore be the same, i.e. y = 16
25 x . In this case, it is the budget that is
constrained, so we substitute this relation into the budget constraint b( x, y ) = 35 x + 16 y = 4800 to get x = 80
and y = 125 . The maximum number of lollipops will therefore be p (80,125) ≅ 120,112 .
Problem 11. Given the 5 points, (−2, 4) , (−1, 2) , (0,1) , (1,1) , and (2, 2) :
a) Find an equation for the line that best fits this data (in the sense of least squares).
b) Find the best fitting quadratic (parabola) for these five points (in the sense of least squares).
[Hint: Use the same method as was used in finding the best fit line, only with a quadratic function of the
form p ( x) = ax 2 + bx + c . Find a, b, and c that minimizes the sum of the square errors between the actual
data and the values on the parabola.]
Solutions: In the Lecture Notes we derived expressions for the line of best fit and sketched out the method
for finding the parabola of best fit. To find these we need to construct a table of values and sums:
x y x2 x3 x4 xy x2y
–2 4 4 –8 16 –8 16
–1 2 1 –1 1 –2 2
0 1 0 0 0 0 0
1 1 1 1 1 1 1
2 2 4 8 16 4 8
SUM 0 10 10 0 34 –5 27
5
N 2 N N
∑ i ∑ i m ∑ xi yi
x x
For the line of best fit =
y mx + b , we must solve the system of equations N
=i 1 =i 1
= = i 1N .
x b yi
=
∑
i 1=
i N
∑
i 1
10 0 m −5
Using the table above, these become = , i.e. 10m = −5 and 5b = 10 . So m = − 12 , b = 2 , and
0 5 b 10
the line that best fits data has equation y =
− 12 x + 2 .
For the parabola of best fit y = ax 2 + bx + c , we must solve the system of equations
N 4 N 3 N 2 N 2
∑ xi ∑ xi ∑ xi ∑ xi yi
N
=i 1 =i 1 =i 1
N N
a N
=i 1
34 0 10 a 27
x3 xi ∑ xi b = ∑ xi yi . Using the table above, these become
∑ i ∑
=i 1 =i 1 =i 1
2
=
i1
0 10 0 b =
−5 . We
N N c N 10 0 5 c 10
∑ xi 2 ∑ xi N ∑ yi
= i 1 =i 1 = i 1
immediately get that 10b = −5 , so b = − 12 . The remaining two equations can be solved simultaneously to get
a = 12 and c = 1 . So the parabola of best fit has equation y = 12 x 2 − 12 x + 1 .
Problem 12
Problem 13