Maximum and Minimum of a Function

The maximum and minimum of a function are points within an interval $ x \in [a, b] $ at which the function $ y = f(x) $ attains its greatest and least values, respectively.

These extrema may be either absolute or relative:

  • Absolute maximum or minimum: The point at which $ f(x) $ achieves its largest or smallest value over the entire interval $ [a, b] $.
  • Relative (local) maximum or minimum: A point where $ f(x) $ achieves a largest or smallest value within some neighborhood of $ x_0 $.

Example

example of absolute and relative maximum and minimum

At $ x_1 $, the function $ f(x) $ attains an absolute maximum on $ [a, b] $, and at $ x_2 $ it attains an absolute minimum.

At $ x_3 $ and $ x_4 $, the function has only a relative (local) maximum and minimum, respectively.

Note: An absolute maximum (or minimum) on $ [a, b] $ is, by definition, also a relative maximum (or minimum) in any neighborhood of that point. Thus, $ x_1 $ is both an absolute and a relative maximum, while $ x_2 $ is both an absolute and a relative minimum.

Absolute Maxima and Minima

Absolute Maximum

Let \( y=f(x) \) be a function defined on an interval \( I \). The value \( M=f(x_0) \), where \( x_0 \in I \), is called the absolute maximum of the function on \( I \) if \[ f(x_0) \ge f(x) \qquad \forall x \in I \]

Simply put, \( f(x_0) \) is the absolute maximum if it is the largest value the function takes anywhere on the interval \( I \).

If an absolute maximum exists, it is represented on the Cartesian graph by the point \( (x_0,M) \), where \( M=f(x_0) \).

Absolute Minimum

Let \( y=f(x) \) be a function defined on an interval \( I \). The value \( m=f(x_0) \), where \( x_0 \in I \), is called the absolute minimum of the function on \( I \) if \[ f(x_0) \le f(x) \qquad \forall x \in I \]

Likewise, \( f(x_0) \) is the absolute minimum if it is the smallest value the function takes anywhere on the interval \( I \).

If an absolute minimum exists, it is represented on the Cartesian plane by the point \( (x_0,m) \), where \( m=f(x_0) \).

Note. Whether a function has an absolute maximum or an absolute minimum depends both on the function itself and on the domain over which it is defined.

Example

Consider the function

\[ y=x^2+1 \]

Over its entire domain \( I=\mathbb{R} \), the function has an absolute minimum at \( x=0 \), because

\[ f(0)=1 \]

However, it does not have an absolute maximum. As the absolute value of \( x \) increases, the function grows without bound.

Example of a function with an absolute minimum and no absolute maximum

Now restrict the domain to the closed interval \( I=[1,3] \). On this interval, the function has both an absolute minimum and an absolute maximum.

Since the function is increasing for every \( x \ge 0 \), the smallest value occurs at the left endpoint of the interval, while the largest value occurs at the right endpoint:

\[ f(1)=2 \qquad \text{(absolute minimum)} \] \[ f(3)=10 \qquad \text{(absolute maximum)} \]

Therefore, on the interval \( [1,3] \), the absolute minimum is \(2\) and the absolute maximum is \(10\).

Example of an absolute minimum and an absolute maximum on a closed interval

Relative Maximum and Minimum

Consider a point $$ x_0 $$ and examine all points within a neighborhood of radius $ \delta $ about $ x_0 $:

$$ |x - x_0| < \delta $$

If $ f(x_0) $ exceeds all nearby values of $ f(x) $, then $ x_0 $ is a relative maximum:

$$ f(x_0) > f(x) $$

For example:

example of a relative maximum

Conversely, if $ f(x_0) $ is smaller than all nearby values of $ f(x) $, then $ x_0 $ is a relative minimum:

$$ f(x_0) < f(x) $$

For example:

example of a relative minimum

Note: For relative extrema, the inequality (greater than or less than) holds only within some neighborhood of $x_0 $. It need not hold over the entire interval $ [a, b] $ where the function is defined.

Finding Relative Maxima and Minima Using Derivatives

For a differentiable function, relative maxima and minima that occur at interior points of the domain must first be sought among the stationary points. These are the points \(x\) where the first derivative is zero.

$$ f'(x)=0 $$

This simple condition gives us a useful starting point for identifying possible relative maxima and minima. However, as we will see, finding where the derivative is zero is only the first step.

