14 Optimisation
Optimisation finds the biggest or smallest values of a function. This is often used to solve real world problems, for example:
- optimise profits by finding a maximum of a profit function
- optimise a journey cost by finding minimum fuel use
Brace yourself! The questions here are long and multi-stepped. Take your time, have a coffee and be kind to yourself.
14.1 The process of optimisation
The largest or smallest values of a function can be found either at it’s turning points or at it’s extreme values. At the turning point of a function it’s gradient will be zero, imagine walking to the top of a hill, once you get to the top you can’t go any higher and the hill levels out, it’s gradient is zero. The extreme values of a function also need to be checked since the gradient might not be zero here but it could be a maximum or minimum value.
- Global maximum - the largest value in the whole function
- Global minimum - the smallest value in the whole function
- Local maximum - the largest value in that neighbourhood of the function
- Local minimum - the smallest value in that neighbourhood of the function
14.2 Classifying turning points - critical points
Sometimes it’s not easy to sketch the function you are working with and you need to find a way to classify your turning points (sometimes called critical points).
We can classify the turning points by looking at the values of the first and second dervatives, \(f'(x)\) and \(f''(x)\). The graph below shows \(f(x)\), \(f'(x)\) and \(f''(x)\) all plotted on the same axes. As you move the point notice how when \(f(x)\) is at it’s maximum, \(f'(x) = 0\) and \(f''(x) < 0\). The three different lines are as follows: \(f(x)\) is solid red, \(f'(x)\) is dashed blue and \(f''(x)\) is dotty and green. There is a lot going on in the graph below but it’s worth taking some time to play with the points to see what is going on.
We can summarise this in a table:
critical point | \(f(x)\) | \(f'(x)\) | \(f''(x)\) |
---|---|---|---|
minimum | smallest value | \(0\) | \(f''(x) > 0\) |
maximum | largest value | \(0\) | \(f''(x) < 0\) |
Sometimes you might get a values of \(f'(x) = 0\) which doesn’t correspond to a maximum or a minimum. These are a type of inflection point and can be identified by noticing that \(f''(x)=0\) at this point. Inflection points happen when the bend of the curve changes from upwards to downwards. Mathematically speaking we say going from concave to convex.
14.3 Example - finding and classifying critical points
We can use this information to classify critical points. For example let’s find and classify the critical points of:
\[ y=2x^3 - 4^2 + 2 \]
First we need to find the points where \(\frac{dy}{dx} = 0\) (remember \(f'(x)\) and \(\frac{dy}{dx}\) mean the same thing). So differentiating \(y=2x^3 - 4x^2 + 2\) we have:
\[ \frac{dy}{dx} = 6x^2 -8x \] Setting \(\frac{dy}{dx} = 0\) and solving we have:
\[ \begin{aligned} \frac{dy}{dx} &= 6x^2 -8x \\ 0 &= 6x^2 -8x \\ &= 2x(3x-4) \end{aligned} \]
Now either \(2x=0\) or \(3x-4 =0\). Solving these two equations we get that \(x\) is equal to either to \(0\) or \(\frac{4}{3}\).
Have a go at this quesiton on classifying critical points.
14.4 Solving optomisation problems.
We can put all this together to solve problems. Warning This is a long question with many steps. You might want to check your knowledge of the chain and quotient rule before you start.
14.4.1 Worked example
Production cost can be modelled with the equation \(y = 3 - \frac{(x + 3)^{2}}{x}\) in the interval \(0 < x < 8\) where \(y\) is cost and \(x\) is number of units produced.
Find the minimum cost and verify that it is a minimum using differentiation. There is a minimum point at \((x, y)\).
14.4.2 Solution
Since the function is of the form \(y = \frac{u(x)}{v(x)}\), we want to use the quotient rule to calculate the derivative \(\frac{dy}{dx}\).
As \(y = 3 - \frac{(x + 3)^{2}}{x},\)
let \(u(x) = (x + 3)^{2}\) and \(v(x) = - x\).
Next, we need to find the derivatives, \(\frac{du}{dx}\) and \(\frac{dv}{dx}\):
Since \(\frac{du}{dx} = 2(x + 3)\) and \(\frac{dv}{dx} = - 1.\)
Substituting these results into the quotient rule formula we can obtain an expression for \(\frac{dy}{dx}\):
\[ \begin{aligned} \frac{dy}{dx} &= \frac{v(x) \times \frac{du}{dx} - u(x) \times \frac{dv}{dx}}{[v(x)]^{2}} \\ &= \frac{(- x) \times 2(x + 3) - (x + 3)^{2} \times - 1}{(- x)^{2}}. \end{aligned} \]
Simplifying, \[ \begin{aligned} \frac{dy}{dx} &= \frac{2x(x + 3) - (x + 3)^{2}}{- x^{2}} \\ &= \frac{2x^{2} + 6x - x^{2} - 6x - 9}{- x^{2}} \\ &= \frac{x^{2} - 9}{- x^{2}}. \end{aligned} \]
To find the stationary points of the function, we must solve \(\frac{dy}{dx} = 0\) for \(x\). Setting \(\frac{dy}{dx} = 0\): \[ \begin{aligned} \frac{x^{2} - 9}{- x^{2}} &= 0\\ \Longrightarrow x^{2} - 9 &= 0. \end{aligned} \]
Therefore, the stationary points are when \(x = 3\) and \(x = - 3\).
Due to the interval that this equation is valid for we can reject \(x = - 3\).
We find the corresponding \(y\)-values of the stationary point by plugging these \(x\)-values into the initial equation:
When \(x = 3\),
\[ \begin{aligned} y &= 3 + \frac{(3 + 3)^{2}}{- 3} \\ &= - 9. \end{aligned} \]
Therefore, the stationary point is \((3, - 9)\). Finally, we need to determine the nature of the stationary point. To do this we want to calculate the second derivative of the initial function and then evaluate it for \(x\)-value of the stationary point.
Recall:
- If \(\frac{d^{2}y}{dx^{2}} < 0\) the stationary point is a maximum;
- If \(\frac{d^{2}y}{dx^{2}} > 0\) the stationary point is a minimum;
- If \(\frac{d^{2}y}{dx^{2}} = 0\) the stationary point is a point of inflection.
To calculate \(\frac{d^{2}y}{dx^{2}}\), we want to differentiate \(\frac{dy}{dx}\) again with respect to \(x\):
\[ \begin{aligned} \frac{d^{2}y}{dx^{2}} &= \frac{2x(x^{2} - 9) - 2x^{3}}{(- x^{2})^{2}} \\ &= \frac{2x^{3} - 2x^{3} + 18x}{- x^{4}} \\ &= - \frac{18}{x^{3}}. \end{aligned} \]
For \((3, - 9)\), \(\frac{d^{2}y}{dx^{2}} = - \frac{2}{3}\), so it is a maximum.
Congratulations if you made it this far!
Now you can have a go at one yourself.