Maxima and Minima: Definition, Types and Tests

Maxima and Minima: Definition, Types and Tests

10 mins read4.3K Views Comment
Vikram
Vikram Singh
Assistant Manager - Content
Updated on Sep 15, 2023 17:54 IST

Maxima and minima are the extrema value of any function, i.e., the maximum (highest) and the minimum (lowest) value of any function within the defined range. In this article, we will discuss what is maxima and minima, its types and the test (first and second order) to find them.

2022_12_MicrosoftTeams-image-107-1.jpg

In any machine learning algorithm, the intuition is to optimize the model’s performance, specifically the cost or the loss function. Optimization problems consist of many local minima and local maxima points, so to find the best optimum point (or solution), one must have to understand maxima and minima (local maxima/local minima/global maxima, and global minima).
This article will briefly discuss maxima and minima, their formula, and finally, steps to calculate the maxima and minima.

Table of Content

Recommended online courses

Best-suited Data Science courses for you

Learn Data Science with these high-rated online courses

1.18 L
12 months
80 K
4 months
2.5 L
2 years
90 K
24 months
2.5 L
2 years
Free
4 weeks
1.24 L
48 months

What is Maxima and Minima?

Maxima and minima are the extrema value of any function, i.e., the maximum (highest) and the minimum (lowest) value of any function within the defined range. For a given function, there can be many minimum points and maximum points, but there will be one and only one absolute maxima and minima points, and these points can be determined using the derivatives of a function.
Let’s have a look at the below graph:

2022_12_image-138.jpg

The above graph shows three local maxima points, three local minima points, and one saddle point. We will discuss the saddle point later in the section.

But one thing is common in all the points that we got maxima, minima, or saddle points, where the slope of the curve is zero. So, how do we find where the slope of the curve is zero?

The answer to the above question is Derivative; we will use derivative to find the maxima or minima points.

But before that, let’s first discuss the types of Maxima and Minima.

Types of Maxima and Minima

There are two types of Maxima and Minima:

Local Minima and Local Maxima

A function has many local maxima and local minima values, with every peak and valley in the curve of the function. These values are the maximum and minimum values of the function in a particular interval.

Local Minima:

A point x = a is said to be the point of local minima if the value of the function at this point is the lowest value around its neighbor.

In simple terms, if we consider a small interval around x = a, the function will obtain its minimum value in this interval.

Mathematically,

A function f(x) has a local minimum at x = a if there exists an open interval I (such that I is contained in the domain of f(x)) containing a, and 

f(a) <= f(x), for all x in I.

Local Maxima

Similar to local minima, A point x = b is said to be the point of local maxima if the value of the function at this point is the maximum value around its neighbor.

In simple terms, if we consider a small interval around x = b, the function will obtain its maximum value in this interval.

Mathematically

A function f(x) has a local maximum at x = b if there exists an open interval I (such that I is contained in the domain of f(x)) containing b, and 

f(x) <= f(b), for all x in I.

What is Programming What is Python
What is Data Science What is Machine Learning

Global Minima and Global Maxima

Global Minima

The point within the entire domain at which the function obtains its lowest value is known as the global minimum of the function.

  • There can be one and only one global minimum of a function.
  • It is the lowest local minimum value among all.
    • i.e., x = a, is a point of global minima, if and only if f(a) <= f(x) for all x in the domain of f(x).

Global Maxima

Similar to global minima, the point within the entire domain at which the function obtains its highest value is known as the global maxima of the function.

  • There can be one and only one global maxima of a function.
  • It is the highest local maximum value among all.
    • i.e., x = b is a point of global minima if and only if f(x) <= f(b) for all x in the domain of f(x).

Confused!!

Let’s take an example that will clear all your doubts.

2022_12_image-139.jpg

Here, we have considered the same graph as above. Now, let’s have a close look at the above curve; local maxima exist at every peak of the curve (i.e., x = b, x = d, and x = f), and local minima exist at every valley of the curve (i.e., x = a, x = c, and x = e). The curve obtains its minimum value at x = a, and maximum value at x = b. So, they are the point of global minima and point of global maxima, respectively.

Programming Online Courses and Certification Python Online Courses and Certifications
Data Science Online Courses and Certifications Machine Learning Online Courses and Certifications

How to Find Maxima and Minima

Till now, we have used the curve to describe the maxima and minima, but it will not always be easy to plot the curve, so in that case, use different tests to find the maxima and minima of a function. 

Before discussing the test, let’s discuss the critical points.

In the beginning, we have seen that points of local maxima and local minima exist where the derivative or the slope of the function is zero; this is a critical point.

Critical Point:

Let x = a in the domain of f(x), then c is called the critical point of f(x) if either f’(a) = 0 or f’(a) is undefined.

  • It may be possible that x = a is a critical point of a function, but there don’t exist maxima or minima at that point, but the converse is not true.
    • i.e., if the function f(x) has a local extremum (minima or maxima) at x = a and f(x) is differentiable at x = a, then f’(a) = 0.
      • This above fact is known as Fermat Theorem.

First Order Derivative Test

Let f(x) be a differentiable function and x = a be any critical point, and if f’(x) changes from :

  • Positive to negative at x = a, then f(a) is a local maximum
  • Negative to positive at x = a, then f (a) is a local minimum.
  • If f’(x) doesn’t change its sign at x = a, then f(a) is neither local maxima nor local minima.
    • This is known as a Saddle Point: A critical point that is neither a local maximum nor a local minimum.

