asymptote
ShopSeason 1BlogSign in
Play
BlogHow to playFormulasFor teachersCreatorsJoin a class gameBadges and levelsLeaderboardsDailyCurvePracticeShopGift a PassTip jarFounderPricing
/
You approach it and never arrive.

Asymptote is a free online calculus game: a calculus practice game for derivatives, limits and integrals, with typed answers and a live mode for class. Newest guide: Area Under a Curve: Definite Integrals & Practice Problems.

Guides with practice problems: Chain rule · U-substitution · Implicit differentiation · Integration by parts · Product rule · Quotient rule · Power rule · L'Hôpital's rule · Related rates · All guides →
SupportTermsPrivacyRefundsInstagramXPressMade with ♥ by the_calculusguy© Boolean Productions 2026

Blog · Calculus guides · 6 November 2026 · 5 min read

By the Asymptote team. Every answer on this page is checked by the same machine that grades the game.

Optimization Problems: 3 Examples & Practice Problems

An illustration of Optimization

An optimization problem asks for the largest or smallest value of a quantity, such as an area, a volume or a distance, under a constraint. Write the quantity as a function of one variable, solve f′(x)=0 to find the critical points, then compare the function's value there and at the ends of the allowed interval. The biggest value is the maximum and the smallest is the minimum.

On this page

  • Formula
  • When to use it
  • Steps
  • Worked examples
  • Practice problems
  • Common mistakes
  • FAQ

The formula

f′(x)=0then comparef(critical points), f(a), f(b)

The closed interval method. It is less a formula than a shopping list, but once the function is on the page it is the whole job.

When to use it

Use it whenever a word problem says maximize, minimize, largest, smallest, cheapest or closest, and something is holding you back: a fixed length of fence, a can that must hold a fixed volume, a point that has to stay on a curve. Without a constraint there is usually nothing to optimize (make the field infinitely big, done). The calculus is often the easy part. The real work is turning a paragraph into one function of one variable, which is why the steps below spend more time on setup than on derivatives.

How to do it, step by step

  1. Draw it and name things. Sketch the situation, label every length that can change, and write down the quantity you want to make big or small (the objective).
  2. Write the constraint as an equation. The fence is 400 m long, the volume is fixed, the point lies on y=x2. This is the equation that links your variables.
  3. Get the objective down to one variable. Solve the constraint for one variable and substitute it in, so you have f(x) and nothing else. Write down the interval of x values that make physical sense.
  4. Differentiate and solve f′(x)=0. These critical points are the candidates. Throw out any outside the interval.
  5. Check the candidates and the ends. Evaluate f at each critical point and at the endpoints (or use the second derivative test), then answer the question that was actually asked, with units.

Worked examples

Example 1: A field along a river

Easy

A farmer has 400 m of fencing and wants a rectangular field along a straight river, fencing only the three sides away from the water. What is the largest area she can enclose?

Let x be the length of each side running away from the river. Those two sides use 2x metres, so the side parallel to the river gets 400−2x. Area is width times length:

A(x)=x(400−2x),0≤x≤200

Expand and differentiate: A(x)=400x−2x2, so A′(x)=400−4x, which is zero at x=100.

At the ends, A(0)=0 and A(200)=0 (a field with no width, or no length, which the farmer will not thank you for). At x=100 the area is 100⋅200.

Answer

Amax​=20000 m2 at x=100 m

Example 2: An open-top box

Medium

An open-top box is made from a 12 cm by 12 cm sheet by cutting a square of side x from each corner and folding up the sides. What value of x gives the largest volume, and what is that volume?

After the cuts, the base is 12−2x on each side and the height is x, so

V(x)=x(12−2x)2,0≤x≤6

Differentiate with the product rule and the chain rule, then pull out the common factor:

V′(x)=(12−2x)2+x⋅2(12−2x)(−2)=(12−2x)(12−6x)

So V′(x)=0 at x=6 or x=2. At x=6 there is no base left and V=0, the same as at x=0. At x=2 the base is 8 by 8 and the height is 2.

V(2)=2⋅82=128

Answer

x=2 cm,Vmax​=128 cm3

Example 3: The closest point on a parabola

Harder

Find the point on y=x2 (with x>0) closest to (0,3), and the shortest distance.

A point on the curve is (x,x2), and its distance to (0,3) is x2+(x2−3)2​. Square roots are a nuisance to differentiate, and the distance is smallest exactly where its square is smallest, so minimize the square instead:

D(x)=x2+(x2−3)2
D′(x)=2x+2(x2−3)(2x)=2x(2x2−5)

For x>0 the only zero is at x2=25​, so x=25​​≈1.581. D′ is negative just before it and positive just after, so it is a minimum. There x2−3=−21​, and

D(25​​)=25​+41​=411​

That is the squared distance. Take the square root at the very end, and only then.

Answer

x=25​​,D2=411​,distance=211​​≈1.658

Optimization practice problems

Three to try, easy to harder. Type an answer and it is checked instantly by the same checker that grades the game; any correct form counts. Stuck? The answer and the first step are under each one.

Problem 1

Easy

A rectangle has a perimeter of 100 m, so with one side x its area is the function below. What is the largest possible area, in square metres?

A(x)=x(50−x),0≤x≤50

Stuck? Show the answer

Answer

625

How to start

Expand to A(x)=50x−x2, so A′(x)=50−2x. Find where that is zero, then check it beats the endpoints.

Problem 2

Medium

An open-top box is made from a 16 cm by 10 cm sheet by cutting a square of side x from each corner. Its volume is below. What is the largest possible volume, in cubic centimetres?

V(x)=x(16−2x)(10−2x),0≤x≤5

Stuck? Show the answer

Answer

144

How to start

Multiply out to V(x)=4x3−52x2+160x, then V′(x)=12x2−104x+160=4(3x−20)(x−2). Only one root is inside [0,5].

Problem 3

Harder

An open-top cylindrical can must hold 64π cubic centimetres. With radius x, its surface area is below. What is the smallest possible surface area?

S(x)=πx2+x128π​,x>0

Stuck? Show the answer

Answer

48π

How to start

Differentiate: S′(x)=2πx−x2128π​. Setting it to zero gives x3=64, so find x and put it back into S.

Want more? Asymptote has 392 more optimization problems, free, with no account.

Common mistakes

  • Differentiating with two variables still in. If your function has both x and y in it, you are not ready. Use the constraint to get rid of one of them first.
  • Forgetting the endpoints. A critical point is a candidate, not a winner. On a closed interval the biggest value can sit at an end, so check f(a) and f(b) too.
  • Answering the wrong question. The box problem may ask for x rather than the volume, and the closest-point problem for a coordinate rather than the distance. Reread the last sentence before you type.
  • Keeping critical points that make no sense. A negative length, or a box with no base, solves f′(x)=0 but not the problem. The interval from step 3 is there to throw them out.

Practice it now

No clock, three strikes

Optimization lives in Diverge, from about difficulty 7: fences along rivers, open-top boxes, cans that must hold a fixed volume, and the closest point on y=x2. Answers are rounded to three decimal places, so keep the algebra exact and round at the end.

Play DivergeSee it on the formula sheet

FAQ

What are the steps to solve an optimization problem?
Draw and label, write the objective and the constraint, reduce to one variable on an interval, solve f′(x)=0, then compare the critical points with the endpoints.
How do you know if it is a maximum or a minimum?
Compare values: the largest on the interval is the maximum. Or use the second derivative, where f′′<0 at the critical point means a maximum and f′′>0 a minimum. There is more in local maximum and minimum.
Do I have to check the endpoints?
On a closed interval, yes. If the interval is open, or the function heads off to infinity at the ends, check the sign of f′ on either side of the critical point instead.
Why minimize the distance squared instead of the distance?
Because □​ is increasing, the distance and its square are smallest at the same x. The square has no root to differentiate, so the algebra is shorter.
Where can I find optimization practice problems?
Right on this page: the practice problems section has three optimization problems, easy, medium and harder, with the answer and the first step under each one, and a box that checks what you type with the same checker that grades Asymptote. The game has 392 more optimization problems after that, free and with no account: try Diverge, which has no clock.

Keep going

  • Related Rates: 5 Steps, Ladder & Cone, Practice Problems

    Related rates in 5 steps: name it, link it, differentiate with respect to t, then plug in. Balloon, ladder and cone examples and practice problems.

  • Linear Approximation: Formula, 3 Examples & Practice Problems

    Linear approximation: f(x) ≈ f(a) + f'(a)(x − a), the tangent line. Estimating √4.1 and friends, over or under, 3 worked examples and practice problems.

  • Area Between Curves: Formula, 3 Examples & Practice Problems

    The area between two curves is ∫(top − bottom) dx between where they meet. Curves that cross, 3 step-by-step examples and practice problems with answers.