Chapter 47. Solutions to Part Foxtrot

§47.1 Solution to Exercise 17.1 (critical points of a 2-variable function)

Exercise 17.1. Compute the critical point(s) of 𝑓(𝑥,𝑦)=𝑥3+2𝑦3−6𝑥𝑦 and classify them as local minimums, local maximums, or saddle points.

Finding the critical points

The first-order partial derivatives are:

𝑓𝑥=𝜕𝑓𝜕𝑥=3𝑥2−6𝑦,𝑓𝑦=𝜕𝑓𝜕𝑦=6𝑦2−6𝑥.

To find the critical points, we solve the system:

3𝑥2−6𝑦=0,6𝑦2−6𝑥=0.

Rewriting the equations:

𝑥2=2𝑦,𝑦2=𝑥.

From 𝑦2=𝑥, substitute into 𝑥2=2𝑦:

(𝑦2)2=2𝑦⟹0=𝑦(𝑦3−2).

Hence either 𝑦=0 or 𝑦=23. These correspond to 𝑥=0 and 𝑥=43.

Classifying the critical points

Hence the two critical points are

(𝑥,𝑦)=(0,0) and (𝑥,𝑦)=(43,23).

To classify them, compute the second-order derivatives. Then in the notation of Section 17.6,

𝐴=𝑓𝑥𝑥=6𝑥,𝐶=𝑓𝑦𝑦=12𝑦,𝐵=𝑓𝑥𝑦=−6.

§47.2 Solution to Exercise 17.2 (critical points of a 3-variable function)

Exercise 17.2. Compute the critical point(s) of 𝑓(𝑥,𝑦,𝑧)=𝑥2+𝑦3+𝑧4 and classify them as local minimums, local maximums, or saddle points.

Finding the critical points

The first-order partial derivatives are:

𝑓𝑥=𝜕𝑓𝜕𝑥=2𝑥,𝑓𝑦=𝜕𝑓𝜕𝑦=3𝑦2,𝑓𝑧=𝜕𝑓𝜕𝑧=4𝑧3.

To find the critical points, we solve the system:

2𝑥=0,3𝑦2=0,4𝑧3=0.

Solving for each variable:

𝑥=0,𝑦2=0⇒𝑦=0,𝑧3=0⇒𝑧=0.

Thus, the only critical point is:

(0,0,0).

Classifying the critical points

Since this is a 3-variable function, we cannot classify it using the second derivative test. However, one can tell just by looking at the function that it is neither a local minimum or maximum. One simple way to do so is to note that for any small 𝜀>0 we have

𝑓(0,𝜀,0)=𝜀3>0𝑓(0,−𝜀,0)=−𝜀3<0

In other words, there are always points near the origin (0,0,0) which are both larger than 𝑓(0,0,0)=0 and smaller than 𝑓(0,0,0)=0. Hence (0,0,0)is a saddle point.

§47.3 Solution to Exercise 17.3 (every point is a saddle point)

Exercise 17.3 (*). Does there exist a differentiable function 𝑓:ℝ2→ℝ such that every point in ℝ2 is a saddle point?

No, it’s not possible.

We will prove the following result:

Theorem 47.1. Suppose 𝑓:ℝ2→ℝ is a function for which every point is a critical point. Then 𝑓 must be the constant function.

In particular, every point of 𝑓 will be both a local minimum and a local maximum. This means that 𝑓 has no saddle points at all.

Proof. Consider any two points 𝑃1=(𝑥1,𝑦1) and 𝑃2=(𝑥2,𝑦2). We prove that 𝑓(𝑥1,𝑦1)=𝑓(𝑥2,𝑦2).

Define the function 𝑔:[0,1]→ℝ along the line segment from (𝑥1,𝑦1) to (𝑥2,𝑦2) by

𝑔(𝑡)=𝑓(𝑥1+𝑡(𝑥2−𝑥1),𝑦1+𝑡(𝑦2−𝑦1)).

This function 𝑔 represents 𝑓 restricted to the straight-line path between the two points.

Since 𝑓 is differentiable, 𝑔 is also differentiable on (0,1), and the derivative of 𝑔 can be computed using the chain rule:

𝑔′(𝑡)=𝜕𝑓𝜕𝑥𝑑𝑥d𝑡+𝜕𝑓𝜕𝑦𝑑𝑦d𝑡.

Since 𝑥=𝑥1+𝑡(𝑥2−𝑥1) and 𝑦=𝑦1+𝑡(𝑦2−𝑦1), we have

