# Optimization problems

> IB Mathematics Applications and Interpretation HL · IB AI HL Calculus
> Source: https://www.owlsprep.com/study/ib-math-ai-hl-u4-optimization-problems/

This subtopic covers how to use differentiation to solve real-world optimization problems, where you find maximum or minimum values of quantities like area, volume or cost subject to given constraints. We cover formulation, solving and verification.

**Prerequisites:** [Differentiation of polynomial and rational functions](https://www.owlsprep.com/study/ib-math-ai-hl-u4-differentiation-basics/); [Finding critical points and extrema](https://www.owlsprep.com/study/ib-math-ai-hl-u4-critical-points-extrema/)

## Learning objectives

- Formulate real-world optimization problems from context
- Use differentiation to find critical points of objective functions
- Distinguish between local and global extrema for constrained problems
- Verify solutions against original problem constraints

## Formulating the Optimization Problem

The first and most critical step in any optimization problem is translating the verbal description into a mathematical function. You need to clearly identify what quantity you need to maximize or minimize, and what constraints are given in the problem.

**Objective Function** — The function whose maximum or minimum value we need to find in an optimization problem

*Example:* For a problem asking for maximum area of a rectangle, the area function is the objective function.

Most problems will have a constraint that relates two or more variables. Use the constraint to rewrite the objective function as a function of a single variable, then define its domain based on the physical constraints of the problem (e.g., side lengths cannot be negative).

**Worked example:** An open-top box is made from a 20 cm by 20 cm sheet of cardboard by cutting out squares of equal side length $x$ from each corner. Formulate the objective function for the volume of the box, and state its domain.

1. After cutting out squares of side $x$ from each corner, the base of the folded box has side length:
2. $$20 - 2x$$
3. The height of the box equals $x$, so volume $V(x)$ (the objective function we want to maximize) is:
4. $$V(x) = x(20 - 2x)^2$$
5. Since side lengths cannot be negative, $x > 0$ and $20 - 2x > 0$, so the domain is:
6. $$0 < x < 10$$

*Calculator:* allowed

## Finding and Classifying Extrema

Once you have a single-variable objective function, the next step is to find its critical points and test which gives the required maximum or minimum. The standard process is:

1. Differentiate the objective function $f(x)$ to get $f'(x)$
2. Set $f'(x) = 0$ and solve for $x$ to find critical points
3. Discard any critical points that lie outside the domain of $x$
4. Test each remaining critical point and endpoints to find the global extremum

> **tip**
>
> For IB AI HL exams, you can use your GDC to find extrema directly after formulating the function, which saves significant time compared to solving by hand.

**Worked example:** Find the value of $x$ that maximizes the volume of the open box from the previous example, and find the maximum volume.

1. We have $V(x) = x(20 - 2x)^2$, domain $0 < x < 10$. Expand for differentiation:
2. $$V(x) = 4x^3 - 80x^2 + 400x$$
3. Differentiate $V(x)$:
4. $$V'(x) = 12x^2 - 160x + 400$$
5. Set $V'(x) = 0$ and simplify the quadratic:
6. $$12x^2 - 160x + 400 = 0 \implies 3x^2 - 40x + 100 = 0$$
7. Solving gives $x = 10$ and $x = \frac{10}{3} \approx 3.33$. $x=10$ is an endpoint with $V=0$, so we discard it.
8. Use the second derivative test to confirm $x = \frac{10}{3}$ is a maximum:
9. $$V''(x) = 24x - 160, \quad V''\left(\frac{10}{3}\right) = -80 < 0$$
10. Calculate the maximum volume:
11. $$V\left(\frac{10}{3}\right) = \frac{16000}{27} \approx 592.6 \text{ cm}^3$$

*Calculator:* allowed

## Constrained Optimization with Multiple Variables

Many common optimization problems involve geometric or cost constraints, where you need to eliminate one variable from the objective function. The core process remains the same after elimination, regardless of the context.

**Worked example:** A rectangular garden is fenced along three sides, with a house forming the fourth side. Total fencing available is 100 m. Find the dimensions that maximize the area of the garden.

1. Let the side parallel to the house be $y$, and the sides perpendicular be $x$. We need to maximize area $A = xy$.
2. The constraint from total fencing is: $2x + y = 100$. Rearrange to get $y = 100 - 2x$.
3. Substitute into the area objective function to get it in terms of $x$ only:
4. $$A(x) = x(100 - 2x) = 100x - 2x^2$$
5. Domain is $0 < x < 50$. Differentiate and set to zero:
6. $$A'(x) = 100 - 4x = 0 \implies x = 25$$
7. Find $y = 100 - 2(25) = 50$. Maximum area is:
8. $$A = 25 \times 50 = 1250 \text{ m}^2$$

**Check your understanding**

Check your understanding of key terms

1. What is the objective function in the garden problem above?

   - $2x + y = 100$
   - $A = xy$
   - $x = 25$

   *Answer:* $A = xy$

   *Why:* Correct! The area is the quantity we want to maximize, so it is the objective function. $2x + y = 100$ is the constraint, and $x=25$ is the optimal solution.

*Calculator:* allowed

## Common pitfalls

- **Wrong:** Forgetting to check endpoints of the domain for the global extremum
  - Why it fails: Many students only check critical points, but the maximum/minimum can be at the endpoint even if it is not a critical point
  - Correct: Always evaluate the objective function at all critical points inside the domain and at the endpoints to find the global extremum
- **Wrong:** Making an algebra error when substituting the constraint into the objective function
  - Why it fails: An incorrect objective function leads to wrong results, even if your differentiation and extrema steps are correct
  - Correct: Double-check your substitution by confirming your final solution satisfies the original constraint
- **Wrong:** Keeping critical points that lie outside the domain of the problem
  - Why it fails: Negative lengths or other impossible values are not valid solutions, even if they are mathematically critical points
  - Correct: Always state the domain of your objective function first, and remove any critical points that do not lie in the domain
- **Wrong:** Giving the optimal $x$ as the answer when the question asks for the maximum/minimum quantity
  - Why it fails: After finding the optimal input value, many students stop before calculating the requested output value
  - Correct: Always re-read the question at the end to confirm what value you are asked to give, and calculate that final value

## Cheatsheet

| Step | Action | Key Note |
| --- | --- | --- |
| 1 | Identify quantity to optimize | This is your objective function |
| 2 | Identify the problem constraint | Use it to eliminate one variable |
| 3 | State the domain of your variable | Remove impossible (negative) values |
| 4 | Find all critical points | Set $f'(x)=0$, discard out of domain |
| 5 | Find the global extremum | Test all critical points + endpoints |
| 6 | Answer the original question | Calculate the value the question asks for |

## What's next

Optimization problems are a core applied calculus topic that appears regularly on both Paper 1 and Paper 2 of IB AI HL exams. The skills you build here translating real-world context into solvable mathematical models are transferable to almost all other applied topics in your course, and for future university study in STEM, economics and data science. After mastering the single-variable optimization covered here, you can extend your knowledge to more advanced topics in calculus and quantitative modeling.

- [Related rates](https://www.owlsprep.com/study/ib-math-ai-hl-u4-related-rates/)
- [Antiderivatives and indefinite integration](https://www.owlsprep.com/study/ib-math-ai-hl-u4-antiderivatives-and-indefinite-integration/)
- [Definite integrals and area under curves](https://www.owlsprep.com/study/ib-math-ai-hl-u4-definite-integrals-and-area-under/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-ai-hl-u4-optimization-problems/
