Optimization

This page contains free practice, typical optimization problems, each with a detailed solution. The only way to get this problem type down is by practicing, so practice here where you won't be penalized for getting stuck or making small errors. You are guaranteed to have an optimization problem on your upcoming exam, so the time to make all those typical errors is now!

We work through how to use our "Problem Solving Strategy: Optimization" step-by-step in our blog post How to Solve Optimization Problems in Calculus, one of our most popular posts.

PROBLEM SOLVING STRATEGY: Optimization

The strategy consists of two Big Stages. The first does not involve Calculus at all; the second is identical to what you did for max/min problems.

Stage I: Develop the function.

Your first job is to develop a function that represents the quantity you want to optimize. It can depend on only one variable. The steps:

  1. Draw a picture of the physical situation.
    Also note any physical restrictions determined by the physical situation.
  2. Write an equation that relates the quantity you want to optimize in terms of the relevant variables.
  3. If necessary, use other given information to rewrite your equation in terms of a single variable.

Stage II: Maximize or minimize the function.

You now have a standard max/min problem to solve.

  1. Take the derivative of your equation with respect to your single variable. Then find the critical points.
  2. Determine the maxima and minima as necessary.
    Remember to check the endpoints if there are any.
  3. Justify your maxima or minima either by reasoning about the physical situation, or with the first derivative test, or with the second derivative test.
  4. Finally, check to make sure you have answered the question as asked: Re-read the problem and verify that you are providing the value(s) requested: an x or y value; or coordinates; or a maximum area; or a shortest time; whatever was asked.

Minimize cost of materials for a soda can

Practice Problem: Least expensive can
A cylindrical can, with no top lid, must contain 𝑉 cm3 of liquid. What dimensions will minimize the cost of metal to construct the can?

What are the dimensions of the poster with the smallest total area?

Practice Problem: Printed Poster
A poster must have a printed area of 320 cm2. It will have top and bottom margins that are 5 cm each, and side margins that are 4 cm. What are the dimensions of the poster with the smallest total area?

Shortest time to row, then run, to a point on shore

Practice Problem: Shortest time to row, then run, to a point on shore
As described in text. You are in a boat on a still lake, near a straight section of shore. The nearest point to shore is 2 km away. You are aiming to get back to your food and drink supplies, 4 km south of that nearest point. You can row at 5 km/hr, and run at 8 km/hr. At what point 𝑃 should you land your boat to reach your supplies as quickly as possible---before they are consumed by faster friends?

Two boats sailing; when closest together?

Practice Problem: Sailing ships
Boat A leaves a dock at noon and travels due north at 15 km/hr. Simultaneously, Boat B is heading due east toward the same dock at 20 km/hr and reaches there at 2:00 PM. At what time are the two boats closest together?

What dimensions minimize the cost of a garden fence?

Garden fence dimensions

Sam wants to build a garden fence to protect a rectangular 400 square-foot planting area. His next-door neighbor agrees to pay for half of the fence that borders her property; Sam will pay the rest of the cost. What are the dimensions of the planting area that will minimize Sam's cost to build the fence? (You may leave your answer as a square root; you don't have to find a decimal result.)

View/Hide Solution
Garden fence, cost to be minimized

1. Draw a picture of the physical situation.

See the figure. We've called the width of the garden x (the top and bottom portions of the fence), and the length of the garden y (the left and right sides). Note also that the total area of Sam's garden must be 𝐴 =400 ft2.

2. Write an equation that relates the quantity you want to optimize in terms of the relevant variables.

We want to minimize Sam's cost for building the fence, which is the same as minimizing the amount of fence that he's paying for. Let's call that cost C. Remember that Sam is only paying for half of the cost of the right side of the fence, since his neighbor is paying for that other half. Then

𝐶=(length of left side)+(length of top)+12(length of right side)+(length of bottom)=𝑦+𝑥+12𝑦+𝑥=32𝑦+2𝑥

3. If necessary, use other given information to rewrite your equation in terms of a single variable.

The cost C currently depends on two variables, y and x. In order to proceed, we must use other information we're given to rewrite the area in terms of just one of those variables. Let's choose x as that single variable.

We must then eliminate y as a variable. To do so, recall that Sam's garden must have area 𝐴 =400 ft2. Since the garden's rectangular area is given by
𝐴=𝑥𝑦=400
we can solve for y in terms of x:
𝑦=400𝑥
Substituting this expression for y into our expression above for the cost C:
𝐶=32𝑦+2𝑥=32(400𝑥)+2𝑥=600𝑥+2𝑥
The expression for C is now a function of the single variable x, as required.