𝑑𝑥d𝑡=𝑥2−𝑥1,𝑑𝑦d𝑡=𝑦2−𝑦1.

Thus,

𝑔′(𝑡)=𝜕𝑓𝜕𝑥(𝑥2−𝑥1)+𝜕𝑓𝜕𝑦(𝑦2−𝑦1).

By assumption, every point is a critical point, meaning 𝜕𝑓𝜕𝑥=0 and 𝜕𝑓𝜕𝑦=0 everywhere. Therefore,

𝑔′(𝑡)=0for all 𝑡∈(0,1).

Hence, 𝑔 must be a constant function. So 𝑔(0)=𝑔(1) implies 𝑓(𝑥1,𝑦1)=𝑓(𝑥2,𝑦2) as needed.□

§47.4 Solution to Exercise 17.4 (every lattice point is a saddle point)

Exercise 17.4 (*). Give an example of a differentiable function 𝑓:ℝ2→ℝ with the following property: every lattice point (𝑥,𝑦) (i.e. a point where both 𝑥 and 𝑦 are integers) is a saddle point, and there are no other saddle points. For example, (2,−7), (100,100), and (−42,−13) should be saddle points, but (12,0), (𝜋,−2), and (7,11) should not be.

Inventing the function

The function

𝑓(𝑥,𝑦)=cos((𝑥−𝑦)𝜋)−cos((𝑥+𝑦)𝜋)2=sin(𝜋𝑥)sin(𝜋𝑦)

works. The idea is that a saddle point occurs if and only if one of these two conditions holds:

Verifying the function works

Inventing the example above (which is one of many) is the main difficulty of the exercise. For completeness, let’s just verify that the guess above does in fact work. From now on, use

𝑓(𝑥,𝑦)=sin(𝜋𝑥)sin(𝜋𝑦).

The first-order partial derivatives are:

𝑓𝑥=𝜕𝑓𝜕𝑥=𝜋cos(𝜋𝑥)sin(𝜋𝑦),𝑓𝑦=𝜕𝑓𝜕𝑦=𝜋sin(𝜋𝑥)cos(𝜋𝑦).

To find critical points, we set 𝑓𝑥=0 and 𝑓𝑦=0:

𝜋cos(𝜋𝑥)sin(𝜋𝑦)=0,𝜋sin(𝜋𝑥)cos(𝜋𝑦)=0.

Since 𝜋≠0, the equations reduce to:

cos(𝜋𝑥)sin(𝜋𝑦)=0,sin(𝜋𝑥)cos(𝜋𝑦)=0.

Solving these equations:

A critical point must satisfy both conditions simultaneously. The only common solutions occur in two cases.

We classify with the second derivative test. Compute

𝐴=𝑓𝑥𝑥=−𝜋2sin(𝜋𝑥)sin(𝜋𝑦)𝐶=𝑓𝑦𝑦=−𝜋2sin(𝜋𝑥)sin(𝜋𝑦)𝐵=𝑓𝑥𝑦=𝜋2cos(𝜋𝑥)cos(𝜋𝑦).

Now we check the cases:

§47.5 Solution to Exercise 19.1 (geometry optimization)

Exercise 19.1. Let 𝐴𝐵𝐶 be the triangle in the 𝑥𝑦-plane with vertices 𝐴=(0,12), 𝐵=(−5,0), 𝐶=(9,0). For what point 𝑃 in the plane is the sum

𝑃𝐴2+𝑃𝐵2+𝑃𝐶2

as small as possible?

For 𝑃=(𝑥,𝑦) we let

𝑓(𝑥,𝑦)=𝑃𝐴2+𝑃𝐵2+𝑃𝐶2.

See Figure 108.

Figure 108: A triangle 𝐴𝐵𝐶 and a point 𝑃 connected to its three vertices

We first want to change 𝑓 into an expression like we’re used to. We do this using the Pythagorean theorem as follows:

𝑃𝐴2=(𝑥−0)2+(𝑦−12)2=𝑥2+𝑦2−24𝑦+144,𝑃𝐵2=(𝑥+5)2+(𝑦−0)2=𝑥2+10𝑥+25+𝑦2,𝑃𝐶2=(𝑥−9)2+(𝑦−0)2=𝑥2−18𝑥+81+𝑦2.

Summing these expressions:

𝑓(𝑥,𝑦)=(𝑥2+𝑦2−24𝑦+144)+(𝑥2+10𝑥+25+𝑦2)+(𝑥2−18𝑥+81+𝑦2)=3𝑥2+3𝑦2−8𝑥−24𝑦+250.

We are optimizing 𝑓 over the entire space ℛ︀=ℝ2. Let’s follow the recipe in Section 19.2:

  1. There is no boundary, but we have limit cases if 𝑥→±∞ or 𝑦→±∞.
  2. To find the critical points, we compute the partial derivatives:

    𝑓𝑥=𝜕𝑓𝜕𝑥=6𝑥−8=0⟹𝑥=43.𝑓𝑦=𝜕𝑓𝜕𝑦=6𝑦−24=0⟹𝑦=4.

    Thus, the only critical point is:

    𝑃=(43,4).
  3. There are no boundary points to consider.
  4. If either 𝑥→±∞ or 𝑦→±∞, then the quadratic terms 3𝑥2+3𝑦2 dominate and cause 𝑓(𝑥,𝑦)→+∞. Hence 𝑓 can take arbitrarily large values.

Putting this together, the point 𝑃=(43,4) is the unique point minimizing 𝑃𝐴2+𝑃𝐵2+𝑃𝐶2.

Remark

If 𝐴𝐵𝐶 is replaced by a different triangle, it turns out that the best point 𝑃 is the center of mass of the three points 𝐴, 𝐵, 𝐶. In other words, if 𝐴=(𝑥1,𝑦1), 𝐵=(𝑥2,𝑦2), 𝐶=(𝑥3,𝑦3) the answer will work out to

𝑃=(𝑥1+𝑥2+𝑥33,𝑦1+𝑦2+𝑦33).

(This point is called the centroid or gravity center of 𝐴𝐵𝐶 and is often denoted by the letter 𝐺.)

§47.6 Solution to Exercise 19.2 (sine optimization)

Exercise 19.2. Compute the minimum possible value of 𝑥+𝑦 given that sin(𝑥)+sin(𝑦)=1 and 𝑥,𝑦≥0.
  1. The region ℛ︀ has boundary whenever 𝑥=0 or 𝑦=0. It also has limit cases when 𝑥→+∞ or 𝑦→+∞.

  2. We find the LM-critical points. The gradients are

    ∇𝑓=(11)

    and

    ∇𝑔=(cos(𝑥)cos(𝑦)).

    From the first two equations, we have:

    𝜆=1cos(𝑥)and𝜆=1cos(𝑦).

    Equating these expressions for 𝜆, we get:

    1cos(𝑥)=1cos(𝑦)⟹cos(𝑥)=cos(𝑦).

    Thus, we get an LM-critical point whenever

    cos(𝑥)=cos(𝑦)sin(𝑥)+sin(𝑦)=1

    Note that sin(𝑥)2=1−cos(𝑥)2=1−cos(𝑦)2=sin(𝑦)2. Since sin(𝑥)+sin(𝑦)=1≠0, we conclude sin(𝑥)=sin(𝑦)=12. Together with cos(𝑥)=cos(𝑦), that means 𝑥 and 𝑦 must differ by a multiple of 2𝜋.

    Since we want 𝑥+𝑦 to be as small as possible, we might as well take 𝑥=𝑦. The smallest 𝑥 for which sin(𝑥)=12 is 𝑥=𝜋6. So of all the LM-critical points, the lowest value occurs when

    𝑓(𝜋6,𝜋6)=𝜋6+𝜋6=𝜋3.
  3. In the limit cases if either 𝑥→+∞ or 𝑦→+∞ then 𝑓→+∞.

  4. Suppose 𝑥=0. Then sin(𝑦)=1. So this part of the boundary consists of the points (0,𝜋2), (0,5𝜋2), (0,9𝜋2), …. All of these have 𝑥+𝑦≥𝜋2, so they do worse than the point (𝜋6,𝜋6) from before.

    Similarly, if 𝑦=0, we get boundary points (𝜋2,0), (5𝜋2,0), (9𝜋2,0), …. Again all of these have 𝑥+𝑦≥𝜋2, so they do worse than the point (𝜋6,𝜋6) from before.

In conclusion the minimum possible value occurs at

𝑓(𝜋6,𝜋6)=𝜋3.

§47.7 Solution to Exercise 19.3 (optimization with absolute value)

Exercise 19.3 (Suggested by Ting-Wei Chao). Compute the global minimum of the function

𝑓(𝑥,𝑦)=|𝑥2+𝑦2−25|−3𝑥−4𝑦.

