Setting up optimization problems
Optimization turns a word problem into a function, then uses derivatives to find the best value. Most of the challenge is in the setup, and a reliable routine makes it manageable.
A step-by-step routine
1. Read the problem and draw a picture. 2. Name the quantity to maximise or minimise and the variables involved. 3. Write the objective function. 4. Use the constraint (the given condition) to rewrite the objective in one variable. 5. Find the domain. 6. Find critical numbers and test them, along with endpoints. 7. Answer the question asked, with units. Following the steps in order prevents most errors.
Worked example: the largest pen
A farmer has 200 m of fencing for a rectangular pen. Let the sides be \(x\) and \(y\). Objective: area \(A = xy\). Constraint: \(2x + 2y = 200\), so \(y = 100 - x\). Then \(A(x) = x(100 - x) = 100x - x^2\) on \([0, 100]\). \(A'(x) = 100 - 2x = 0\) gives \(x = 50\). Endpoints give area \(0\), so the maximum is at \(x = y = 50\): a square with area \(2500\) square metres.
A(x) = 100x - x^2,\quad A'(50) = 0Worked example: fencing along a river
Now the pen sits along a river, so only three sides need fencing: \(2x + y = 200\), so \(y = 200 - 2x\). Area \(A(x) = x(200 - 2x) = 200x - 2x^2\). \(A'(x) = 200 - 4x = 0\) gives \(x = 50\) and \(y = 100\). The maximum area is \(5000\) square metres, twice the four-sided answer, because the river does a side's worth of work for free.
Worked example: an open box
From a 12 cm square sheet, cut squares of side \(x\) from each corner and fold up the sides. Volume \(V(x) = x(12 - 2x)^2\) for \(0 \le x \le 6\). Differentiate with the product and chain rules: \(V'(x) = (12 - 2x)^2 - 4x(12 - 2x) = (12 - 2x)(12 - 6x)\). Critical numbers: \(x = 6\) (volume 0) and \(x = 2\). So cut 2 cm squares for a maximum volume of \(2 \cdot 8^2 = 128\) cm\(^3\).
V(x) = x(12-2x)^2Worked example: the cheapest can
A can must hold \(V\) cubic units. Surface area (material) is \(S = 2\pi r^2 + 2\pi r h\), and the constraint \(\pi r^2 h = V\) gives \(h = \frac{V}{\pi r^2}\). Substituting, \(S(r) = 2\pi r^2 + \frac{2V}{r}\). \(S'(r) = 4\pi r - \frac{2V}{r^2} = 0\) gives \(r^3 = \frac{V}{2\pi}\). Substituting back shows \(h = 2r\): the cheapest can is as tall as it is wide.
Worked example: closest point
Which point on \(y = x^2\) is closest to \((0, 2)\)? Distance squared is \(D = x^2 + (x^2 - 2)^2\); minimising distance squared gives the same point and avoids square roots. Let \(u = x^2\): \(D = u + (u-2)^2\), so \(\frac{dD}{du} = 1 + 2(u - 2) = 0\) gives \(u = \frac{3}{2}\). The closest points are \(\left(\pm\sqrt{3/2}, \frac{3}{2}\right)\).
Business applications
Profit is revenue minus cost: \(P(x) = R(x) - C(x)\). At maximum profit, \(P'(x) = 0\), which means \(R'(x) = C'(x)\): marginal revenue equals marginal cost. Economically, keep producing as long as one more item brings in more than it costs. If price depends on quantity, as in \(p = 50 - 0.5x\), revenue is \(R = x(50 - 0.5x)\), a downward parabola.
Checking that you found the best value
On a closed interval, compare the critical values with the endpoints. On an open interval, use the first or second derivative test, or argue from the shape of the function: if there is only one critical number and it is a local maximum, it is the absolute maximum. Always ask whether the answer makes physical sense: lengths must be positive and quantities must fit the constraint.
Common mistakes
Differentiating before reducing to one variable. Forgetting the domain, which leads to answers like negative lengths. Answering with the critical number when the question asks for the maximum value, or the reverse. Dropping units. Forgetting to check endpoints.
Try it yourself
Find two positive numbers that sum to 20 and whose product is as large as possible. Answer: with \(x + y = 20\), \(P = x(20 - x)\), \(P' = 20 - 2x = 0\) gives \(x = 10\). The numbers are 10 and 10, with product 100. Then find the positive number whose sum with its reciprocal is smallest: \(f(x) = x + \frac{1}{x}\), \(f'(x) = 1 - \frac{1}{x^2} = 0\) at \(x = 1\), giving a minimum sum of 2.
Key takeaways
Draw, name variables, write the objective, use the constraint to reduce to one variable, find the domain, then find and test critical numbers. Squares, cubes, and equal splits often appear as optimal shapes. Marginal revenue equals marginal cost at maximum profit. State the answer to the actual question, with units.
A note on modelling
Optimization answers are only as good as the model. Real fences have gates, real cans have seams, and real prices change in steps. Mathematicians often solve the ideal problem first, then adjust. Being explicit about the assumptions you made is part of a good solution.
Flashcard
The quantity to maximise or minimise
Check your understanding
A rectangle has perimeter 60 m. What is the largest possible area?
