Optimisation

A common task is to find the best or worst outcome under some given constraints. This is called an optimisation problem. For example, how can we design a 1 litre water bottle with the least amount of material? Obviously that's interesting to know from an economical point of view, if you consider that material costs money, and if you want to produce a huge number of these bottles.

In this example, the condition that the bottle has to contain 11 litre of water is called the constraint, and the amount of material required for any given design fulfilling this constraint is called the cost function. The aim is to find the design with the lowest (or sometimes the largest) cost.

You will solve this optimisation problem in one of the exercises below, for a can of Coke. Here we discuss another optimisation problem: using an A4-sheet, how can we construct a box with the largest possible volume?

Example 1

Assume we have a piece of cardboard of length 29.7cm29.7cm and width 21.0cm21.0cm (A4). We are going to cut the corners as shown below in the figure, and form a box. Find the height xx of the box such that the volume of the box is as large as possible.

Clearly, the volume of the box, under the given constraint (using an A4 sheet and folding in the way explained above) is

f(x)=(29.72x)(212x)xf(x)=(29.7-2x)(21-2x)x

This is the cost function. Its graph is shown below.

Note that the graph makes sense. If x=0x=0, the box has no height, so the volume is 00. If the height is x=10.5cmx=10.5cm (half the cardboard width), the box volume has to be 00 as well. Any values xx bigger than 10.5cm10.5cm can be ignored, as they make no sense in the present context.

Somewhere between these two values for xx, the volume will be maximally big, and based on the graph, this value will be somewhere close to 55. This is where the graph has its local maximum and the cost function (the volume) has its largest possible value.

To calculate the precise location of the local maximum, we can use differential calculus. All we have to do is to find the stationary points of ff. We already know from the figure that there will be two of them, and we also see that the smaller of these two values must be the local maximum.

f(x)=(29.72x)(212x)x=623.7x101.4x2+4x3\begin{array}{lll} f(x) & = & (29.7-2x)(21-2x)x\\ & = & 623.7x-101.4 x^2 + 4x^3\\ \end{array}

We have to find xx with f(x)=0f'(x)=0, that is, with

f(x)=623.7202.8x+12x2=0f^\prime(x) = 623.7-202.8x+12x^2 =0

Using the midnight formula, we get the solutions

x1=12.857...x_1=12.857...

and

x2=4.042...x_2=4.042...

The optimal height of the box is therefore 4.042cm\underline{4.042cm}.

In principle we are done. But for the sake of it, just because we can, let us verify that x2x_2 is indeed the local maximum. We have

f(x)=202.8+24xf^{\prime\prime}(x)=-202.8+24x

and therefore f(4.042)=105.79...<0f^{\prime\prime}(4.042)=-105.79...<0.

So yes, x2x_2 is the local maximum.

Note 1

Remember: The cost (function) is the quantity you want to minimise or maximise.

Exercise 1
Q1

Given a fence of length 500m500m, we want to enclose a rectangular area that is as big as possible. One side of the field is blocked by the farm house, so no fence is required for this side (see figure). Determine the dimension of the rectangle.

Q2

Consider again the fence from above. Find the smallest possible fence length (three sides) to enclose an area of 80000m280\,000m^2.

Q3

We want to construct a box whose base length is 33 times the base width. The material used to build the top and bottom costs 1010 dollars per m2m^2 and the material used to build the sides costs 66 dollars per m2m^2. If the box must have a volume of 50m350 m^3, determine the dimensions that will minimize the cost to build the box.

Q4

Coke Can Problem. A manufacturer needs to make a cylindrical can that will hold 0.330.33 litres of coke. Determine the optimal radius of the can that will minimize the amount of material used in its construction.

Q5

Find the point ZZ on the graph of f(x)=xf(x)=\sqrt{x} that is nearest to the point A(40)A(4|0).

Q6

There are 5050 apple trees in an orchard. Each tree produces n=800n=800 apples. For each additional tree planted in the orchard, the output per tree drops by 1010 apples. Find the optimal number of trees that should be added to the existing orchard in order to maximize the total output of trees?