This problem shows a case where ∇𝑓 does not exist at certain points: the derivative of |𝑥| only exists when 𝑥≠0.

To avoid this issue, we split into cases based on the sign of the term inside the absolute value. We will split28 into two cases 𝑥2+𝑦2≤25 and 𝑥2+𝑦2≥25. In each case we execute the procedure.

Case where 𝑥2+𝑦2≤25

We follow Section 19.2.

  1. The region 𝑥2+𝑦2≤25 is a two-dimensional region with no limit cases but whose boundary is 𝑥2+𝑦2=25.
  2. We seek all points with ∇𝑓=𝟎. In the region 𝑥2+𝑦2≤25, we have

    𝑓(𝑥,𝑦)=25−𝑥2−𝑦2−3𝑥−4𝑦.

    Solving ∇𝑓=𝟎 gives

    𝜕𝑓𝜕𝑥=−2𝑥−3=0,𝜕𝑓𝜕𝑦=−2𝑦−4=0.

    Therefore, it gives the critical point (𝑥,𝑦)=(−32,−2). This point is indeed in the region 𝑥2+𝑦2<25, so this is a critical point.

  3. We apply Lagrange multipliers (Section 19.4) on the boundary 𝑥2+𝑦2=25. Let 𝑔(𝑥,𝑦)=𝑥2+𝑦2.

    1. This is a one-dimensional region with no boundary and no limit cases.
    2. We search for all LM-critical points. First note that ∇𝑔 is never zero on this boundary. The system of equations is

      −3=𝜆⋅2𝑥,−4=𝜆⋅2𝑦𝑥2+𝑦2=25.

      It’s clear that 𝜆, 𝑥, 𝑦 must be nonzero. Hence, the first two equations together imply 𝑥𝑦=34. Hence, we get two critical points (3,4) and (−3,−4) in this case.

    3. There are no boundary points to consider.
    4. There are no limit points to consider.
  4. There are no limit cases.

Case where 𝑥2+𝑦2≥25

We follow Section 19.2 again.

  1. The region 𝑥2+𝑦2≥25 is a two-dimensional region with limit cases when 𝑥→±∞ and 𝑦→±∞ but whose boundary is 𝑥2+𝑦2=25.
  2. In the region 𝑥2+𝑦2≥25, we have

    𝑓(𝑥,𝑦)=𝑥2+𝑦2−25−3𝑥−4𝑦.

    Solving ∇𝑓=𝟎 gives

    𝜕𝑓𝜕𝑥=2𝑥−3=0,𝜕𝑓𝜕𝑦=2𝑦−4=0.

    This gives the point (32,2), but this point doesn’t lie inside 𝑥2+𝑦2≥25, so we don’t need to consider it.

  3. We need to apply Lagrange multipliers (Section 19.4) on the boundary 𝑥2+𝑦2=25. However, we did this already in the earlier case where 𝑥2+𝑦2≤25. So we can just repeat the same calculation verbatim here.
  4. When |𝑥|→+∞ or |𝑦|→+∞, the square terms dominate and 𝑓→+∞. Hence we get that 𝑓 is bounded above.

Putting things together

We are searching for the global minimum of 𝑓. Aggregating the critical points, we check

𝑓(−32,−2)=1254,𝑓(3,4)=−25,𝑓(−3,−4)=25.

Therefore, the global minimum is 𝑓(3,4)=−25.

§47.8 Solution to Exercise 20.1 (butterfly)

Exercise 20.1. A butterfly is fluttering in the 𝑥𝑦 plane with position given by 𝐫(𝑡)=⟨cos(𝑡),cos(𝑡)⟩, starting from time 𝑡=0 at 𝐫(0)=⟨1,1⟩.

Sketch of the trajectory

We start actually by sketching the trajectory first (even though this was the last part), since that will make it easier to see what’s going on in future parts. See Figure 109. The trajectory described by 𝐫(𝑡)=⟨cos(𝑡),cos(𝑡)⟩ traces out a straight line in the 𝑥𝑦-plane because both the 𝑥- and 𝑦-coordinates are equal for all 𝑡. Specifically, the butterfly’s motion follows the line 𝑦=𝑥, with 𝑡∈[0,2𝜋] producing oscillations between 𝑥=1 and 𝑥=−1.

