IB Mathematics: Analysis and Approaches HL — Topic 5 Calculus
AA HL Optimisation
Find the quickest route, largest area and greatest volume using constraints and calculus.
Learning goal
Build a model, then find and justify its optimum.
Syllabus link
AHL 5.14 Implicit differentiation and endpoint cases.
Big idea
Choose the target quantity before differentiating.
Start with a problem
Where should you join the path to arrive fastest?
Which route is quickest?
Worked example 1: Minimise the travel time
Question. A student starts at point \(P\), which is \(300\) m from a straight path. The destination \(Q\) is \(900\) m along the path from the nearest point \(A\). The student walks across grass at \(1.2\text{ m s}^{-1}\), then runs along the path at \(2\text{ m s}^{-1}\).
The student walks from \(P\) to a point \(X\) on the path, then runs from \(X\) to \(Q\). Let \(\theta\) be the angle between \(PX\) and the perpendicular route \(PA\). Find the value of \(\theta\) that minimises the total time.

Solution
Step 1: Identify the target and constraint
The target quantity is the total travel time. The constraints come from the right-angled triangle and from the fixed distance \(AQ=900\text{ m}\).
Step 2: Write the model
Let \(\theta\) be the angle between \(PX\) and the perpendicular route \(PA\). Time is distance divided by speed, so
From the triangle,
and therefore
Step 3: Use the constraint
This is direct substitution (Route A): the trigonometric constraints already express every distance in terms of \(\theta\). Substituting gives
Because \(X\) lies between \(A\) and \(Q\), the contextual domain is
Step 4: Optimise and check
Differentiate:
Set \(T'(\theta)=0\):
Hence
Since \(\sec^2\theta>0\), the sign of \(T'(\theta)\) changes from negative to positive as \(\sin\theta\) passes through \(\frac35\). Therefore the travel time decreases and then increases, so this critical value gives the minimum.
Answer: The minimum time occurs when \(\theta=\arcsin\left(\frac35\right)\).
The four steps, seen in the route problem
Identify. The target is what is being optimised: here, travel time. The constraint is a restriction linking the variables: here, the route geometry.
Model. Write a formula for the target and separate equations for the constraints.
Use the constraint. Make the target depend on one independent variable. In the route problem, every distance was expressed using \(\theta\).
Optimise and check. Find the possible optima, check the allowed domain and endpoints, and justify the answer in context.
The same method applies to area, volume, cost, profit and distance.
Check the whole allowed domain
On \([a,b]\), compare valid stationary points, points where the derivative does not exist, and the endpoints. An endpoint optimum need not satisfy \(Q'(x)=0\). A derivative sign test, second derivative test or direct comparison can justify an interior optimum.
What if the best route is not allowed?
An interior optimum may satisfy \(Q'(x)=0\). A restriction can exclude that point, leaving an endpoint as the best choice.
Worked example 2: A barrier changes the best route
Question. A student starts at point \(P\), which is \(300\) m from the nearest point \(A\) on a straight path. The destination \(Q\) is \(900\) m along the path from \(A\). The student walks across grass at \(1.2\text{ m s}^{-1}\), then runs along the path at \(2\text{ m s}^{-1}\).
The student walks from \(P\) to a point \(X\) on the path and then runs from \(X\) to \(Q\). A barrier requires \(AX\leq120\) m. Let \(\theta\) be the angle between \(PX\) and the perpendicular route \(PA\). Find where the student should reach the path to minimise the total travel time.
Solution
Step 1: Identify the target and constraint
The target quantity is the total travel time. The constraints come from the right-angled triangle, the fixed distance \(AQ=900\text{ m}\), and the barrier restriction \(AX\leq120\text{ m}\).
Step 2: Write the model
From the triangle,
so
Therefore
Step 3: Use the constraint
This is Route A. Substitution gives
The barrier restricts the domain:
Step 4: Optimise and check
Differentiate:
The unrestricted stationary value would satisfy
for which \(\tan\theta=\frac34\). This would give \(AX=300\left(\frac34\right)=225\text{ m}\), so it is not allowed.
On the allowed interval, \(\theta\leq\arctan\left(\frac25\right)<\arcsin\left(\frac35\right)\), and hence \(T'(\theta)<0\). Therefore \(T\) is decreasing throughout the allowed interval, so the minimum occurs at its right-hand endpoint:
Answer: The student should reach the path at the furthest allowed point, \(120\) m from \(A\).
Keep the constraint implicit
When rearranging a constraint creates a square root or several branches, implicit differentiation can make the working clearer.
Worked example 3: Maximise a rectangle in an ellipse
Question. A rectangle is centred at the origin with its sides parallel to the coordinate axes. Its vertices lie on the ellipse
Find the maximum possible area of the rectangle.

Solution
Step 1: Identify the target and constraint
The target quantity is the area of the rectangle. The constraint is that every vertex lies on the ellipse.
Step 2: Write the model
Work in the first quadrant, so \(x\geq0\) and \(y\geq0\). The rectangle has width \(2x\) and height \(2y\), hence
The separate constraint is
Step 3: Use the constraint
Solving explicitly for \(y\) would give \(y=4\sqrt{1-\frac{x^2}{36}}\), which introduces an unnecessary square root. We therefore use implicit differentiation (Route B). Regard \(y=y(x)\), so that along the ellipse
Differentiate the constraint with respect to \(x\):
so
The relevant domain is \(0\leq x\leq6\), with \(y\geq0\).
Why this works. The area still contains \(x\) and \(y\), but \(y=y(x)\) along the ellipse. Substituting for \(\frac{dy}{dx}\) now lets us differentiate the area without solving for \(y\).
Step 4: Optimise and check
Differentiate the target quantity and substitute the result from Step 3:
At an interior critical point,
This gives a relationship between the variables, not yet their actual values. We now return to the original constraint from Step 2. Since \(y^2=\frac{4x^2}{9}\), substitute into the ellipse:
Thus
Therefore
At the endpoints of the first-quadrant arc, \((0,4)\) and \((6,0)\), the rectangle has area \(0\). Hence the interior critical point gives the absolute maximum.
Answer: The maximum possible area is \(48\) square units.
Two ways to use a constraint
Route A – direct substitution. If \(y=g(x)\) is convenient, substitute it into the target:
Route B – implicit differentiation. Keep \(G(x,y)=0\), treat \(y\) as a function of \(x\), and find \(\frac{dy}{dx}\). Substitute this into the derivative of the target. Both \(x\) and \(y\) may remain, but they are linked by the constraint.
In either route, differentiate the target to find its optimum. The equation \(Q'(x)=0\) may give a relationship such as \(9y^2=4x^2\); use the original constraint to find the actual values.
Optimisation with an implicit constraint
Work through the four-step method, then use the original constraint to find and justify the optimum.
Closest and furthest points
Worked example 4: Find the closest and furthest points
Question. Points \((x,y)\) lie on the curve
Find the points on the curve that are closest to the origin and furthest from the origin.

Solution
Step 1: Identify the target and constraint
The target quantity is the distance from the origin. To avoid a square root, we optimise the square of the distance; this gives the same closest and furthest points. The constraint is the given curve.
Step 2: Write the model
Step 3: Use the constraint
Solving the constraint explicitly for \(y\) would introduce quadratic-formula expressions and two branches. We therefore use Route B: regard \(y=y(x)\) wherever the curve is not vertical and differentiate the constraint:
Hence
Along the constraint, the target is the one-variable function
In Step 4, this expression for \(\frac{dy}{dx}\) will be substituted into \(\frac{d}{dx}(D^2)\), eliminating \(\frac{dy}{dx}\) from the derivative of the target quantity.
Step 4: Optimise and check
Differentiate:
At a non-vertical critical point,
Substitute \(\frac{dy}{dx}=-\frac{2x+y}{x+2y}\):
Multiplying by \(x+2y\) gives
Therefore
These are relationships between the variables at the critical points. We now return to the original constraint from Step 2.
If \(y=x\), then
giving \((\sqrt7,\sqrt7)\) and \((-\sqrt7,-\sqrt7)\), with
If \(y=-x\), then
giving \((\sqrt{21},-\sqrt{21})\) and \((-\sqrt{21},\sqrt{21})\), with
For completeness, Route B written as \(y=y(x)\) may miss points with a vertical tangent. These satisfy \(x+2y=0\). Substitution into the constraint gives \(x^2=28\), and hence \(D^2=35\), which lies between \(14\) and \(42\). Because the curve is closed and bounded, comparison of all candidates gives the absolute minimum and maximum.
Answer: Closest: \((\sqrt7,\sqrt7)\), \((-\sqrt7,-\sqrt7)\). Furthest: \((\sqrt{21},-\sqrt{21})\), \((-\sqrt{21},\sqrt{21})\).
The largest possible cone
Worked example 5: Maximise the volume of a cone
Question. A right circular cone has fixed slant height \(5\) cm. Its radius is \(r\) cm and its perpendicular height is \(h\) cm.
The dimensions satisfy the implicit constraint
Find the radius and height of the cone that give the maximum possible volume.

Solution
Step 1: Identify the target and constraint
The target quantity is the volume of the cone. The constraint is the fixed slant height, which links \(r\) and \(h\) through
Step 2: Write the model
The volume of a cone is
The separate constraint is
with \(r\ge 0\) and \(h\ge 0\).
Step 3: Use the constraint
We use Route B. Rather than writing \(h=\sqrt{25-r^2}\), we keep the constraint implicit and regard \(h=h(r)\). Differentiate the constraint with respect to \(r\):
Hence
Along the constraint, the target is the one-variable function
In Step 4, this expression for \(\frac{dh}{dr}\) will be substituted into \(\frac{dV}{dr}\), eliminating \(\frac{dh}{dr}\) from the derivative of the target quantity.
Step 4: Optimise and check
Differentiate:
Substitute \(\frac{dh}{dr}=-\frac{r}{h}\):
At an interior critical point,
Since \(r>0\) and \(h>0\) for a non-degenerate cone, multiply by \(h\) and factor out \(r\):
This gives a relationship between the variables. We now return to the original constraint from Step 2:
Therefore
and
At the endpoints \((r,h)=(0,5)\) and \((5,0)\), the volume is \(0\). Hence the interior critical point gives the absolute maximum.
The maximum volume is
Answer: The cone of maximum volume has radius \(\frac{5\sqrt6}{3}\) cm and height \(\frac{5}{\sqrt3}\) cm.
Practice questions
The first six questions provide shorter practice on the main AA HL optimisation techniques. Questions 7 to 10 are IB AA HL exam-style questions on this topic, with structured parts and diagrams.
Minimum-time route. A person starts \(250\) m from a straight road. Their destination is \(1000\) m along the road from the nearest point \(A\). They cross the field at \(1\text{ m s}^{-1}\) and then run along the road at \(2.5\text{ m s}^{-1}\). Let \(\theta\) be the angle between the crossing route and the perpendicular route to the road. Show that the minimum time occurs when \(\sin\theta=\frac25\), and find the distance along the road already covered when the person reaches the road.

Endpoint restriction. A student is \(300\) m from a straight path. Their destination is \(900\) m along the path from the nearest point \(A\). They walk across grass at \(1.2\text{ m s}^{-1}\) and then run along the path at \(2\text{ m s}^{-1}\). The point where they reach the path must satisfy \(AX\le 120\) m. Let \(\theta\) be the angle between the route across the grass and the perpendicular route to the path. Find where the student should reach the path to minimise the total time.

Maximum rectangle in an ellipse. A rectangle is centred at the origin with sides parallel to the coordinate axes. Its vertices lie on the ellipse
\[\frac{x^2}{49}+\frac{y^2}{25}=1.\]Use implicit differentiation to find the maximum possible area of the rectangle.

Rectangle under an implicit curve. A rectangle has vertices \((0,0)\), \((x,0)\), \((x,y)\) and \((0,y)\), where \(x>0\) and \(y>0\). The point \((x,y)\) lies on the curve
\[x^2+xy+y^2=12.\]Find the maximum possible area of the rectangle.

Maximum-volume cone. A right circular cone has fixed slant height \(10\) cm. Its radius is \(r\) cm and its perpendicular height is \(h\) cm. The dimensions satisfy the implicit constraint \(r^2+h^2=100\). Find the radius and height that give the maximum possible volume.

Closest and furthest points. Points \((x,y)\) lie on the curve
\[x^2+xy+y^2=12.\]Find the points on the curve that are closest to the origin and furthest from the origin.

IB AA HL exam-style questions: Questions 7–10
Use the structured parts to build each solution.
[IB AA HL exam style] The diagram shows a rectangle centred at the origin, with sides parallel to the coordinate axes. Its vertices lie on the ellipse
\[\frac{x^2}{36}+\frac{y^2}{16}=1.\]
Show that the area of the rectangle is \(A=4xy\).
Differentiate the constraint implicitly to show that
\[\frac{dy}{dx}=-\frac{4x}{9y}.\]Hence show that, at a stationary value of \(A\),
\[9y^2=4x^2.\]Find the maximum possible area of the rectangle.
[IB AA HL exam style] A right circular cone has fixed slant height \(6\) cm. Its radius is \(r\) cm and its perpendicular height is \(h\) cm.

Show that the dimensions satisfy
\[r^2+h^2=36.\]Write down a formula for the volume \(V\) of the cone.
By differentiating implicitly, show that
\[\frac{dV}{dr}=\frac{\pi}{3}\left(2rh-\frac{r^3}{h}\right).\]Hence find the values of \(r\) and \(h\) that give the maximum possible volume.
[IB AA HL exam style] Points \((x,y)\) lie on the curve
\[x^2+xy+y^2=21.\]
Explain why it is convenient to optimise \(D^2=x^2+y^2\) rather than \(D\), where \(D\) is the distance from the origin.
Differentiate the constraint implicitly to show that
\[\frac{dy}{dx}=-\frac{2x+y}{x+2y}.\]Hence show that non-vertical stationary points satisfy
\[x^2-y^2=0.\]Find the points on the curve that are closest to the origin and furthest from the origin.
[IB AA HL exam style] A rectangle lies in the first quadrant with one vertex at the origin and top-right corner \((x,y)\) on the curve
\[\begin{gathered}x^2+4xy+4y^2=64, \\ x>0,\; y>0.\end{gathered}\]
Show that the area of the rectangle is \(A=xy\).
Differentiate the constraint implicitly to show that
\[\frac{dy}{dx}=-\frac12.\]Hence show that, at a stationary value of \(A\),
\[y=\frac{x}{2}.\]Find the maximum possible area of the rectangle.
Answer key
1. Minimum-time route
Then
Setting \(T'(\theta)=0\) gives
Hence \(\sin\theta=\frac25\). Then
so the distance already covered along the road is
On \(0\leq\theta\leq\arctan 4\), the derivative has the sign of \(5\sin\theta-2\). It changes from negative to positive, so this stationary point gives the minimum.
2. Endpoint restriction
The time function is
and the restriction \(AX\le 120\) gives
The unrestricted optimum satisfies \(\sin\theta=\frac35\), which gives \(\tan\theta=\frac34\), so it is not allowed. On the permitted interval,
so \(T\) is decreasing. The minimum occurs at the endpoint, so
3. Rectangle in an ellipse
Implicit differentiation gives
So
Setting \(\frac{dA}{dx}=0\) gives \(y^2=\frac{25x^2}{49}\). Substituting into the ellipse gives
Hence
The area is zero at the endpoints of the first-quadrant arc. This is the only interior stationary point, so it gives the absolute maximum.
4. Rectangle under an implicit curve
Implicit differentiation gives
Then
Setting \(\frac{dA}{dx}=0\) leads to
Since \(x>0\) and \(y>0\), \(y=x\). Substituting into the constraint gives
Therefore
At the ends of the first-quadrant arc, one side tends to zero and hence the area tends to zero. The positive interior stationary value is therefore the maximum.
5. Maximum-volume cone
Differentiate the constraint implicitly:
Then
At a stationary point,
Using the constraint,
So the cone of maximum volume has radius \(\frac{10\sqrt6}{3}\) cm and height \(\frac{10}{\sqrt3}\) cm.
The endpoint volumes are zero at \((r,h)=(0,10)\) and \((10,0)\). The only positive interior stationary volume is the absolute maximum.
6. Closest and furthest points on \(x^2+xy+y^2=12\)
Optimise \(D^2=x^2+y^2\). Implicit differentiation of the constraint gives
At a non-vertical stationary point,
so \(y=x\) or \(y=-x\). If \(y=x\), then \(3x^2=12\), so the points are \((2,2)\) and \((-2,-2)\), with \(D^2=8\). If \(y=-x\), then \(x^2=12\), so the points are \((2\sqrt3,-2\sqrt3)\) and \((-2\sqrt3,2\sqrt3)\), with \(D^2=24\). Vertical tangents satisfy \(x+2y=0\). Substituting \(x=-2y\) into the constraint gives \(y^2=4\), \(x^2=16\), and hence \(D^2=20\). This lies between \(8\) and \(24\), so these points are not extreme.
Closest: \((2,2)\), \((-2,-2)\). Furthest: \((2\sqrt3,-2\sqrt3)\), \((-2\sqrt3,2\sqrt3)\).
7. IB exam-style rectangle in an ellipse
(a) \(A=(2x)(2y)=4xy\).
(b) Differentiating \(\frac{x^2}{36}+\frac{y^2}{16}=1\) gives
(c) Since \(A=4xy\),
At a stationary point, \(\frac{dA}{dx}=0\), so \(9y^2=4x^2\).
(d) Substitute \(y^2=\frac{4x^2}{9}\) into the ellipse:
Hence \(x=3\sqrt2\), \(y=2\sqrt2\), and
At the endpoints of the first-quadrant arc the area is zero; the only interior stationary point gives the maximum.
8. IB exam-style cone
(a) By Pythagoras, \(r^2+h^2=36\).
(b) \(V=\frac13\pi r^2h\).
(c) Differentiate implicitly:
Then
(d) Setting \(\frac{dV}{dr}=0\) gives \(r^2=2h^2\). Using \(r^2+h^2=36\),
Maximum-volume dimensions: \(r=2\sqrt6\) cm, \(h=2\sqrt3\) cm.
The endpoint volumes are zero at \((r,h)=(0,6)\) and \((6,0)\), so the only positive interior stationary value gives the maximum.
9. IB exam-style closest and furthest points
(a) Optimising \(D^2\) avoids the square root and gives the same closest and furthest points as optimising \(D\).
(b) Differentiating \(x^2+xy+y^2=21\) gives
(c) From \(\frac{d}{dx}(D^2)=2x+2y\frac{dy}{dx}=0\), substitute for \(\frac{dy}{dx}\):
(d) So \(y=x\) or \(y=-x\). If \(y=x\), then \(3x^2=21\), giving \((\sqrt7,\sqrt7)\) and \((-\sqrt7,-\sqrt7)\), with \(D^2=14\). If \(y=-x\), then \(x^2=21\), giving \((\sqrt{21},-\sqrt{21})\) and \((-\sqrt{21},\sqrt{21})\), with \(D^2=42\). Thus the closest points are \((\sqrt7,\sqrt7)\) and \((-\sqrt7,-\sqrt7)\), and the furthest points are \((\sqrt{21},-\sqrt{21})\) and \((-\sqrt{21},\sqrt{21})\).
Also check the vertical tangents: \(x+2y=0\) gives \(D^2=35\). This is between \(14\) and \(42\). The curve is closed and bounded, so comparison of all candidates establishes both absolute extrema.
10. IB exam-style rectangle in the first quadrant
(a) The area is \(A=xy\).
(b) Differentiate \(x^2+4xy+4y^2=64\):
Hence
(c) Since \(\frac{dA}{dx}=y+x\frac{dy}{dx}\),
At a stationary point, \(\frac{dA}{dx}=0\), so
(d) Substitute into the constraint:
Thus \(x=4\), \(y=2\), and
In the first quadrant, the constraint is \(x+2y=8\). At either end of this segment the area tends to zero, so the only positive interior stationary value is the maximum.