Fermat's Theorem on Stationary Points

Let \(f(x)\) be a function defined on the interval \([a,b]\) and differentiable on the open interval \((a,b)\). If \(f\) has a relative maximum or relative minimum at an interior point \(x_0\), then $$ f'(x_0)=0 $$

In other words, if \(f\) has a relative maximum or minimum at \(x_0\), and the function is differentiable there, then \(x_0\) must be a stationary point.

Two conditions are essential: \(x_0\) must be an interior point of the interval, and the function must be differentiable at that point.

Note. Fermat's theorem gives us a necessary condition, not a sufficient one. This means that not every stationary point is a relative maximum or minimum. For example, a stationary point may be a point of inflection with a horizontal tangent. Conversely, a maximum or minimum does not always occur at a stationary point. It may occur at a point where the function is not differentiable or at an endpoint of the interval of definition. Therefore, the condition $f'(x_0)=0$ is necessary only when the relative maximum or minimum occurs at an interior point and the function is differentiable there.

Example

Consider the function

$$ f(x)=x^2 $$

This function is differentiable for all real numbers. Its first derivative is

$$ f'(x)=2x $$

To find the stationary points, set the first derivative equal to zero:

$$ 2x = 0 $$

This equation gives

$$ x=0 $$

So \(x=0\) is a stationary point.

Looking at the graph of \(f(x)=x^2\), we can see that the function decreases as \(x\) approaches zero from the left and increases after passing through zero. Therefore, \(f\) has a relative minimum at \(x=0\).

example of a relative minimum

Proof of Fermat's Theorem

To understand why the theorem works, consider the case in which \(f\) has a relative maximum at \(x_0\).

By definition, in a sufficiently small neighborhood of \(x_0\), the values of the function cannot exceed \(f(x_0)\). Therefore, for every \(x\) sufficiently close to \(x_0\),

$$ f(x)\leq f(x_0) $$

A point near \(x_0\) can be written as

$$ x=x_0+h $$

so we have

$$ f(x_0+h)\leq f(x_0) $$

and therefore

$$ f(x_0+h)-f(x_0)\leq 0 $$

Now we need to consider what happens on the two sides of \(x_0\).

1] To the right of the maximum point

If \(h>0\), dividing by \(h\) does not reverse the inequality:

$$ \frac{f(x_0+h)-f(x_0)}{h}\leq 0 $$

Taking the limit as \(h\to 0^+\), we obtain

$$ \lim_{h\to 0^+}\frac{f(x_0+h)-f(x_0)}{h}\leq 0 $$

So the right-hand derivative is less than or equal to zero.

2] To the left of the maximum point

If \(h<0\), dividing by a negative number reverses the inequality:

$$ \frac{f(x_0+h)-f(x_0)}{h}\geq 0 $$

Taking the limit as \(h\to 0^-\), we obtain

$$ \lim_{h\to 0^-}\frac{f(x_0+h)-f(x_0)}{h}\geq 0 $$

So the left-hand derivative is greater than or equal to zero.

3] Conclusion

Since \(f\) is differentiable at \(x_0\), the right-hand and left-hand derivatives must exist and be equal. Therefore, we must have both

$$ f'(x_0)\leq 0 $$

and

$$ f'(x_0)\geq 0 $$

The only value that satisfies both inequalities is zero:

$$ f'(x_0)=0 $$

The same argument applies when \(f\) has a relative minimum at \(x_0\).

Geometric Interpretation

The geometric meaning of Fermat's theorem is straightforward. The derivative \(f'(x_0)\) gives the slope of the tangent line to the graph of the function at \(x_0\).

If $ f'(x_0)=0 $, the slope of the tangent line is zero:

$$ m=0 $$

Therefore, the tangent line is parallel to the x-axis.
horizontal tangent at a stationary point

This is why an interior relative maximum or minimum of a differentiable function has a horizontal tangent.

A Necessary but Not Sufficient Condition

There is an important distinction to keep in mind: the condition

$$ f'(x_0)=0 $$

is necessary under the assumptions of Fermat's theorem, but it is not sufficient to conclude that \(f\) has a relative maximum or minimum at \(x_0\).

In practical terms:

  • if \(f\) has a relative maximum or minimum at an interior point and is differentiable there, then the derivative must be zero at that point;
  • if the derivative is zero at a point, the function does not necessarily have a maximum or minimum there.

