Practical examples of finding local and global extrema using calculus

If you’re trying to understand optimization in calculus, nothing beats walking through concrete examples of finding local and global extrema using calculus. These are the high and low points of a function—the peaks and valleys—that show up everywhere from business to engineering to data science. Instead of just memorizing formulas, you’ll see how to actually use derivatives to hunt down those high and low values. In this guide, we’ll focus on real, worked examples of local and global extrema so you can see the pattern and reuse it on your own problems. We’ll move step by step: find critical points, use the first or second derivative test, and check endpoints when needed. Along the way, you’ll see real examples drawn from physics, economics, and even basic data modeling, plus updated 2024–2025 context on why optimization shows up in modern machine learning and decision-making. By the end, you won’t just recognize extrema—you’ll know how to find them with confidence.
Written by
Taylor
Published

Let’s start with a classic: a smooth curve on a closed interval. This is the friendliest setting for examples of finding local and global extrema using calculus, because the Extreme Value Theorem guarantees at least one global maximum and one global minimum.

Take the function
[
f(x) = x^3 - 3x^2 + 2, \quad \text{on } [-1, 4].
]

First, find the derivative:
[
f’(x) = 3x^2 - 6x = 3x(x - 2).
]
Critical points occur where \(f’(x) = 0\):
[
3x(x-2) = 0 \Rightarrow x = 0 \text{ or } x = 2.
]

Now evaluate \(f\) at the critical points and at the endpoints of the interval:

  • \(f(-1) = (-1)^3 - 3(-1)^2 + 2 = -1 - 3 + 2 = -2\)
  • \(f(0) = 0 - 0 + 2 = 2\)
  • \(f(2) = 8 - 12 + 2 = -2\)
  • \(f(4) = 64 - 48 + 2 = 18\)

Compare these values:

  • Smallest value: \(-2\) at \(x = -1\) and \(x = 2\) → global minima (two different points, same minimum value)
  • Largest value: \(18\) at \(x = 4\) → global maximum

On the open interval, \(x = 0\) is a local maximum (value 2 surrounded by lower values) and \(x = 2\) is a local minimum. This is a clean example of how local extrema and global extrema can overlap: \(x = 2\) is both a local and a global minimum.

Quadratic example of local and global extrema: profit model

Quadratic functions are the best examples of finding local and global extrema using calculus because they’re everywhere in economics and physics.

Consider a simplified profit model for a small business:
[
P(q) = -2q^2 + 40q - 100,
]
where \(q\) is the number of units produced and sold per week, and \(P(q)\) is weekly profit in dollars.

Different examples include:

  • Finding the production level that maximizes profit
  • Checking whether that maximum is local, global, or both

Step 1: Derivative
[
P’(q) = -4q + 40.
]
Set it to zero for critical points:
[

-4q + 40 = 0 \Rightarrow q = 10.
]

Step 2: Second derivative test
[
P’’(q) = -4 < 0.
]
Because the second derivative is negative, \(q = 10\) is a local maximum.

For a downward-opening parabola like this (coefficient of \(q^2\) is negative), that local maximum is also the global maximum over all real \(q\). So \(q = 10\) units gives the highest possible profit.

Value at that point:
[
P(10) = -2(100) + 40(10) - 100 = -200 + 400 - 100 = 100.
]

So the business’s best outcome is a profit of $100 when it produces 10 units. This is a very typical example of finding local and global extrema using calculus in an economics or business course.