Q7

Which cuboid with a square base and a volume of 1000m31000 m^3 has a minimal surface area?

Q8

A rectangular area AA is to be marked out with a rope of length 100m100m. Part of one rectangle side is formed by a 20m20m long wall of a house, for which no rope has to be used (see picture). Find the largest possible area AA that can be formed.

Q9

The point PP is on the graph of the function f(x)=x+6f(x)=-x+6 in the first quadrant (that is, in the part of the coordinate system where the xx- and yy-coordinates are both positive). Find PP so that the rectangular area between the coordinate origin and PP is as large as possible.

Q10

A rectangle has two points on the graph of f(x)=2x2f(x)=2-x^2 and two points on the xx-axis (see picture below). Determine the rectangle with the maximum area that can be embedded between the xx-axis and the graph in this way (and is above the xx-axis). How big is the area?

Solution
A7

Volume:

x2y=1000y=1000x2x^2y = 1000 \rightarrow y=\frac{1000}{x^2}

Cost function:

S(x)=2x2+4xy=2x2+4x1000x2=2x2+4000x1S(x)=2x^2+4xy=2x^2+4x\frac{1000}{x^2}=2x^2+4000x^{-1}

Find local min:

S(x)=4x4000x2=0S'(x)=4x-4000x^{-2}=0

Multiplying both sides by x2x^2 we get

4x34000=0x=10m4x^3-4000=0 \rightarrow x=10m

And therefore y=1000102=10my=\frac{1000}{10^2}=10m. Thus, the solution is therefore a cube of side length 10m10m.

Extra: check if local minimum.

S(x)=4+8000x3A(10)=4+8=12>0 local min.S''(x)=4+8000x^{-3} \rightarrow A''(10)=4+8=12>0\rightarrow \text{ local min.}
A8

Rope length:

x+2y+(x20)=100y=60xx+2y+(x-20)=100 \rightarrow y=60-x

Cost function:

A(x)=xy=x(60x)=60xx2A(x)=xy=x(60-x)=60x-x^2

Find local max:

A(x)=602xx=30mA'(x)=60-2x\rightarrow x=30m

And thus y=6030=30my=60-30=30m and the maximal area is A=900m2A=900m^2.

Extra: check if local maximum.

A(x)=2A(30)=2 local max.A''(x)=-2 \rightarrow A''(30)=-2\rightarrow \text{ local max.}
A9

The condition is that PP hs to be on the graph f(x)=x+6f(x)=-x+6, that is, the yy-coordinate of PP is given by

y=f(x)=x+6y=f(x)=-x+6

Cost function:

A(x)=xy=x(x+6)=x2+6xA(x)=xy=x(-x+6)=-x^2+6x

Find local max:

A(x)=2x+6=0x=3A'(x)=-2x+6=0 \rightarrow x=3

Thus y=3+6=3y=-3+6=3 and therefore P(33)P(3|3).

Extra: check if local maximum.

A(x)=2A(3)=2 local max.A''(x)=-2 \rightarrow A''(3)=-2\rightarrow \text{ local max.}
A10

The width of the rectangle is 2x2x, the height is f(x)=2x2f(x)=2-x^2. The area is therefore A(x)=2x(2x2)A(x)=2x\cdot (2-x^2). We have to find the local maximum of this cost function. First let's expand A(x)A(x): A(x)=4x2x3A(x)=4x-2x^3, thus

A(x)=46x2=0x=23A'(x)= 4-6x^2=0 \rightarrow x=\sqrt{\frac{2}{3}}

Is it really a maximum? Yes, because

A(x)=12xA''(x)=-12x thus A(23)=1223<0A''(\sqrt{\frac{2}{3}})=-12\cdot\sqrt{\frac{2}{3}} <0 \rightarrow local max!

The width of the rectangle is 223=1.6332\sqrt{\frac{2}{3}}=1.633, the height is 2223=232-2\cdot\frac{2}{3}=\frac{2}{3}.