Figure 109: Butterfly fluttering along the plane. A few more examples of points in the trajectory are marked in green for illustration, but the blue endpoints are the important ones. The green points are a little offset to show both parts of the trajectory, e.g. 𝐫(𝜋2)=(0,0) is drawn a little bit left of where it should be.

The trajectory is a straight line from (1,1) to (−1,−1) and back following the line 𝑦=𝑥.

Speed of the butterfly at 𝑡=𝜋3

The speed of the butterfly is given by the magnitude of its velocity vector, which is the derivative of 𝐫(𝑡) with respect to time 𝑡.

First, compute the velocity 𝐫′(𝑡):

𝐫′(𝑡)=𝑑d𝑡⟨cos(𝑡),cos(𝑡)⟩=⟨−sin(𝑡),−sin(𝑡)⟩.

(This has direction along the line 𝑦=𝑥, which is what we expect.)

The speed at any time 𝑡 is the magnitude of the velocity vector:

Speed=|𝐫′(𝑡)|=(−sin(𝑡))2+(−sin(𝑡))2=2sin2(𝑡)=2|sin(𝑡)|.

At 𝑡=𝜋3, we have:

sin(𝜋3)=32.

Thus, the speed at 𝑡=𝜋3 is:

Speed=2⋅32=62.

Arc length of the butterfly’s trajectory from 𝑡=0 to 𝑡=2𝜋

Note that from the sketch of the trajectory, we can actually find the arc length with no calculus at all. Indeed, “arc length” is a misnomer because the “arc” is just two line segments!

From the Pythagorean theorem, distance from (1,1) to (−1,−1) is

(1−(−1))2+(1−(−1))2=4+4=22.

So the total distance is

22+22=42.

Of course, one could also use the arc length formula, and we show how to do so. The arc length of the trajectory is given by the integral of the speed:

𝐿=∫𝑡=start timestop time|𝐫′(𝑡)|d𝑡.

We just saw that |𝐫′(𝑡)|=2|sin(𝑡)|. Therefore, the arc length from 𝑡=0 to 𝑡=2𝜋 is:

𝐿=∫02𝜋2|sin(𝑡)|d𝑡.
Warning
Don’t forget about the absolute value! In general, for real 𝑋, we have 𝑋2=|𝑋|. If you forget the absolute value here, you’ll end up getting 0 as the answer, which doesn’t make sense because the butterfly certainly traveled more than 0 distance. Remember, speed (absolute value of velocity vector) should always be nonnegative.

Because of the absolute value, we can break the integral into two parts. On the interval [0,𝜋], sin(𝑡)≥0, and on the interval [𝜋,2𝜋], sin(𝑡)≤0, so

𝐿=2(∫0𝜋sin(𝑡)d𝑡+∫𝜋2𝜋−sin(𝑡)d𝑡).

See Figure 110 for an illustration of this integral.

Figure 110: The integral ∫02𝜋|sin(𝑡)|d𝑡 is two copies of the first hump ∫0𝜋sin(𝑡)d𝑡 (which doesn’t have an absolute value on it).

Both integrals are the same, so we compute one and multiply by 2:

∫0𝜋sin(𝑡)d𝑡=[−cos(𝑡)]0𝜋=−cos(𝜋)+cos(0)=1+1=2.

Thus, the total arc length is:

𝐿=2⋅2⋅2=42.

§47.9 Solution to Exercise 20.2 (tangent to level curve)

Exercise 20.2. Let 𝑘>0 be a fixed real number and let 𝑓(𝑥,𝑦)=𝑥3+𝑘𝑦2. Assume that the level curve of 𝑓 for the value 21 passes through the point 𝑃=(1,2). Compute the equation of the tangent line to this level curve at the point 𝑃.

The first task is to recover the value of 𝑘 which wasn’t given in the statement. First, substitute the point (1,2) into the function 𝑓(𝑥,𝑦):

𝑓(1,2)=13+𝑘(22)=1+4𝑘.

We are told that 𝑓(1,2)=21, so we set the equation equal to 21:

1+4𝑘=21⟹4𝑘=20⟹𝑘=5.

Thus, the function is:

𝑓(𝑥,𝑦)=𝑥3+5𝑦2.

Now that we know 𝑓, we can compute the gradient by taking the partial derivatives:

∇𝑓=(𝜕𝑓𝜕𝑥𝜕𝑓𝜕𝑦)=(3𝑥210𝑦).

Now evaluate the gradient at 𝑃=(1,2):

∇𝑓(1,2)=(3(1)210(2))=(320).

The gradient is always normal to the tangent line, so the tangent line must be of the form

3𝑥+20𝑦=𝑡

for some number 𝑡. This line passes through (1,2) so we can get

𝑡=3⋅1+20⋅2=43.

Hence the line requested is

3𝑥+20𝑦=43.

§47.10 Solution to Exercise 20.3 (approximation of 𝑓=𝑥5𝑦)

Exercise 20.3. Let 𝑓(𝑥,𝑦)=𝑥5𝑦 for 𝑥,𝑦>0. Use linear approximation to estimate 𝑓(1.001,3.001) starting from the point (1,3).

We are given the function:

𝑓(𝑥,𝑦)=𝑥5𝑦

and are asked to estimate 𝑓(1.001,3.001) using linear approximation, starting from the point (1,3), at which

𝑓(1,3)=1.

We start by computing ∇𝑓.

Thus, the gradient of 𝑓(𝑥,𝑦) is:

∇𝑓(𝑥,𝑦)=⟨5𝑦𝑥5𝑦−1,5𝑥5𝑦log(𝑥)⟩.

The gradient at (1,3) is thus

∇𝑓(1,3)=(150).

The linear approximation of 𝑓(1.001,𝑦) near the point (1,3) can be expressed in terms of the gradient dot the displacement:

𝑓(1.001,3.001)≈𝑓(1,3)+∇𝑓(1,3)⋅(0.0010.001)=1+(150)⋅(0.0010.001)=1.015.

§47.11 Solution to Exercise 20.4 (cosine-quartic critical points)

Exercise 20.4. Consider the function 𝑓:ℝ2→ℝ defined by

𝑓(𝑥,𝑦)=cos(𝜋𝑥)+𝑦44−𝑦33−𝑦2.

Although this is stated as an 18.02 problem, it can actually be solved basically only using 18.01 methods. We’ll still present the solution from an 18.02 perspective, but we’ll comment many times on places where just 18.01 methods would have been sufficient.

Finding the critical points

To find the critical points, we first compute the gradient. The partial derivatives are

𝑓𝑥(𝑥,𝑦)=𝜕𝜕𝑥(cos(𝜋𝑥)+𝑦44−𝑦33−𝑦2)=−𝜋sin(𝜋𝑥).𝑓𝑦(𝑥,𝑦)=𝜕𝜕𝑦(cos(𝜋𝑥)+𝑦44−𝑦33−𝑦2)=𝑦3−𝑦2−2𝑦.

Hence

∇𝑓(𝑥,𝑦)=(−𝜋sin(𝜋𝑥)𝑦3−𝑦2−2𝑦).

Setting this equal to 𝟎 lets us solve each equation individually:

So there are infinitely many critical points! The critical points occur when 𝑥 is any integer and 𝑦=−1, 𝑦=0, 𝑦=2. See Figure 111.

Figure 111: Plot of the critical points of the function in the 𝑥𝑦-plane as red dots.

Classification using second derivative test

We now classify each of the points using the second derivative test. Calculate the second derivatives needed:

𝐴=𝑓𝑥𝑥(𝑥,𝑦)=𝜕2𝑓𝜕𝑥2=−𝜋2cos(𝜋𝑥),𝐵=𝑓𝑥𝑦(𝑥,𝑦)=𝜕2𝑓𝜕𝑥𝜕𝑦=0,𝐶=𝑓𝑦𝑦(𝑥,𝑦)=𝜕2𝑓𝜕𝑦2=3𝑦2−2𝑦−2.

We summarize all six cases in the table below. For each entry in the table we also compute 𝐴𝐶−𝐵2 and then specify the answer based on the second derivative test.

𝑥=…,−4,−2,0,2,4… is even𝑥=…,−3,−1,1,3… is odd
𝑦=−1(𝐴,𝐵,𝐶)=(−𝜋2,0,3)
𝐴𝐶−𝐵2=−3𝜋2<0 gives saddle pt
(𝐴,𝐵,𝐶)=(𝜋2,0,3)
𝐴𝐶−𝐵2=3𝜋2>0 gives local min
𝑦=0(𝐴,𝐵,𝐶)=(−𝜋2,0,−2)
𝐴𝐶−𝐵2=2𝜋2>0 gives local max
(𝐴,𝐵,𝐶)=(𝜋2,0,−2)
𝐴𝐶−𝐵2=−2𝜋2<0 gives saddle pt
𝑦=2(𝐴,𝐵,𝐶)=(−𝜋2,0,6)
𝐴𝐶−𝐵2=−6𝜋2<0 gives saddle pt
(𝐴,𝐵,𝐶)=(𝜋2,0,6)
𝐴𝐶−𝐵2=6𝜋2>0 gives local min

Another approach without the second derivative test

You can get the same classification by just looking at the given function too. The point is that the function splits nicely into two halves: if define the one-variable functions

𝑎(𝑥)≔cos(𝜋𝑥)𝑏(𝑦)≔𝑦44−𝑦33−𝑦2

then

𝑓(𝑥,𝑦)=𝑎(𝑥)+𝑏(𝑦).

In that case, the following result is true:

If you have a good conceptual understanding of saddle points, this should be obvious. It’s essentially Figure 38 from Section 17.3.

Figure 112: The function 𝑓 is just the sum of two independent functions, which can be optimized independently.

This gives us the same table as above, since:

The global minimums and maximums

First, we evaluate 𝑓 on every critical point. This is easiest to do if we use the 𝑎 and 𝑏 notation from before and compute

𝑎(even)=cos(𝜋⋅even)=1𝑎(odd)=cos(𝜋⋅odd)=−1𝑏(−1)=(−1)44−(−1)33−(−1)2=−512𝑏(0)=(0)44−(0)33−(0)2=0𝑏(2)=(2)44−(2)33−(2)2=−83

Then we get the six values shown in Table 25.

𝑥=…,−4,−2,0,2,4… is even𝑥=…,−3,−1,1,3… is odd
𝑦=−1𝑓(even,−1)=1−512=712𝑓(odd,−1)=−1−512=−1712
𝑦=0𝑓(even,0)=1+0=1𝑓(odd,0)=−1+0=−1
𝑦=2𝑓(even,2)=1−83=−53𝑓(odd,2)=−1−83=−113
Table 25: Values of 𝑓 at the critical points

There are no inequality constraints at all, so we just think about limit cases 𝑥→±∞ or 𝑦→±∞.

When 𝑦→±∞, the quartic 𝑏(𝑦)=𝑦44−𝑦33−𝑦2 explodes to infinity. This implies already there cannot be any global maximum.

In the case where 𝑥→±∞, the cosine term of 𝑓(𝑥,𝑦) will oscillate between −1 and 1, with period 2𝜋. So there are no new smaller values of 𝑓 that can be obtained here.

Another way to see the global minimums and maximums

Because

𝑓(𝑥,𝑦)=𝑎(𝑥)+𝑏(𝑦)

the global minimum of 𝑓 should be the sum of the global minimums of 𝑎 and 𝑏, and likewise the global maximum of 𝑓 should be the sum of the global maximums of 𝑎 and 𝑏. So we could have also just used 18.01 methods on 𝑎 and 𝑏 individually, as in Figure 112. That is:

Remember, this only works because we could easily divorce 𝑓(𝑥,𝑦) into a function in 𝑥 plus a function in 𝑦. For most functions 𝑓(𝑥,𝑦) like 𝑥𝑦 or 𝑒𝑥sin(𝑦), this approach is not going to fly.

§47.12 Solution to Exercise 20.5 (LM practice)

Exercise 20.5. Compute the minimum and maximum possible value of 𝑥+2𝑦+2𝑧 over real numbers 𝑥, 𝑦, 𝑧 satisfying 𝑥2+𝑦2+𝑧2≤100.

Let 𝑓(𝑥,𝑦,𝑧)=𝑥+2𝑦+2𝑧. Let ℛ︀ denote the region 𝑥2+𝑦2+𝑧2≤100 (a ball of radius 10) and let 𝒮︀ denote the boundary 𝑥2+𝑦2+𝑧2=100 (a sphere of radius 10). We follow the steps we described in the recipe in Section 19.2 and Section 19.4.

  1. ℛ︀ is three-dimensional and has no limit cases but a two-dimensional boundary 𝒮︀. (Because of the condition 𝑥2+𝑦2+𝑧2≤100 and all the squares being nonnegative, none of the variables can go to ±∞.)

  2. We calculate all the critical points of the objective function 𝑓(𝑥,𝑦,𝑧)=𝑥+2𝑦+2𝑧. The gradient is

    ∇𝑓=(122)

    So there are no critical points, because this gradient is never 0.

  3. The boundary in 𝒮︀ is a sphere, and it cannot easily be handled. We pull out Lagrange multipliers and follow the recipe all the way through again.

    1. 𝒮︀ is two-dimensional and has no limit cases or boundary.

    2. We search for LM-critical points by letting 𝑔(𝑥,𝑦,𝑧)=𝑥2+𝑦2+𝑧2, so 𝒮︀ is the level surface 𝑔=100. Calculate the gradient of 𝑔:

      ∇𝑔=(2𝑥2𝑦2𝑧).

      Recall that an LM-critical point is one for which 𝑔(𝑃)=100 and either

      ∇𝑓(𝑃)=𝜆∇𝑔(𝑃) OR ∇(𝑃)=0.

      This gradient ∇𝑔 could be 𝟎 at (𝑥,𝑦,𝑧)=(0,0,0), but this point does not lie on 𝒮︀, so we disregard it.

      In the main case ∇𝑓=𝜆𝑔, we seek points such that

      1=𝜆⋅2𝑥2=𝜆⋅2𝑦2=𝜆⋅2𝑧.

      Our strategy is to kill every variable except 𝜆, by writing

      𝑥=12𝜆𝑦=1𝜆𝑧=1𝜆.

      Plugging this back into the constraint equation 𝑥2+𝑦2+𝑧2=100 and simplifying gives

      (12𝜆)2+(1𝜆)2+(1𝜆)2=100⟺94𝜆2=100⟺𝜆2=9400⟺𝜆=±320.

      Putting these two values of 𝜆 in gives (𝑥,𝑦,𝑧)=(103,203,203) and (𝑥,𝑦,𝑧)=(−103,−203,−203) These are the two LM-critical points. Evaluating this gives

      𝑓(103,203,203)=103+2⋅203+2⋅203=30𝑓(−103,−203,−203)=−103+2⋅−203+2⋅−203=−30.
    3. There are no boundary cases to consider for 𝒮︀.

    4. There are no limit cases to consider for 𝒮︀.

    In conclusion, the maximum value is 30 and the minimum value is −30, at the points (103,203,203) and (−103,−203,−203) we found earlier.

  4. There are no limit cases to consider for ℛ︀.

Digression
Note that in fact one can note a priori that any maximum or minimum should occur on the sphere. One way to see this is that if one takes a point strictly inside ℛ︀ like 𝑃=(6,8,0), one can always increase the absolute value of 𝑓 by scaling 𝑃 until it lies on the sphere (e.g. (60,80,0)). Hence there is no loss of generality in assuming maximums and minimums lie on 𝒮︀. So if one is observant enough they can skip straight to the LM on 𝒮︀, ignoring the region ℛ︀ entirely.

§47.13 Solution to Exercise 20.6 (tangent plane)

Exercise 20.6. Consider the level surface of 𝑓(𝑥,𝑦,𝑧)=(𝑥−1)2+(𝑦−1)3+(𝑧−1)4 that passes through the origin 𝑂=(0,0,0). Let ℋ︀ denote the tangent plane to this surface at 𝑂. Give an example of two nonzero tangent vectors to this surface at 𝑂 whose span is ℋ︀.

The gradient of the function 𝑓

∇𝑓=(2(𝑥−1)3(𝑦−1)24(𝑧−1)3)

and so the gradient at the origin is

∇𝑓(0,0,0)=(−23−4).

The tangent plane ℋ︀ consists of those vectors which are normal to (−23−4). This plane is two-dimensional. So, to find two vectors spanning ℋ︀, according to the “buy two get one free” result from Section 8.2, we just need to give any two linearly independent (i.e. not multiples of each other) vectors which are both perpendicular to (−23−4).

There are many valid choices. One such example might be (320) and (043). These two vectors are clearly not multiples of each other, and

(−23−4)⋅(320)=(−2)⋅3+3⋅2+(−4)⋅0=0(−23−4)⋅(043)=(−2)⋅0+3⋅4+(−4)⋅3=0

so they are indeed tangent vectors contained in ℋ︀.

  1. 28 If you wanted to, you could split the cases a bit differently. For example, you could do 𝑥2+𝑦2≤25 and 𝑥2+𝑦2>25 so the cases don’t overlap. Or you could split into three cases with 𝑥2+𝑦2<25, 𝑥2+𝑦2=25, 𝑥2+𝑦2>25. However, I think doing it with 𝑥2+𝑦2≤25 and 𝑥2+𝑦2≥25 is cleanest, so you do not need to consider limit cases when 𝑥2+𝑦2 approaches 25. The boundary 𝑥2+𝑦2=25 is shared, so you only need to do it once.