Graph of garden fence cost versus width x

We've graphed the function, a step you probably wouldn't do yourself — but we want to emphasize that everything you've done so far is to create a function that you're now going to minimize.

4. Take the derivative of your equation with respect to your single variable. Then find the critical points.

𝐶=600𝑥+2𝑥=600𝑥1+2𝑥𝑑𝐶𝑑𝑥=𝑑𝑑𝑥(600𝑥1)+𝑑𝑑𝑥(2𝑥)=600𝑥2+2=600𝑥2+2

The critical points occur when 𝑑𝐶𝑑𝑥 =0:
𝑑𝐶𝑑𝑥=0=600𝑥2+22=600𝑥2𝑥2=6002=300𝑥=300
Note that we choose the positive square root since the width x cannot be negative. Also note that we could have a critical point where 𝑑𝐶𝑑𝑥 = 600𝑥2 +2 is undefined, which occurs when 𝑥 =0. That answer makes no physical sense, though, since then Sam's garden would have zero area. We thus continue our analysis with the single critical point
𝑥=300

5. Justify your maxima or minima either by reasoning about the physical situation, or with the first derivative test, or with the second derivative test.

Let's examine the second derivative. Above we found the first derivative:
𝑑𝐶𝑑𝑥=600𝑥2+2

The second derivative is thus
𝑑2𝐶𝑑𝑥2=𝑑𝑑𝑥(600𝑥2)+𝑑𝑑𝑥(2)=(2)(600)𝑥3+0=1200𝑥3
Since 𝑥 >0, this second derivative (𝑑2𝐶𝑑𝑥2=1200𝑥3) is always positive (𝑑2𝐶𝑑𝑥2>0). Hence this single critical point gives us a minimum for the cost C:

The minimum cost occurs when 𝑥 =300 ft.

6. Determine the maxima and minima as necessary. Remember to check the endpoints if there are any.

Recall that we found above that 𝑦 =400𝑥. Hence when the width 𝑥 =300, the garden's length y must be:
𝑦=400𝑥=400300=4001003=400103=403
Hence Sam's cost is minimized when the garden has

width 𝑥 =300 ft,

and

length 𝑦 =403 ft.

7. Finally, check to make sure you have answered the question as asked: 𝑥 or 𝑦 values, or coordinates, or a maximum area, or a shortest time, or . . . .

The question asked us to specify the garden's dimensions, which we have provided.

Rectangle inscribed in ellipse

Practice Problem: Rectangle inscribed in ellipse
What is the area of the largest rectangle that can be inscribed in the ellipse 𝑥2 +4𝑦2 =16? (Do not use a calculator; you may leave square roots in your answer.)

Rectangle with the greatest area is a square

Practice Problem: Rectangle with the greatest area is a square
Prove that of all rectangles with given perimeter 𝑃, the square has the largest area.

Shortest ladder required to reach a house over a wall

Practice Problem: Shortest ladder required to reach a house over a wall
As described in text A wall 10 feet high is six feet from a house. Find the length of the shortest ladder that will reach the house while leaning against the fence.
[ Hint: The math works out more easily if you call 𝑥 the distance from the base of the ladder to the wall (rather than to the house); see the figure. Even so, the algebra at the end can get messy. Don't spend more than a few minutes on that if you can't easily find the critical point(s); instead just check your work against ours up to that point, and then see a convenient way to factor.]

Rectangular & square enclosures

Practice Problem: Rectangular & square enclosures (based on an exam question)
A man has 340 yards of fencing to enclose two separate fields. One field will be a rectangle twice as long as it is wide, and must contain at least 800 square yards. The other field is a square and must contain at least 100 square yards.
(a)
If 𝑥 is the width of the rectangular field, what are the maximum and minimum possible values of x?
(b)
What is the greatest number of square yards that can be enclosed by the two fields? Justify your answer.

Triangle bounded by axes and curve

Practice Problem: Triangle in curve
A right triangle has one vertex at the origin and one vertex on the curve 𝑦 =𝑒𝑥/2 for 1 𝑥 4. One of the two perpendicular sides is along the 𝑥-axis; the other is parallel to the 𝑦-axis. Find the maximum and minimum areas for such a triangle.
Note: You may use a calculator to compute the areas.

Please let us know on our Forum:

  • What questions do you have about the solutions above?
  • Which ones are giving you the most trouble?
  • What other Optimization problems are you trying to work through for your class?

If you let us know, we'll do our best to help!