Radford Mathematics IB Mathematics resources • AA SL/HL

Radford Mathematics

Contact / enquiry

Send a question about tutoring, revision courses, website resources or anything else. Your message will be sent to info@radfordmathematics.com.

IB Mathematics: Analysis and Approaches SL/HL — Topic 5 Calculus

Optimization

Build the quantity to optimize from a constraint, then use differentiation, domain checks and endpoints to make the correct decision.

AA SL/HL · SL 5.8

Learning goal

Solve optimization problems by identifying the target quantity and constraint, forming a one-variable model, differentiating and interpreting the result.

Syllabus link

IB Mathematics AA SL/HL: SL 5.8. Local extrema, derivative tests and optimization in contexts such as area, volume and profit.

Big idea

Optimization is not simply “set the derivative equal to zero”. First build the right function; then use calculus and the domain to decide where the largest or smallest value occurs.

Key relationship

Target + constraint → one-variable model → candidates and endpoints → contextual conclusion.

A first question

A farmer has \(50\text{ m}\) of fencing to make a rectangular enclosure. All four sides must be fenced.

What is the maximum possible area of the enclosure?

A very long, narrow rectangle uses the available fencing but encloses little area. A shape that is too short and wide also encloses less area. Somewhere between these extremes is the rectangle with the largest possible area.

Rectangular enclosure with side lengths x and y and 50 metres of fencing in total.
1

What is an optimization problem?

An optimization problem asks for the largest or smallest possible value of a quantity, under a constraint. In the first question, we want the largest possible area under the constraint that only 50 m of fencing is available.

At the heart of every optimization problem are two key quantities or expressions: the target quantity, which we want to maximize or minimize, and the constraint, which restricts the possible values of the variables.

Target quantity

The target quantity is what the question asks us to maximize or minimize, such as area, volume, cost, profit, time or distance.

In the first question, the target is the area of the enclosure. If its side lengths are \(x\) and \(y\), then

\[A=xy.\]

The goal is to find the maximum possible value of A.

Constraint

The constraint is the restriction linking the variables. It usually allows us to rewrite the target using one variable only.

In the first question, all four sides use a total of 50 m of fencing:

\[2x+2y=50.\]

Hence \(y=25-x\), allowing us to write the area using one variable:

\[A=x(25-x).\]

The four-step method for every optimization problem

  1. Identify the target quantity and the constraint.
  2. Write the target and the constraint in terms of the problem’s variables.
  3. Eliminate one variable using the constraint. The target must be written in terms of one single variable.
  4. Optimize the target using calculus (or technology): find its minimum or maximum value.

We will learn the method through a series of worked examples. Each of the four steps is identified explicitly so that the modelling process and the role of each step are clear.

2

Worked examples

Worked example 1: pen against a wall

A farmer uses \(80\text{ m}\) of fencing to make a rectangular pen against a straight wall. No fencing is needed along the wall. Find the dimensions that maximize the area.

Rectangular pen against a wall; the two sides perpendicular to the wall have length x and the fenced parallel side has length y.

Solution

Step 1: Identify the target quantity and the constraint.

The target is the area of the pen. The constraint is that only 80 m of fencing is used for the three exposed sides.

Step 2: Write the target and constraint using the variables.

Let \(x\) be the length of each side perpendicular to the wall, and \(y\) the side parallel to the wall.

\[A=xy,\qquad 2x+y=80.\]

Step 3: Use the constraint to write the target in one variable.

\[y=80-2x.\]
\[\begin{aligned}A(x)&=x(80-2x)\\&=80x-2x^2.\end{aligned}\]

Positive dimensions require \(0<x<40\).

Step 4: Use calculus to optimize the target.

Differentiate:

\[A'(x)=80-4x.\]

Set \(A'(x)=0\):

\[80-4x=0\Rightarrow x=20.\]

Then

\[y=80-2(20)=40.\]
\[A''(x)=-4<0.\]

The area function is concave down, so this gives the maximum.

The maximum area occurs when the pen is \(20\text{ m}\) by \(40\text{ m}\).

Worked example 2: minimum surface area of a cylinder

A closed cylinder has volume \(250\pi\text{ cm}^3\). Find the radius and height that minimize its surface area.

Closed cylinder with radius r and height h.

Solution

Step 1: Identify the target quantity and the constraint.

The target is the surface area of the closed cylinder. The constraint is its fixed volume of \(250\pi\text{ cm}^3\).

Step 2: Write the target and constraint using the variables.

Let \(r\) be the radius and \(h\) the height. Include the two circular ends and the curved surface:

\[\begin{gathered}S=2\pi r^2+2\pi rh\\\pi r^2h=250\pi.\end{gathered}\]

Step 3: Use the constraint to write the target in one variable.

From the volume constraint,

\[r^2h=250\Rightarrow h=\frac{250}{r^2}.\]

Substitute into the surface area:

\[\begin{gathered}\begin{aligned}S(r)&=2\pi r^2+2\pi r\left(\frac{250}{r^2}\right)\\&=2\pi r^2+\frac{500\pi}{r}\end{aligned}\\r>0.\end{gathered}\]

Step 4: Use calculus to optimize the target.

\[S'(r)=4\pi r-\frac{500\pi}{r^2}.\]

Set \(S'(r)=0\), then multiply by \(r^2\):

\[\begin{gathered}4\pi r-\frac{500\pi}{r^2}=0\\\Rightarrow 4\pi r^3-500\pi=0.\end{gathered}\]
\[r^3=125\Rightarrow r=5.\]

Then

\[h=\frac{250}{5^2}=10.\]
\[\begin{gathered}S''(r)=4\pi+\frac{1000\pi}{r^3}>0\\{}(r>0).\end{gathered}\]

The surface-area function is concave up throughout its domain, so this gives the minimum.

The surface area is minimized when \(r=5\text{ cm}\) and \(h=10\text{ cm}\).

Important warning: stationary points are only candidates

A stationary point does not automatically give the required maximum or minimum. For the differentiable functions considered here, the absolute maximum or minimum on a closed interval can occur at a stationary point or at an endpoint. Always check the domain and endpoints, especially in applications.

A curve with local stationary extrema; its absolute minimum on the closed interval is at the left endpoint and its absolute maximum at the right endpoint.

Here the stationary points give a local maximum and a local minimum, but the absolute extrema occur at the endpoints.

Worked example 3: a maximum at an endpoint

A rectangle has one vertex at the origin, sides on the coordinate axes, and its top-right corner on the curve \(y=9-x^2\), where \(0\le x\le1\). Find the maximum possible area.

Rectangle with one corner at the origin and opposite corner on y equals 9 minus x squared; the width is restricted to 0 to 1.

Solution

Step 1: Identify the target quantity and the constraint.

The target is the rectangle’s area. Its top-right corner must lie on \(y=9-x^2\), and its width must satisfy \(0\le x\le1\).

Step 2: Write the target and constraint using the variables.

Let the width be \(x\) and the height be \(y\).

\[\begin{gathered}A=xy\\y=9-x^2\\0\le x\le1.\end{gathered}\]

Step 3: Use the constraint to write the target in one variable.

\[A(x)=x(9-x^2)=9x-x^3.\]

Step 4: Use calculus to optimize the target.

\[A'(x)=9-3x^2.\]

Set \(A'(x)=0\):

\[9-3x^2=0\Rightarrow x^2=3.\]

The positive candidate is \(x=\sqrt3\), but \(\sqrt3\notin[0,1]\); the negative root is also outside the domain. There is no stationary point in the permitted interval. Compare the endpoints:

\[\begin{gathered}A(0)=0\\\begin{aligned}A(1)&=9(1)-1^3\\&=8.\end{aligned}\end{gathered}\]

The maximum occurs at \(x=1\), and \(y=9-1^2=8\).

The maximum possible area is 8 square units, at the endpoint \(x=1\), with \(y=8\).

Worked example 4: largest rectangle under a curve

A rectangle has one vertex at the origin, sides on the coordinate axes, and its top-right corner on \(y=12-x^2\), where \(0\le x\le\sqrt{12}\). Find the maximum possible area.

Rectangle with one corner at the origin and opposite corner at (x,y) on the curve y equals 12 minus x squared.

Solution

Step 1: Identify the target quantity and the constraint.

The target is the rectangle’s area. The constraint is that its top-right corner lies on \(y=12-x^2\) in the first quadrant.

Step 2: Write the target and constraint using the variables.

\[A=xy,\qquad y=12-x^2.\]

Step 3: Use the constraint to write the target in one variable.

\[A(x)=x(12-x^2)=12x-x^3.\]

Step 4: Use calculus to optimize the target.

\[A'(x)=12-3x^2.\]
\[\begin{gathered}12-3x^2=0\\\Rightarrow x^2=4\\\Rightarrow x=2.\end{gathered}\]

Take the non-negative root, since x is a width. Then

\[y=12-2^2=8.\]

Check the nature of the stationary point:

\[\begin{gathered}A''(x)=-6x\\A''(2)=-12<0.\end{gathered}\]

The area is zero at both endpoints \(x=0\) and \(x=\sqrt{12}\), so this is the absolute maximum.

\[A_{\max}=2\times8=16.\]

The maximum possible area is 16 square units.

Worked example 5: maximizing profit

A company sells \(x\) items. The price per item, in euros, is modelled by \(p(x)=60-0.2x\), and the cost of producing \(x\) items is \(C(x)=12x+150\). Find the number of items that maximizes profit.

Solution

Step 1: Identify the target quantity and the constraint.

The target is the company’s profit. The given price and cost models determine how profit depends on the number of items sold.

Unlike the geometric examples, there is no separate fixed-resource constraint such as a perimeter or volume equation. The price and cost models are the relationships that restrict the situation and let us construct the profit function.

Step 2: Write the target and given relationships using the variable.

Revenue is price multiplied by quantity, and profit is revenue minus cost:

\[\begin{gathered}R(x)=xp(x)\\P(x)=R(x)-C(x).\end{gathered}\]
\[\begin{gathered}p(x)=60-0.2x\\C(x)=12x+150.\end{gathered}\]

Step 3: Write the target as a function of one variable.

First calculate revenue:

\[\begin{aligned}R(x)&=x(60-0.2x)\\&=60x-0.2x^2.\end{aligned}\]

Therefore

\[\begin{aligned}P(x)&=60x-0.2x^2\\&\quad-(12x+150).\end{aligned}\]
\[P(x)=-0.2x^2+48x-150.\]

Step 4: Use calculus to optimize the target.

\[P'(x)=-0.4x+48.\]
\[-0.4x+48=0\Rightarrow x=120.\]
\[P''(x)=-0.4<0.\]

This gives a maximum. The result is a whole number of items and gives a non-negative selling price.

The profit is maximized when the company sells 120 items.

3

IB exam-style questions: where are the four steps?

The four-step method is usually revealed gradually

IB optimization questions do not normally label each step. Instead, the context and sequence of sub-questions gradually reveal the same process. The opening information may give the variables and a constraint, while a later sub-question introduces the target. Read the entire question before beginning calculations.

Annotated IB exam-style question: three garden plots [11 marks]

A community garden is divided into three identical rectangular plots placed side by side against a straight wall. No fencing is needed along the wall. Each plot has depth \(x\) metres and width \(y\) metres. The total area is \(192\text{ m}^2\).

Three identical garden plots against a wall, each of depth x and width y, with four vertical fences and one lower fence of length 3y.
Four-step reading note. The opening information gives the variables and fixed-area constraint. The target quantity is introduced only in part (b), where L is defined as the total fencing length. Read every part first so that both parts of Step 1 are clear.
  1. Write down an equation connecting \(x\) and \(y\).[1]
    Four-step link: Step 2: write the constraint using the variables.
  2. Let \(L\) metres be the total length of fencing required. Show that \(L=4x+\frac{192}{x}\).[3]
    Four-step link: This introduces the target quantity, completing Step 1, then guides Steps 2 and 3: write the target in two variables and eliminate y.
  3. Find \(\dfrac{dL}{dx}\).[2]
    Four-step link: Step 4: begin the calculus stage by differentiating the one-variable target.
  4. Hence find the values of \(x\) and \(y\) for which the total length of fencing is a minimum. Justify that your answer gives a minimum.[4]
    Four-step link: Step 4: find and test the minimizing value, then return to the constraint for the second dimension.
  5. State the minimum total length of fencing.[1]
    Four-step link: Interpretation: give the optimized target quantity in context.

How the sub-parts reproduce the four-step method

  1. Step 1: the opening gives the fixed-area constraint; part (b) introduces the target L.
  2. Step 2: part (a) asks for the constraint, and part (b) requires an initial expression for the total fencing in x and y.
  3. Step 3: the rest of part (b) eliminates y to obtain the one-variable expression shown in the question.
  4. Step 4: parts (c)–(e) ask you to differentiate, find dimensions, justify the minimum and interpret the result.

Exam reading habit: read to the end before starting

Do not assume the opening information contains everything for Step 1. Reading all sub-parts reveals what is being optimized, shows how to build the model, and identifies a “show that” result needed later. Use earlier results instead of rebuilding the model from the beginning.

Solution

Step 1: Identify the target quantity and constraint.

The target is the total fencing length L. The constraint is the total area:

\[3xy=192.\]

Step 2: Write the target and constraint using the variables.

There are four vertical fence lengths of size \(x\), and one lower fence of total length \(3y\). Hence

\[L=4x+3y,\qquad3xy=192.\]

Step 3: Use the constraint to obtain a one-variable target.

\[y=\frac{64}{x}.\]
\[\begin{gathered}\begin{aligned}L(x)&=4x+3\left(\frac{64}{x}\right)\\&=4x+\frac{192}{x}\end{aligned}\\x>0.\end{gathered}\]

Step 4: Use calculus to optimize and interpret.

\[L'(x)=4-\frac{192}{x^2}.\]
\[\begin{gathered}4-\frac{192}{x^2}=0\\\Rightarrow x^2=48\\\Rightarrow x=4\sqrt3.\end{gathered}\]
\[L''(x)=\frac{384}{x^3}>0\quad(x>0).\]

This gives a minimum. Also,

\[y=\frac{64}{4\sqrt3}=\frac{16\sqrt3}{3}.\]
\[\begin{aligned}L_{\min}&=4(4\sqrt3)+\frac{192}{4\sqrt3}\\&=32\sqrt3\text{ m}.\end{aligned}\]

Each plot should be \(4\sqrt3\text{ m}\) deep and \(\frac{16\sqrt3}{3}\text{ m}\) wide. The minimum fencing is \(32\sqrt3\text{ m}\).

4

Practice questions

Try these before opening the answers

For each modelling question, identify the target quantity and constraint before differentiating.

  1. Find the local maximum and local minimum points of \(f(x)=x^3-3x^2-9x+2\).

  2. Find the maximum and minimum values of \(f(x)=2x^3-9x^2+12x+1\) on \(0\le x\le4\).

  3. A rectangle has one vertex at the origin and its top-right corner on \(y=9-x^2\), \(0\le x\le3\). Find the maximum possible area.

    Rectangle on the coordinate axes beneath y equals 9 minus x squared.
  4. A rectangular pen is built against a wall using \(60\text{ m}\) of fencing for the other three sides. Find the dimensions that maximize its area.

    Pen against a wall; three fenced sides are labelled x and y.
  5. A closed cylinder has volume \(128\pi\text{ cm}^3\). Find the radius and height that minimize its surface area.

    Closed cylinder labelled radius r and height h.
  6. The profit, in euros, from selling \(x\) items is modelled by \(P(x)=-0.5x^2+70x-800\). Find the number of items that maximizes profit and determine the maximum profit.

  7. A rectangle is placed under \(y=16-2x^2\), \(0\le x\le2\sqrt2\). Its sides lie on the coordinate axes. Find the maximum possible perimeter.

    Rectangle on the coordinate axes beneath y equals 16 minus 2 x squared.
  8. A rectangle has area \(100\text{ cm}^2\). Find the dimensions that minimize its perimeter.

    Rectangle with side lengths x and y and fixed area 100 square centimetres.
5

Answer key

1. Local maximum and local minimum
\[\begin{aligned}f'(x)&=3x^2-6x-9\\&=3(x-3)(x+1).\end{aligned}\]

Stationary values are \(x=-1,3\).

\[f''(x)=6x-6.\]

At \(x=-1\), \(f''(-1)=-12<0\), so there is a local maximum.

\[f(-1)=-1-3+9+2=7.\]

At \(x=3\), \(f''(3)=12>0\), so there is a local minimum.

\[f(3)=27-27-27+2=-25.\]

Local maximum at \((-1,7)\); local minimum at \((3,-25)\).

2. Maximum and minimum on an interval
\[\begin{aligned}f'(x)&=6x^2-18x+12\\&=6(x-1)(x-2).\end{aligned}\]

Check stationary values \(x=1,2\) and endpoints \(x=0,4\):

\[\begin{aligned}f(0)&=1,\\f(1)&=2-9+12+1=6,\\f(2)&=16-36+24+1=5,\\f(4)&=128-144+48+1=33.\end{aligned}\]

Minimum value 1 at x=0; maximum value 33 at x=4.

3. Rectangle under a curve

Target: \(A=xy\). Constraint: \(y=9-x^2\).

\[A(x)=x(9-x^2)=9x-x^3.\]
\[A'(x)=9-3x^2.\]
\[9-3x^2=0\Rightarrow x^2=3\Rightarrow x=\sqrt3.\]
\[y=9-(\sqrt3)^2=6.\]

The endpoints give area 0, and \(A''(\sqrt3)=-6\sqrt3<0\).

\[A_{\max}=6\sqrt3.\]

Maximum possible area \(6\sqrt3\) square units.

4. Pen against a wall

Let \(x\) be each side perpendicular to the wall and \(y\) the side parallel to it. Target: area \(A=xy\).

\[2x+y=60\Rightarrow y=60-2x.\]
\[A(x)=x(60-2x)=60x-2x^2.\]
\[A'(x)=60-4x.\]
\[60-4x=0\Rightarrow x=15.\]

Then \(y=60-2(15)=30\). Since \(A''=-4<0\), this gives the maximum.

Dimensions: \(15\text{ m}\) by \(30\text{ m}\).

5. Minimum surface area of a cylinder

The target is total surface area; the fixed volume supplies the constraint.

\[V=\pi r^2h=128\pi\Rightarrow h=\frac{128}{r^2}.\]
\[S=2\pi r^2+2\pi rh\]
\[\begin{aligned}S(r)&=2\pi r^2+2\pi r\left(\frac{128}{r^2}\right)\\&=2\pi r^2+\frac{256\pi}{r}.\end{aligned}\]
\[S'(r)=4\pi r-\frac{256\pi}{r^2}.\]
\[\begin{gathered}4\pi r=\frac{256\pi}{r^2}\\\Rightarrow 4r^3=256\\\Rightarrow r^3=64.\end{gathered}\]
\[r=4,\qquad h=\frac{128}{4^2}=8.\]

Since \(S''(r)=4\pi+512\pi/r^3>0\) for \(r>0\), this is a minimum.

Radius \(4\text{ cm}\); height \(8\text{ cm}\).

6. Profit
\[P'(x)=-x+70.\]
\[-x+70=0\Rightarrow x=70.\]

Since \(P''(x)=-1<0\), this gives a maximum.

\[\begin{aligned}P(70)&=-0.5(70)^2\\&\quad+70(70)-800\\&=-2450+4900-800\\&=1650.\end{aligned}\]

Sell 70 items; maximum profit is €1650.

7. Maximum perimeter under a curve

The width is \(x\), and the height is \(y=16-2x^2\). The target is perimeter, not area:

\[\begin{aligned}P&=2x+2y\\&=2x+2(16-2x^2)\\&=32+2x-4x^2.\end{aligned}\]
\[P'(x)=2-8x.\]
\[2-8x=0\Rightarrow x=\frac14.\]
\[\begin{aligned}y&=16-2\left(\frac14\right)^2\\&=16-\frac18\\&=\frac{127}{8}.\end{aligned}\]

The perimeter is a concave-down quadratic, since \(P''=-8\), and \(1/4\) is in the permitted interval. Hence

\[\begin{aligned}P_{\max}&=2\left(\frac14\right)+2\left(\frac{127}{8}\right)\\&=\frac12+\frac{127}{4}\\&=\frac{129}{4}.\end{aligned}\]

Maximum perimeter \(129/4\) units.

8. Minimum perimeter with fixed area

Let the sides be \(x\) and \(y\). The constraint is

\[xy=100\Rightarrow y=\frac{100}{x}.\]

The target perimeter is

\[\begin{gathered}\begin{aligned}P&=2x+2y\\&=2x+\frac{200}{x}\end{aligned}\\x>0.\end{gathered}\]
\[P'(x)=2-\frac{200}{x^2}.\]
\[\begin{gathered}2-\frac{200}{x^2}=0\\\Rightarrow x^2=100\\\Rightarrow x=10.\end{gathered}\]

Then \(y=10\). Since \(P''(x)=400/x^3>0\), this gives a minimum.

The rectangle is \(10\text{ cm}\) by \(10\text{ cm}\).