A Practical Example

Consider the function

$$ f(x)=x^3 $$

Its first derivative is

$$ f'(x)=3x^2 $$

To find the stationary points, set the derivative equal to zero:

$$ 3x^2=0 $$

which gives

$$ x=0 $$

Therefore, \(x=0\) is a stationary point.

However, the first derivative \(3x^2\) is positive for both \(x<0\) and \(x>0\), except at \(x=0\):

$$ 3x^2>0 $$

The function \(f(x)=x^3\) is therefore increasing both to the left and to the right of \(x=0\).

As a result, \(f\) has neither a relative maximum nor a relative minimum at \(x=0\).

The point is stationary because the derivative is zero there, but the function continues to increase as it passes through the point.

This example clearly shows why the condition $f'(x_0)=0$ alone is not sufficient to identify a relative extremum.

stationary point of inflection

Identifying Relative Maxima and Minima Using the Sign of the Derivative

One of the most useful ways to determine the nature of a stationary point is to examine the sign of the first derivative on either side of it.

If the derivative changes from positive to negative,

$$ f'(x)>0 \quad\longrightarrow\quad f'(x)<0 $$

the function is increasing before the point and decreasing after it. Therefore, the function has a relative maximum at that point.

If the derivative changes from negative to positive,

$$ f'(x)<0 \quad\longrightarrow\quad f'(x)>0 $$

the function is decreasing before the point and increasing after it. Therefore, the function has a relative minimum at that point.

If the derivative has the same sign on both sides of the stationary point, the function does not have a relative extremum there.

