14  Optimisation

Optimisation finds the biggest or smallest values of a function. This is often used to solve real world problems, for example:

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.

NoteNames of turning points
  • 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:

Note
critical point \(f(x)\) \(f'(x)\) \(f''(x)\)
minimum smallest value \(0\) \(f''(x) > 0\)
maximum largest value \(0\) \(f''(x) < 0\)
WarningInflection points

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.

CautionEconomics vocabulary

First order condition or FOC is when \(f'(x) = 0\). This finds the stationary points: the places where the curve is momentarily flat. A stationary point could be a maximum, a minimum, or a point of inflection, so the FOC alone does not tell you which.

Second order condition or SOC is checking the sign of \(f''(x)\) to classify the turning point. If \(f''(x) < 0\) at a stationary point, the curve is concave there and the point is a local maximum. If \(f''(x) > 0\), the curve is convex and the point is a local minimum.

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.

CautionEconomics example

A demand function for a generic good, where \(P\) is the price and \(q\) is the quantity is: \(P = 121 - q\). The Marginal Cost is given by, \(MC = 7q+25\), and fixed cost is \(FC = 23\). Find the quantity \(q\) to maximise profits.

The Marginal Cost, \(MC\), is the cost that changes with quantity of the goods produced.

The Fixed Cost, \(FC\), is a one off cost.

The total profit can be found by calculating the total revenue (price times quantity) subtracting the total cost (marginal cost times quantity add fixed costs).

Since the letter \(P\) has been used for price I’ll use \(\pi\), the greek version of \(P\) for profit. The equation for profit looks like:

\[ \begin{split} \pi &= TR - TC \\ &= Pq - (MC \times q + FC) \end{split} \]

Using the equations for \(P\), \(MC\) and \(FC\) given in this question we can substitue these in our equation for profit to give:

\[ \pi = (121 - q)q - (7q+25)q - 23 \]

Expanding the brackets we have:

\[ \pi = 121q - q^2 -7q^2 - 25q - 23 \]

Then collecting like terms (it’s normal to write it in decreasing powers of the variable):

\[ \pi = - 8q^2 + 96q - 23 \]

Differentiating with respect to \(q\) gives:

\[ \frac{d\pi}{dq} = -16q + 96 \]

Using the first order condition \(\frac{d\pi}{dq} = 0\). In other words find where the function’s gradient is equal to zero. We have:

\[ - 16q + 96 = 0 \]

Solving to find \(q\):

\[ \begin{aligned} 96 &= 16q \\ \frac{96}{16} &= q \\ q &= 6 \end{aligned} \]

So finially the quatity \(q\) that maximises profits is \(6\).

Now you can try one for yourself: