Optimization: practice problems with step-by-step solutions

Free Optimization practice problems with diagrams, hints and full worked solutions. New values every time, at three levels: maximum area or volume, minimum cost or material, profit and revenue.

Free practice problemEasy
riverxxy

A farmer has 240 m of fencing to enclose a rectangular field along a straight river. No fence is needed along the river. Find the largest area A that can be enclosed.

240 m2x + y = 240
m²
Next problem →
Practise Optimization for freePractise Optimization now5 free problems every day. No card needed.

What you practise

  1. Easymaximum area or volume
  2. Mediumminimum cost or material
  3. Hardprofit and revenue

Key formulas

Method
write Q(x) with one variable, solve Q′(x) = 0, check Q″ or the endpoints
Maximum
Q′(x) = 0, Q″(x) < 0
Minimum
Q′(x) = 0, Q″(x) > 0
Closed cylinder
V = πr²h, A = 2πr² + 2πrh
Profit
P = R − C, R = p·q, maximum where MR = MC

Learn Optimization from scratch

Before this: Derivatives

1What optimization is

Optimization means finding the best value: the largest area for a given length of fence, the least metal for a can, or the highest profit.

The quantity you want to make as large or as small as possible depends on one variable, for example the width x of a field.

Picture its graph. At the top of a hill and at the bottom of a valley, the graph is flat for a moment. So the slope there is zero.

That is the key idea: at a maximum or a minimum, the derivative is 0. You find the best x by solving Q′(x) = 0.

Self-check The area A(x) of a field has its largest value at x = 12. What is A′(12)?
  1. 0
  2. A negative number
  3. A positive number
  4. The same as A(12)

Answer: 0. At the top of the graph the tangent is horizontal, so the slope is 0. A positive slope means the area is still increasing.

2The goal and the constraint

Every optimization problem has two parts. Name them before you calculate anything.

  • The goal: the quantity to maximise or minimise, such as an area A or a cost C.
  • The constraint: a fixed condition, such as the total length of fence or the volume a can must hold.

The goal usually has two variables, for example A = x · y. You cannot differentiate that yet.

Use the constraint to write y in terms of x. Then the goal depends on x only.

Example: a rectangle with a perimeter of 20 m has 2x + 2y = 20, so y = 10 − x and A(x) = x(10 − x) = 10x − x².

Draw a sketch first and write every length on it. Most mistakes happen in the constraint.

Self-check A field along a river is fenced on three sides with 40 m: two sides of length x and one side y parallel to the river. What is the constraint?
  1. 2x + 2y = 40
  2. 2x + y = 40
  3. x + y = 40
  4. x · y = 40

Answer: 2x + y = 40. There are three fences: x, x and y. The river side needs no fence. 2x + 2y would be a full rectangle with four fenced sides.

3Cost and profit problems

In business problems, the goal is the profit: revenue minus cost.

P(q) = R(q) − C(q), R = p · q

Here q is the number of units sold and p the price per unit. If the price depends on q, put that formula into R first.

Example: the price is p = 60 − q and the cost is C = 100 + 30q.

R = (60 − q)·q = 60q − q²
P = 60q − q² − 100 − 30q = −q² + 30q − 100
P′(q) = −2q + 30 = 0 ⇒ q = 15

The best price is then p = 60 − 15 = €45. Read the question carefully: it may ask for q, p or the profit P itself.

Self-check A product sells for €40 per unit. The cost of q units is C = 100 + 10q + 0.5q² euros. Which output q gives the highest profit?
  1. 15
  2. 30
  3. 40
  4. 60

Answer: 30. P = 40q − 100 − 10q − 0.5q², so P′ = 30 − q = 0 and q = 30. Forgetting the 2 when you differentiate 0.5q² gives 60.

4The method step by step

  1. Draw a sketch and name the variables.
  2. Write the goal Q (area, cost, profit) and the constraint.
  3. Use the constraint to write Q as a function of one variable, Q(x).
  4. Differentiate and solve Q′(x) = 0.
  5. Check that it is the right kind of point: Q″ < 0 for a maximum, Q″ > 0 for a minimum.
  6. Answer the question that was asked: x, the other side, or the best value of Q itself, with units.

5A worked example

Follow every step. Try to predict the next one before you open it.

Worked example

A farmer has 60 m of fencing for a rectangular field along a straight river. No fence is needed along the river. Find the side y parallel to the river and the largest area A.

1

Sketch and constraint

xxyA

The river is at the top, so only three sides need fence: two sides x and one side y.

2x + y = 60 ⇒ y = 60 − 2x
2

Area in one variable

A = x · y = x(60 − 2x) = 60x − 2x²
3

Set the derivative to zero

A′(x) = 60 − 4x = 0 ⇒ x = 15 m
4

Is it a maximum?

A″(x) = −4 < 0

The second derivative is negative, so x = 15 m gives the largest area.

xA(15, 450)1530
5

Other side and area

y = 60 − 2 · 15 = 30 m
A = 15 · 30 = 450 m²
6

Check the answer

Try a value on each side. x = 14 gives 14 · 32 = 448 m², and x = 16 gives 16 · 28 = 448 m². Both are smaller than 450 m².

Answer

y = 30 m and the largest area is A = 450 m².

6Common mistakes

  • Giving the answer for the wrong quantity: the question asks for y, and you give x.
  • Differentiating a goal that still has two variables. Use the constraint first.
  • Writing the wrong constraint, for example fencing the river side as well.
  • Not checking whether the point is a maximum or a minimum.
  • Forgetting units, or giving an area in m instead of m².
Self-check With 40 m of fence along a river (2x + y = 40), the best width is x = 10 m. The question asks for the side y parallel to the river. What do you answer?
  1. 10 m
  2. 20 m
  3. 200 m²
  4. 40 m

Answer: 20 m. y = 40 − 2 · 10 = 20 m. Answering 10 m gives x instead of y, and 200 m² is the area, not a side.

7How exam questions look

  • Easy: maximum area or volume, such as a field along a river or a pen divided by an extra fence.
  • Medium: minimum cost or material, such as a closed can (V = πr²h, A = 2πr² + 2πrh) or a fence with two prices per metre.
  • Hard: profit and revenue. Build P = R − C, solve P′(q) = 0, then find the price or the maximum profit.

A quick check: put a value a little above and a little below your answer into Q. Both should be worse.

Learn it step by step in the appLearn it step by step in the app

Worked examples

Example 1Easy
x18 cm18 cmx

An open box is made from a square sheet of cardboard 18 cm × 18 cm by cutting equal squares of side x from the four corners and folding up the sides. Find the largest possible volume V.

18 cm × 18 cm

Find V (cm³)

Show hints
  1. The base measures (18 − 2x) by (18 − 2x) and the height is x.
  2. V(x) = x·(18 − 2x)·(18 − 2x) = 4x3 − 72x2 + 324x.
  3. V′(x) = 12x2 − 144x + 324 = 0. Only a root with 0 < x < 9 makes sense.
Show the answer and the step-by-step solution

Optimization: write the quantity to optimise as a function of one variable, using the constraint to eliminate the other. Set the derivative to zero and solve. Check that the critical point is a maximum or minimum (second derivative or sign change of the first derivative) and that it lies inside the allowed range; an endpoint such as a zero side length is not the answer.

Volume as a function of x

V(x) = x·(18 − 2x)·(18 − 2x) = 4x3 − 72x2 + 324x

Set the derivative to zero

The larger root gives a base side ≤ 0, so it is outside the allowed range.

V′(x) = 12x2 − 144x + 324 = 0
x = 3 or x = 9
x = 3 cm

Volume

V = 3·12·12 = 432 cm³

Answer

V = 432 cm³
Example 2Medium
rh

A closed cylindrical can (with a top and a bottom) must hold 400 cm³. The metal used is proportional to the total surface area. Find the smallest possible surface area A.

V = 400 cm³

Find A (cm²)

Show hints
  1. Use the volume to eliminate h: πr²h = 400, so h = 400/(πr²).
  2. A(r) = 2πr² + 2·400/r.
  3. A′(r) = 4πr − 2·400/r² = 0 → r³ = 400/(2π).
Show the answer and the step-by-step solution

Optimization: write the quantity to optimise as a function of one variable, using the constraint to eliminate the other. Set the derivative to zero and solve. Check that the critical point is a maximum or minimum (second derivative or sign change of the first derivative) and that it lies inside the allowed range; an endpoint such as a zero side length is not the answer.

Area as a function of r

h = 400/(πr²)
A(r) = 2πr² + 800/r

Set the derivative to zero

A″(r) = 4π + 1600/r³ > 0, so this is a minimum.

4πr − 800/r² = 0 → r = ∛(400/(2π)) = 3.993 cm

Height and area

h = 400/(π·3.993²) = 2r = 7.986 cm
A = 2π·3.993² + 800/3.993 = 300.5 cm²

Answer

A = 300.5 cm²

The cheapest closed can is as tall as it is wide: h = 2r.

Example 3Hard
p (€)R(p)10now

A theatre sells 580 tickets per show at €10 each. Market research shows that every €1 increase in the ticket price means 20 fewer tickets sold (and every €1 decrease, 20 more). Find the maximum revenue R per show.

580 × €1020 / €1

Find R (€)

Show hints
  1. Tickets sold at price p: n(p) = 580 − 20·(p − 10) = 780 − 20p.
  2. R(p) = p·(780 − 20p) = 780p − 20p².
  3. R′(p) = 780 − 40p = 0.
Show the answer and the step-by-step solution

Optimization: write the quantity to optimise as a function of one variable, using the constraint to eliminate the other. Set the derivative to zero and solve. Check that the critical point is a maximum or minimum (second derivative or sign change of the first derivative) and that it lies inside the allowed range; an endpoint such as a zero side length is not the answer.

Revenue as a function of price

n(p) = 780 − 20p
R(p) = 780p − 20p²

Set the derivative to zero

R″(p) = −40 < 0, so this is a maximum.

p = 780/40 = €19.5

Maximum revenue

n = 780 − 20·19.5 = 390
R = 19.5·390 = €7605

Answer

R = €7605

Questions and answers

What is Optimization?

Optimization means finding the best value: the largest area for a given length of fence, the least metal for a can, or the highest profit.

The quantity you want to make as large or as small as possible depends on one variable, for example the width x of a field.

How do I solve Optimization problems step by step?

Optimization: write the quantity to optimise as a function of one variable, using the constraint to eliminate the other. Set the derivative to zero and solve. Check that the critical point is a maximum or minimum (second derivative or sign change of the first derivative) and that it lies inside the allowed range; an endpoint such as a zero side length is not the answer.

What are common mistakes in Optimization?
  • Each side of the base loses a square at both ends, so the base sides are a − 2x and b − 2x, not a − x and b − x.
  • The can is closed: count both the top and the bottom, A = 2πr² + 2πrh.
  • That is the revenue at the current price. Find the price where R′(p) = 0 first.
What do the Optimization exercises cover?
  • Easy: maximum area or volume
  • Medium: minimum cost or material
  • Hard: profit and revenue

Every problem has new values, so you learn the method instead of an answer. Stuck? Open a small hint first, and the full explanation only when you need it.

How practising works

  • Every problem has new values, so you learn the method instead of an answer.
  • Stuck? Open a small hint first, and the full explanation only when you need it.
  • Your progress, mistakes and saved problems are kept, so you can review before the exam.

Topics before and after this one

Learn first

Courses with this topic

More topics in Mathematics & statistics

Printable worksheet

Practise Optimization for freePractise Optimization now5 free problems every day. No card needed.