Example: Find the point of maxima and minima of f(x) = (⅓) x^3  – (5/2) x^2 + 4x using the first-order derivative test.

Answer: Here f(x) = (⅓) x3  – (5/2) x2 + 4x

Firstly we will find the critical point, i.e., find the derivative of f(x) and put it equal to zero.

Differentiating f(x) with respect to x, we get:

f’(x) = (⅓)(3) x(3 -1) – (5/2)(2) x(2-1) + 4(1)x(1-1)

=> f’(x) = x2 – 5x + 4 = x2 – 4x -x + 4 = (x-4)(x-1)

=>f’(x) = (x-4)(x-1)

Now, put f’(x) = 0

=> (x-4)(x-1) = 0

=> x = 1, 4

Therefore, the critical point of f(x) are x = 1 and x = 4

Hence, we have three intervals (-inf, 1), (1, 4), and (4, inf).

Now, let’s pick up three points (one from each interval) to check whether the values of f(x) are positive or negative.

  • Case – 1: 0 in (-inf, 1)

f’(0) = (0-4)(0-1) = (-4)(-1) = 4

=> f’(0) > 0 

  • Case – 2:  2 in (1, 4)

f’(2) = (2-4)(2-1) = (-2)(1) = -2

=> f’(2) < -0

  • Case – 3: 5 in (4, inf)

f’(5) = (5-4)(5-1) = (1)(4) = 5

=> f’(5) > 0 

From the above three cases, we get f’(x) changes from :

  • Positive to negative at x = 1, hence x = 1 is a point of maxima
  • Negative to positive at x = 4, hence x = 4 is a point of minima

This is quite a hectic and lengthy calculation, but don’t worry; the second-order derivative test makes the calculation and process very easy.

Second Order Derivative Test

It is also used to find the maxima and minima. Similar to the first-order derivative test, we first have to find the critical points of f(x) and then differentiate f’(x) with respect to x again.

Let x =  a be a critical point of f(x), then

  • Local Minima: if f’’(a) > 0
  • Local Maxima: if f’’(a) < 0
  • Test Fails: if f’’(a) = 0

Note: The second derivative test can be applied only if f’(x) is differentiable; otherwise, not.

Now, take the same above example f(x) = (⅓) x3  – (5/2) x2 + 4x, here the critical points are x = 1, and x = 4.

Since f(x) is a polynomial function, it is n-times differentiable.

Differentiating f’(x) with respect to x, we get

d/dx (f’(x)) = d/dx ( x25x + 4) = 2x(2-1) – 5(1)x(1-1) = 2x – 5

=> f’’(x) = 2x – 5

Now, substituting the values x = 1 and x = 4 in f’’(x) we get:

f’’(1) = 2(1) – 5 = 2 – 5 = -3 => f’’(1) = -3

f’’(4) = 2(4) – 5 = 8 – 5 = 3 => f’’(4) = 3

Therefore, from second order derivative test, we get

x = 1 is a point of local maxima, and x = 4 is a point of local minima.

Conclusion

In this article, we have briefly discussed maxima and minima, types of maxima and minima, and the test to find them.

Hope you will like the article.

Top Trending Article

Top Online Python Compiler | How to Check if a Python String is Palindrome | Feature Selection Technique | Conditional Statement in Python | How to Find Armstrong Number in Python | Data Types in Python | How to Find Second Occurrence of Sub-String in Python String | For Loop in Python |Prime Number | Inheritance in Python | Validating Password using Python Regex | Python List |Market Basket Analysis in Python | Python Dictionary | Python While Loop | Python Split Function | Rock Paper Scissor Game in Python | Python String | How to Generate Random Number in Python | Python Program to Check Leap Year | Slicing in Python

Interview Questions

Data Science Interview Questions | Machine Learning Interview Questions | Statistics Interview Question | Coding Interview Questions | SQL Interview Questions | SQL Query Interview Questions | Data Engineering Interview Questions | Data Structure Interview Questions | Database Interview Questions | Data Modeling Interview Questions | Deep Learning Interview Questions |

FAQs

What is Maxima and Minima?

Maxima and minima are the extrema value of any function, i.e., the maximum (highest) and the minimum (lowest) value of any function within the defined range. For a given function, there can be many minimum points and maximum points, but there will be one and only one absolute maxima and minima points, and these points can be determined using the derivatives of a function.

What are the different types of Maxima and Minima?

Maxima and Minima people are broadly classified into Local Maxima, Local Minima, Global Maxima, and Global Minima.

What is Local Maxima and Local Minima?

Local Minima: A point x = a is said to be the point of local minima if the value of the function at this point is the lowest value around its neighbor. In simple terms, if we consider a small interval around x = a, the function will obtain its minimum value in this interval. Local Maxima: Similar to local minima, A point x = b is said to be the point of local maxima if the value of the function at this point is the maximum value around its neighbor. In simple terms, if we consider a small interval around x = b, the function will obtain its maximum value in this interval.

What is Global Maxima and Global Minima?

Global Minima: The point within the entire domain at which the function obtains its lowest value is known as the global minimum of the function. Global Maxima: Similar to global minima, the point within the entire domain at which the function obtains its highest value is known as the global maxima of the function.

About the Author
author-image
Vikram Singh
Assistant Manager - Content

Vikram has a Postgraduate degree in Applied Mathematics, with a keen interest in Data Science and Machine Learning. He has experience of 2+ years in content creation in Mathematics, Statistics, Data Science, and Mac... Read Full Bio