# Function Minima and Maxima

## Prerequisites

### Function Minima and Maxima

#### Introduction

• Given a function:
• We can draw it as a graph:
• We see that the graph has two turning points:
• These are called the local minima and maxima.
• They are the points at which the function reaches a minimum or maximum.
• They are also called the "turning points" of the function.

#### Finding the minima and maxima

• First we find the derivative of the function:
• If we plot this on the same graph:
• The blue line is our original function.
• The red line is it's derivative.
• We see that at the minima and maxima, the derivative is 0.
• The derivative is the gradient of the function.
• At the turning points, the gradient is 0.
• The points where the function is 0 are called the functions roots:
• x = -1.215... x = 0.549...
• Finding the roots of a function is a huge subject that I wont cover here.
• Finally, we can use these x values in our original equation to find the coordinates: `(-1.215, 2.113), (0.549, -0.631)`

#### Checking if it's minimum or maximum

• Given the location of a turning point, we can determine if it's a minimum or maximum.
• to start, we calculate the second derivative of the function:
• And graphing it:
• The blue line is our original equation.
• The red line is the first derivative.
• The green line is the second derivative.
• For our turning point at (-1.215, 2.113)
• It's a maximum.
• The derivative goes from positive to negative.
• It's derivative's gradient (second derivative) is -5.29 (at x = -1.215)
• for our turning point at (0.549, -0.631)
• It's a minimum.
• The derivative goes from negative to positive.
• It's derivative's gradient (second derivative) is 5.294 (at x = 0.549)
• We can therefore create the rule:
• If the second derivative is negative at x then the turning point is a maximum.
• If the second derivative is positive at x then the turning point is a minumum.