If you want to see how optimization is used in modern economics and decision-making, the free materials from MIT OpenCourseWare (https://ocw.mit.edu) and Harvard’s math/econ courses (https://math.harvard.edu) show more real examples.

Real examples of local extrema without global extrema

Not every function has a global maximum or minimum on the entire real line. Some of the best examples of this come from polynomials and exponential functions defined on open domains.

Take
[
g(x) = x^3.
]

Derivative:
[
g’(x) = 3x^2.
]

Set \(g’(x) = 0\):
[
3x^2 = 0 \Rightarrow x = 0.
]

Check the behavior:

  • For \(x < 0\), \(g’(x) > 0\) (since \(3x^2 > 0\) for all \(x \neq 0\))
  • For \(x > 0\), \(g’(x) > 0\) as well

The derivative is nonnegative everywhere and only zero at \(x = 0\), but the function never switches from increasing to decreasing or vice versa. So \(x = 0\) is not a local maximum or minimum. In fact, \(g(x)\) has no local extrema, and certainly no global extrema, because:

  • As \(x \to \infty\), \(g(x) \to \infty\)
  • As \(x \to -\infty\), \(g(x) \to -\infty\)

For contrast, look at
[
h(x) = x^3 - 3x.
]

Derivative:
[
h’(x) = 3x^2 - 3 = 3(x^2 - 1).
]

Set \(h’(x) = 0\):
[
x^2 - 1 = 0 \Rightarrow x = \pm 1.
]

Use the second derivative:
[
h’’(x) = 6x.
]

  • At \(x = 1\): \(h’’(1) = 6 > 0\) → local minimum
  • At \(x = -1\): \(h’’(-1) = -6 < 0\) → local maximum

But again, as \(x \to \infty\), \(h(x) \to \infty\), and as \(x \to -\infty\), \(h(x) \to -\infty\). So these are examples of local extrema but not global extrema.

These functions are good real examples to remember: they show that a function can have local extrema without having any global extrema on the entire real line.

Closed-interval examples of global extrema: distance and geometry

Optimization on a closed interval is where calculus really shines in geometry and physics.

Consider the function
[
d(t) = t^2 - 4t + 7, \quad t \in [0, 5],
]
which you can imagine as modeling the squared distance of an object from a reference point over time. In physics, functions like this show up when you model motion with constant acceleration.

Derivative:
[
d’(t) = 2t - 4.
]

Set \(d’(t) = 0\):
[
2t - 4 = 0 \Rightarrow t = 2.
]

Evaluate at critical point and endpoints:

  • \(d(0) = 7\)
  • \(d(2) = 4 - 8 + 7 = 3\)
  • \(d(5) = 25 - 20 + 7 = 12\)

So:

  • Global minimum: 3 at \(t = 2\)
  • Global maximum on [0, 5]: 12 at \(t = 5\)

This is a clean example of finding local and global extrema using calculus on a closed interval: one critical point in the interior, plus checking the endpoints. In real applications, this is how you find the time when an object is closest to a detector or sensor.

If you want to connect this to real motion modeling, the physics resources at Khan Academy (https://www.khanacademy.org) and many university physics departments (for example, https://physics.mit.edu) give more examples.

Applied example: minimizing material for a box (constrained extrema)

Now let’s look at one of the best examples of real-world optimization: designing a container using the least material.

Suppose you want to build an open-top rectangular box with a square base that holds 32 cubic feet of volume. You want to use the smallest possible amount of material, so you want to minimize the surface area.

Let \(x\) be the side length of the square base (in feet), and \(h\) be the height.

Volume constraint:
[
x^2 h = 32 \Rightarrow h = \frac{32}{x^2}.
]

Surface area (no top):
[
A(x) = x^2 + 4xh.
]
Substitute \(h\):
[
A(x) = x^2 + 4x \cdot \frac{32}{x^2} = x^2 + \frac{128}{x}.
]

Domain: \(x > 0\).

Derivative:
[
A’(x) = 2x - \frac{128}{x^2}.
]

Set \(A’(x) = 0\):
[
2x - \frac{128}{x^2} = 0 \Rightarrow 2x = \frac{128}{x^2} \Rightarrow 2x^3 = 128 \Rightarrow x^3 = 64 \Rightarrow x = 4.
]

Second derivative:
[
A’’(x) = 2 + \frac{256}{x^3} > 0 \text{ for } x > 0.
]

So \(x = 4\) gives a local minimum. Because the area blows up as \(x \to 0^+\) or \(x \to \infty\), that local minimum is also a global minimum on the domain \(x > 0\).

Height:
[
h = \frac{32}{4^2} = \frac{32}{16} = 2.
]

This is a classic example of finding local and global extrema using calculus with a constraint, and it shows up in engineering and manufacturing. Real manufacturing optimization today uses the same ideas, just with more variables and sometimes with numerical methods rather than by hand.

Data and 2024–2025 context: why extrema matter in modern modeling

If you’ve heard about machine learning or AI training, you’ve already brushed up against optimization. Training a neural network is basically one massive example of finding a (usually approximate) global minimum of a loss function.

In practice:

  • Local minima correspond to parameter settings where changing the weights slightly makes the loss worse.
  • Global minima are the best settings the algorithm can find, giving the smallest possible loss (on the training set).

Most modern optimization algorithms (gradient descent, Adam, etc.) use the same core idea from your calculus class: follow the derivative. The gradient is just the multi-variable version of the derivative.

If you’re curious about how optimization appears in statistics and modern data analysis, the National Institute of Standards and Technology (NIST) has excellent material on statistical modeling and regression at https://www.itl.nist.gov, and many universities (like Stanford and MIT) share lecture notes on gradient-based optimization.

These aren’t hand-solved examples of finding local and global extrema using calculus, but they are the real examples that today’s technology is built on.

Tricky example: local extrema at endpoints and open intervals

Sometimes the domain itself changes the story. Consider
[
f(x) = \sqrt{x} - x, \quad x \in [0, 1].
]

Derivative (for \(x > 0\)):
[
f’(x) = \frac{1}{2\sqrt{x}} - 1.
]
Set \(f’(x) = 0\):
[
\frac{1}{2\sqrt{x}} - 1 = 0 \Rightarrow \frac{1}{2\sqrt{x}} = 1 \Rightarrow 2\sqrt{x} = 1 \Rightarrow \sqrt{x} = \frac{1}{2} \Rightarrow x = \frac{1}{4}.
]

Now evaluate at \(x = 0\), \(x = \tfrac{1}{4}\), and \(x = 1\):

  • \(f(0) = 0 - 0 = 0\)
  • \(f(\tfrac{1}{4}) = \tfrac{1}{2} - \tfrac{1}{4} = \tfrac{1}{4}\)
  • \(f(1) = 1 - 1 = 0\)

So the global maximum on [0, 1] is \(\tfrac{1}{4}\) at \(x = \tfrac{1}{4}\), and the global minimum is 0, achieved at both \(x = 0\) and \(x = 1\).

Notice that \(x = 0\) is an endpoint where the derivative doesn’t exist in the usual sense, but it still gives a global minimum. This is a good example of why examples of finding local and global extrema using calculus must always include endpoint checks and domain awareness.

For more theory on existence of extrema and continuity, most calculus textbooks and open resources like the University of Texas’s calculus notes (https://www.ma.utexas.edu) explain the Extreme Value Theorem and related ideas.

Summary of patterns in these examples

Across all these examples of finding local and global extrema using calculus, the same pattern keeps showing up:

  • Take the derivative (or gradient in higher dimensions).
  • Solve \(f’(x) = 0\) to get critical points.
  • Use the first or second derivative test to classify local maxima and minima.
  • On closed intervals, always check endpoints for global extrema.
  • On open or infinite domains, think about behavior as \(x \to \pm\infty\) or near boundaries.
  • In constrained problems, express everything in terms of one variable when possible, then repeat the same process.

These are some of the best examples you can study to build intuition. Once you’re comfortable with them, more advanced topics—like Lagrange multipliers, multivariable optimization, and numerical methods—feel like natural extensions rather than brand-new mysteries.


FAQ: examples of local and global extrema in calculus

Q: Can a function have a local maximum that is not a global maximum?
Yes. A classic example of this is \(h(x) = x^3 - 3x\). At \(x = -1\), the function has a local maximum, but as \(x \to \infty\), \(h(x) \to \infty\), so that local maximum is not the global maximum.

Q: Can a function have more than one global minimum?
Yes. In the function \(f(x) = x^3 - 3x^2 + 2\) on the interval [-1, 4], the smallest value is -2, which occurs at both \(x = -1\) and \(x = 2\). These are two different points that share the same global minimum value.

Q: What is an easy example of a function with no local extrema?
The function \(g(x) = x^3\) is a standard example of a function with no local maxima or minima. Its derivative is always nonnegative and never changes sign around any point in a way that would create a local extremum.

Q: In real life, where do examples of global maxima and minima appear?
Real examples include maximizing profit, minimizing cost, maximizing the range of a projectile in physics, minimizing fuel use in transportation, and optimizing medical dosages in pharmacology. Many health and medical optimization problems, such as dosing ranges, are discussed by organizations like the National Institutes of Health (https://www.nih.gov) and Mayo Clinic (https://www.mayoclinic.org), often relying on underlying calculus-based models.

Q: Are local minima always useful in optimization algorithms?
In many high-dimensional problems (like training neural networks), algorithms often end up in local minima or flat regions rather than guaranteed global minima. Surprisingly, modern research (2010s–2020s) shows that many of these local minima perform well enough in practice. So even though they are not global minima in the strict calculus sense, they can still be very useful solutions.

Explore More Calculus Problem Solving

Discover more examples and insights in this category.

View All Calculus Problem Solving