Consider again the function \(f(x)=x^3\). Its first derivative is \(f'(x)=3x^2\). The derivative is positive on both sides of \(x=0\). $$ f'(x)>0 \qquad x<0 $$ $$ f'(x)>0 \qquad x>0 $$ Since there is no change in sign, the function is increasing throughout a neighborhood of \(x=0\). Therefore, \(f\) has neither a local minimum nor a local maximum at \(x=0\).

What Happens at the Endpoints of the Interval?

Fermat's theorem applies only to interior points of an interval. An endpoint, however, may still be a maximum or minimum even when the derivative is not zero.

For example, consider the function

$$ f(x)=2x-1 $$

on the interval

$$ [1,3] $$

The derivative is

$$ f'(x)=2 $$

Since \(f'(x)>0\) for every \(x\), the function is increasing throughout the interval. The derivative is never zero.

At the left endpoint,

$$ f(1)=1 $$

while at the right endpoint,

$$ f(3)=5 $$

Therefore, \(f(1)=1\) is the minimum value of the function on \([1,3]\), while \(f(3)=5\) is its maximum value.

maximum and minimum values at the endpoints of an interval

Thus, \(x=1\) and \(x=3\) are, respectively, the points where the absolute minimum and absolute maximum on the interval \([1,3]\) are attained, even though

$$ f'(1)=f'(3)=2\neq 0 $$

There is no contradiction with Fermat's theorem because \(1\) and \(3\) are endpoints of the interval, not interior points.

Points Where the Function Is Not Differentiable

A relative maximum or minimum can also occur at a point where the derivative does not exist.

A classic example is the absolute value function:

$$ f(x)=|x| $$

This function has both a relative and an absolute minimum at \(x=0\), since

$$ |x|\geq 0 $$

for every \(x\).

However, the graph has a corner at \(x=0\), so the function is not differentiable there.

minimum point where the function is not differentiable

In fact, the left-hand and right-hand derivatives at \(x=0\) are different:

$$ f'_-(0)=-1 \qquad f'_+(0)=1 $$

Therefore, when looking for maxima and minima, we must also consider points in the domain where the function is continuous but not differentiable.

How Do You Find Possible Maximum and Minimum Points?

To summarize, suppose \(f(x)\) is defined on an interval \([a,b]\). When looking for possible maximum and minimum points, there are three main categories of points to consider:

  1. Stationary points, where

    $$ f'(x)=0 $$
  2. The endpoints of the interval

    $$ x=a \qquad\text{and}\qquad x=b $$
  3. Points where the function is not differentiable, provided they belong to the domain of the function.

These are the candidate points where the function may have a maximum or minimum. Finding them, however, does not complete the analysis.

Once the candidates have been identified, we still need to determine what happens near each point. One of the most effective methods is to examine the sign of the first derivative and determine whether the function changes from increasing to decreasing, from decreasing to increasing, or continues with the same monotonic behavior.

In other words, solving $ f'(x)=0 $ does not automatically give us the maxima and minima of a function. It gives us the stationary points, which are only some of the points that need to be examined. The next step is to study the behavior of the function around each candidate point and determine whether it changes from increasing to decreasing, from decreasing to increasing, or continues in the same direction.

First Derivative Test

Let \(y=f(x)\) be a function defined and continuous on an open interval containing a point \(x_0\), and differentiable throughout that interval except possibly at \(x_0\). To determine whether \(f\) has a local maximum or local minimum at \(x_0\), we can examine the sign of the first derivative \(f'(x)\) on either side of \(x_0\).

  • If \(f'(x)\) changes from positive to negative as \(x\) passes through \(x_0\), then \(f\) has a local maximum at \(x_0\).
  • If \(f'(x)\) changes from negative to positive as \(x\) passes through \(x_0\), then \(f\) has a local minimum at \(x_0\).
  • If \(f'(x)\) has the same sign on both sides of \(x_0\), then \(f\) has neither a local minimum nor a local maximum at \(x_0\).

The First Derivative Test provides a simple way to identify local extrema. The key is to look at whether the function is increasing or decreasing before and after the point under consideration.

Let's examine the three possible cases.

  • Local maximum
    If \(  f'(x)>0 \) for \( x<x_0 \) and \( f'(x)<0 \) for \( x>x_0 \), then \(f\) has a local maximum at \(x_0\). To the left of \(x_0\), the derivative is positive, so the function is increasing. To the right of \(x_0\), the derivative is negative, so the function is decreasing. In other words, the function rises before \(x_0\) and falls after it. Therefore, \(f(x_0)\) is a local maximum value.
    example of a local maximum
  • Local minimum
    If \( f'(x)<0 \) for \(x<x_0 \) and \( f'(x)>0 \) for \( x>x_0 \), then \(f\) has a local minimum at \(x_0\). To the left of \(x_0\), the derivative is negative, so the function is decreasing. To the right of \(x_0\), the derivative is positive, so the function is increasing. In other words, the function falls before \(x_0\) and rises after it. Therefore, \(f(x_0)\) is a local minimum value.
    example of a local minimum
  • Neither a local minimum nor a local maximum
    If the derivative has the same sign on both sides of \(x_0\), then \(f\) has neither a local maximum nor a local minimum at \(x_0\). For example, if \( f'(x)>0 \) both to the left and to the right of \(x_0\), the function keeps increasing as \(x\) passes through the point. Similarly, if \(f'(x)<0\) on both sides, the function keeps decreasing. In some cases, \(x_0\) may be an inflection point, but the First Derivative Test alone is not enough to determine whether it is one. 
    example of an inflection point

The important point is that a local extremum is not determined simply by the condition \(f'(x_0)=0\). What matters in the First Derivative Test is how the sign of \(f'(x)\) changes as \(x\) passes through \(x_0\).

Example

Consider the function

\[ f(x)=x^2 \]

Its derivative is

\[ f'(x)=2x \]

For \(x<0\),

\[ f'(x)<0 \]

while for \(x>0\),

\[ f'(x)>0 \]

As \(x\) passes through \(x_0=0\), the derivative changes from negative to positive. This means that the function decreases before \(x=0\) and increases after \(x=0\).

Therefore, \(f\) has a local minimum at \(x_0=0\). In this particular case, \(f(0)=0\) is also the absolute minimum of the function.

example of the First Derivative Test

Note. The First Derivative Test provides a sufficient but not necessary condition for identifying a local maximum or local minimum when the test is stated in terms of a strict sign change in \(f'(x)\). Local extrema can also occur without such a change. For example, if a function is constant on an interval, then \(f'(x)=0\) throughout that interval. Under the standard non-strict definitions of local extrema, every interior point of the interval is both a local maximum and a local minimum. The strict sign-change version of the test does not identify these extrema because the derivative does not change from positive to negative or from negative to positive around those points.
example of a constant function with local extrema

Second Derivative Test

Suppose a function \(y=f(x)\) has a continuous second derivative on an open interval containing a point \(x_0\). If the first derivative is zero at that point \[f'(x_0)=0\] I can use the second derivative to distinguish three cases:

  • If \(f''(x_0)>0\), the function has a local minimum at \(x_0\).
  • If \(f''(x_0)<0\), the function has a local maximum at \(x_0\).
  • If \(f''(x_0)=0\), the test is inconclusive. The point could be a local maximum, a local minimum, or a stationary inflection point.

The second derivative test helps me determine whether a stationary point is a local maximum or minimum by checking the sign of the second derivative.

However, the test provides a sufficient but not necessary condition for identifying local extrema.

This means a function can have local maxima or minima even when the second derivative test is inconclusive. In those cases, I need another method, such as the first derivative test or the higher derivative test.

Example

Consider the function

\[f(x)=x^2-4x+3\]

First, I calculate the first derivative.

\[f'(x)=2x-4\]

To find the stationary points, I set the first derivative equal to zero.

\[2x-4=0\]

Solving for \(x\), I get

\[x=2\]

Next, I calculate the second derivative.

\[f''(x)=2\]

At the stationary point \(x=2\), the second derivative is positive.

\[f''(2)=2>0\]

According to the second derivative test, the function therefore has a local minimum at \(x=2\).

Now I evaluate the function at this point.

\[f(2)=2^2-4(2)+3=-1\]

The local minimum occurs at \((2,-1)\) on the graph. In this case, it is also an absolute minimum.

Graph illustrating the second derivative test and the local minimum at (2, -1)

Higher Derivative Test

The higher derivative test applies when a function \(y=f(x)\) has continuous derivatives through order \(n\) on an open interval, and all derivatives of order less than \(n\) are zero at an interior point \(x_0\):

\[ f'(x_0)=f''(x_0)=\cdots=f^{(n-1)}(x_0)=0 \]

If the \(n\)th derivative, where \(n\geq 2\), is nonzero

\[ f^{(n)}(x_0)\neq 0 \]

I can classify the stationary point by looking at the order and sign of the first nonzero derivative:

  • If \(n\) is even, the function has a local maximum at \(x_0\) when \(f^{(n)}(x_0)<0\), and a local minimum when \(f^{(n)}(x_0)>0\).
  • If \(n\) is odd, the graph has a stationary inflection point at \(x_0\). The function is decreasing through the point when \(f^{(n)}(x_0)<0\), and increasing through the point when \(f^{(n)}(x_0)>0\).

This test is especially useful when both the first and second derivatives are zero at a stationary point, so the second derivative test cannot determine whether the function has a local maximum or minimum.

Example

Consider the function

\[ f(x)=x^6 \]

First, I calculate the first derivative.

\[ f'(x)=6x^5 \]

The first derivative is zero at \(x_0=0\), so this is a stationary point.

Next, I calculate the higher-order derivatives.

\[ \begin{aligned} f''(x)&=30x^4\\ f'''(x)&=120x^3\\ f^{(4)}(x)&=360x^2\\ f^{(5)}(x)&=720x\\ f^{(6)}(x)&=720 \end{aligned} \]

At \(x_0=0\), the first five derivatives are all zero.

\[ f'(0)=f''(0)=\cdots=f^{(5)}(0)=0 \]

The sixth derivative, however, is positive and nonzero.

\[ f^{(6)}(0)=720>0 \]

Since the first nonzero derivative is of even order and is positive, I can conclude that the function has a local minimum at \(x_0=0\).

Graph of f(x) = x^6 illustrating the higher derivative test and the minimum at x = 0

In this example, the second derivative test is inconclusive because \(f''(0)=0\). I need to continue differentiating until I reach the sixth derivative, which confirms that the stationary point is a local minimum.

Notes

The following theorem is one of the most important results concerning absolute maxima and minima.

  • Extreme Value Theorem
    If a function \( f(x) \) is continuous on a closed and bounded interval \( [a,b] \), then it always attains both an absolute maximum and an absolute minimum on that interval. \[ \exists \, x_M, x_m \in [a,b] \; \text{such that} \; f(x_m) \le f(x) \le f(x_M) \qquad \forall x \in [a,b] \] In other words, there are points \( x_m \) and \( x_M \) in the interval where the function reaches its smallest and largest values, respectively.

And so on.

 
 

Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

FacebookTwitterLinkedinLinkedin
knowledge base

Functions

Mathematical Analysis

More Topics

Functions of Two Variables