# You should try the following two problems on your own.

```You should try the following two problems on your own.
Example 0.1. A farmer wants to create an isosceles trapezoidal field for his
flock of sheep. However, he hates his meddling neighbors to the south, so wants
the south wall to cover the entire 100m border between his property and the
neighbor’s property. The farmer has ℓ &gt; 200 meters of fencing to build the wall.
How should the field be built in order to maximize the grazing area?
Example 0.2. Out of all of the square pyramids with surface area S, which one
has the largest volume? The volume is 13 Ah where A is the area of the base.
I’m not going to use this next problem in my lecture, but I put it here
anyway. Read through it if you’re interested in an optimization problem with 4
parameters in it.
Example 0.3. You enter a silly race along a long hallway that has a conveyor
belt in it. The hallway is 400m long. However, the rules of the race stipulate
that you must hop on 1 foot for at least 30 seconds. Your speed (relative to the
ground below) is v while you are running and w while you are hopping. Assume
that the conveyor belt, which is moving you forward at speed x, has a sufficiently
high length ℓ that you can hop for up to 30 seconds on the conveyor belt.
What strategy should you use to finish the race as quickly as possible? How
long should you hop on one foot on the ground vs on the conveyor belt?
OK, let’s start by determining which quantity we want to maximize or minimize. Because we’re trying to win the race, we want to minimize the time
taken.
What do we know about the time? Well the time can be expressed as
t1 + t2 + t3 + t4
where t1 is the time spent running on the ground, t2 is the time spent running
on the conveyor belt, t3 is the time spent hopping on the ground, and t4 is the
time spent hopping on the conveyor belt.
We know that we want t3 + t4 = 30 (You obviously don’t want to hop for
more than 30 seconds). Furthermore, the total distance is 400, so
t1 v + t2 (v + s) + t3 w + t4 (w + s) = 400
Finally, we have that your total conveyor belt distance is equal to ℓ, so you
get
t2 (v + s) + t4 (w + s) = ℓ.
Now let’s solve these equations: We have
t3 = 30 − t4
ℓ − t4 (w + s)
t2 =
v+s
So we plug these values for t2 and t3 into the equation with the 400 in it:
1
t1 v +
ℓ − t4 (w + s)
(v + s) + (30 − t4 )w + t4 (w + s) = 400
v+s
t1 v + ℓ − t4 (w + s) + 30w + t4 s = 400
1
t1 = (400 − ℓ − 30w + t4 w)
v
So we get that the total time t is
t = t1 + t2 + t3 + t4
1
1
= (400 − ℓ − 30w + t4 w) +
(ℓ − t4 (w + s)) + 30 − t4 + t4
v
v+s
1
1
(ℓ − t4 (w + s)) + 30
= (400 − ℓ − 30w + t4 w) +
v
v+s
So the entire expression is in terms of the variable t4 and the parameters v, w,
and s. The derivative is then wv − w+s
v+s , which is never zero unless the conveyor
belt is stationary (s = 0). If s is positive, then the derivative is always negative;
if s is negative, then this expression is always positive. (Note that the parameters
w, v, ℓ, and s don’t really affect the outcome here: all that matters is that w &lt; v
and that s &gt; 0).
So there are no places where the derivative is zero. This is typical for optimization problems in which all of the constraints and the objective function are
linear.
Note that the derivative being negative means that if we want to move as
quickly as possible, we should pick t4 to be as large as possible; that is, we
should pick t4 to be 30. We only need to check this endpoint and the endpoint
t4 = 0. If t4 = 0 we get:
t=
1
1
(400 − ℓ − 30w) +
ℓ
v
v+s
which is
t=
w
1
(400 − ℓ) − 30
v
v
and if t4 = 30 we get
t=
1
1
(400 − ℓ) +
(ℓ − 30(w + s))
v
v+s
so the time simplifies to
t=
which is smaller because
ℓ
v+s
1
(400 − ℓ) +
− 30
v
v+s
w+s
v+s
w+s
is larger than
2
v
w.
```