Skip to content

Optimization problems, step by step

6 min read

Short answer

Write the quantity to optimize as a function of one variable (using the constraint to eliminate the others), find where its derivative is 00 or undefined, and check with the second derivative or the endpoints that you really have a maximum or minimum.

Diagrammax
At the maximum of a smooth curve the tangent is horizontal, so f′ = 0.

The method

  1. Draw and name the variables.
  2. Write the objective (what you optimize) and the constraint.
  3. Solve the constraint for one variable and substitute, so the objective has one variable.
  4. Find the domain, then solve f′(x)=0f'(x)=0.
  5. Test the critical points and the endpoints. Answer the question that was asked.

Checking the answer

If f′′<0f''<0 at a critical point it is a local maximum; if f′′>0f''>0, a local minimum. On a closed interval, compare ff at the critical points and at both endpoints.

Worked example

You have 40 m of fence for a rectangular pen against a wall (no fence needed on the wall side). What dimensions maximize the area?

Let the two sides perpendicular to the wall be xx and the side parallel to it be 40−2x40-2x. Area A(x)=x(40−2x)=40x−2x2A(x)=x(40-2x)=40x-2x^2. Then A′(x)=40−4x=0A'(x)=40-4x=0 gives x=10x=10 and A′′=−4<0A''=-4<0 (a maximum). The pen is 1010 m by 2020 m, with area 200 m2200\ \text{m}^2.

Try it yourself

Find two positive numbers with sum 2020 whose product is as large as possible.

Show the answer

Let the numbers be xx and 20−x20-x. P=x(20−x)P=x(20-x), P′=20−2x=0P'=20-2x=0, so x=10x=10. Both numbers are 1010, product 100100.

Keep going with practice

Vidi's multivariable lessons extend this to several variables with the second derivative test and Lagrange multipliers.