In this explainer, we will learn how to apply derivatives to real-world problems to find the maximum and the minimum values of a function under certain conditions.

The basic idea of all optimization problems is the same; we have a particular quantity, such as cost, area, or volume, that we want to minimize or maximize. That quantity is a dependent variable described by a function of the independent variables, such as time, length, or temperature.

Specific real-world examples of optimization problems include a company wanting to minimize production costs or maximize revenue or profit. In manufacturing, it is often desirable to minimize the amount of material used to package a product with a certain fixed volume; boxes of different dimensions can have the same volume but different surface areas. Many optimization problems also have an additional auxiliary condition or constraint, relating the independent variables, that we have to take into account. For example, we may want to maximize the area of a rectangular garden with a particular constraint on how much wire fencing we have for three sides of the rectangle.

In a real-world optimization problem, the first step is to specify the dependent and independent variables; a diagram may also help to visualize the problem. We then determine which quantity we want to minimize or maximize and express that quantity as a function to be optimized, including any additional constraints relating the independent variables. We then determine the critical (or stationary) points of the function using the first derivative test and classify them as (local) maxima or minima by the second derivative test.

Letβs first remind ourselves of the definition of a critical point.

### Definition: Critical Point

The point is called a critical point of , provided is in the domain of the function and is continuous at , and either

A critical point can be classified as either a minimum or maximum according to the second derivative test as follows.

### Definition: Second Derivative Test

Suppose is a twice differentiable function defined on some interval containing the critical point . Then

- if , then has a local
**maximum**at ; - if , then has a local
**minimum**at ; - if , then may have a
**point of inflection**at .

In this explainer, we are interested in maximum and minimum values of functions and their applications to real-world problems. Thus, we will ignore points with as the second derivative test says nothing about the point , a possible inflection point, with respect to optimization.

For these problems, it can be useful to begin by looking at how to apply the process in a specific example with the volume of a hot-air balloon. In particular, we will apply optimization to find the maximum volume, given its expansion function over time.

### Example 1: Finding the Maximum Value of a Function Involving a Rational Function Using the Quotient Rule

Given that the volume of a hot-air balloon grows according to the relation , where the time is measured in hours, determine its maximum volume.

### Answer

In this example, we want to find the maximum volume of a hot-air balloon, as depicted in the picture, which grows according to a particular relation, , where is the time measured in hours.

In order to do this, we must find the critical points of the function , by taking the first derivative with respect to time, , setting the derivative equal to zero, and solving for . We can then determine the nature of the critical points using the second derivative test.

Since our relation involves a rational function, in order to differentiate, we recall the quotient rule for differentiable functions and :

Using this with and , we can find the first derivative of the function as

Now, solving for , we find that and hence . However, only nonnegative values of are valid since time is always nonnegative (); hence, we have the only critical point , and we can ignore the solution with .

We can determine the nature of this critical point using the second derivative test. Applying the quotient rule again with and , we find the second derivative of the volume function as

Substituting the critical point into this, we find

Thus, since , by the second derivative test, the critical point is a local maximum of the volume function of the hot-air balloon. At this critical point, the volume is given by

The maximum volume of the hot-air balloon is therefore 4βββ500 cubic units.

Letβs consider a further real-world application of optimization to maximize the profit for a particular company. Suppose a company has a nonlinear relationship between its monthly advertising budget, thousand, and profit, thousand, given by the cubic function

The companyβs monthly advertising budget is never less than Β£4βββ000 but cannot exceed Β£14βββ000; in other words, we have . To determine the maximum profit, we begin by finding the first derivative of this function with respect to and setting it equal to zero:

Solving for , using the quadratic formula or otherwise, we find the critical points

Both of these critical points lie within the range of possible -values, . Now, to determine the nature of these points, we use the second derivative test. The second derivative of the profit function is given by

Now, substituting our critical values into the second derivative, we find

Therefore, since and , by the second derivative test, is a local maximum and is a local minimum of the profit function . This is also shown in the plot of the profit function below.

Given the constraint that the advertising budget is between Β£4βββ000 and Β£14βββ000 (), by substituting into the profit function , we find that the maximum profit the company can make during a month is

We note that when we have a particular constraint for the input values , we should also check the value of the function at the edges of the constraint as these could give a higher or lower value compared to the local maximum or minimum respectively. For this problem, it is possible that maximum profit may be at the edges of the constraint values, but this is not the case here as shown on the plot. We can also verify this by substituting the values and into the profit function:

These give lower values than we got from the local maximum with . Thus, is indeed a local maximum of the profit function given the constraint .

In our next example, we will apply optimization to find the maximum current in an electrical circuit with an alternating current.

### Example 2: Finding the Maximum Value of an Alternating Current given Its Expression with Time Using Differentiation

In a circuit of an alternating current, the current , measured in amperes, at any moment , measured in seconds, is given by the relation . What is the maximum value of the current in this circuit rounded to two decimal places?

### Answer

In this example, we want to find the maximum value of an alternating current, as depicted in the picture, given its expression as function of time, .

To do this, we must find the critical points of the current , by taking the first derivative, setting it equal to zero, and solving for . We can then determine the nature of the critical points using the second derivative test.

Taking the first derivative for the alternating current with respect to and setting it equal to zero gives

In order to solve for , we can rearrange this expression to obtain and hence the critical points, in radians, from the general solution for are

Since the trigonometric functions are periodic, we only need to consider the critical points for and , corresponding to and , as the current will alternate between the values evaluated at these critical points, the maximum and minimum.

We can determine the nature of these critical points using the second derivative test. The second derivative of the current function is given by

Substituting the critical points and into the second derivative gives

Thus, since and , by the second derivative test, is a local maximum and is a local minimum of the function of the current.

For the critical points given by the general solution, , we have a local maximum for even and a local minimum for odd .

The maximum current can be found by substituting :

Therefore, the maximum value of the current rounded to two decimal places is 24.84 A.

So far, for the examples we have considered, we have been given the particular function to find the optimum values for. However, in many real-world examples, we have to derive this function first by the information given or by physical considerations.

Letβs consider an example where we must first derive the function that we want to optimize. An open box is to be constructed from a rectangular piece of card measuring 64 cm by 24 cm. A square of side length cm is to be cut out of each corner so that the box can be made by folding, as shown in the diagrams below. The resulting box is a rectangular prism whose base measures cm by cm and whose height is cm.

Recall that the formula for the volume of a rectangular box with side lengths and and height is in cubic units. In our case, the side lengths are and and the height is , so the volume of the box is

In order to find the maximum value for volume , we find the critical points of and identify the maxima. Taking the first derivative and setting it equal to zero,

Solving for , using the quadratic formula or otherwise, we find

Now we take the second derivative of the volume function in order to classify these critical points:

Substituting the critical points into the second derivative , we find

Therefore since and , by the second derivative test, is a local minimum and is a local maximum of the volume of the open box. The maximum volume of the open box can be found by substituting :

So far, the problems we have encountered have involved optimizing a particular function with one variable and without any constraints on the function, but many real-world problems often involve more than one variable and have a given constraint relating the independent variables. The optimization problems we want to solve are in the form

The constraint can often be used to rewrite the function as a function of one variable only, after which the same steps apply when optimizing a one-variable function similar to the examples above.

Letβs look at how we can apply this in a real-world example. Consider a juice carton that has a capacity of 1βββ000 cm^{3}; the design of the carton is that of a closed rectangular prism (rectangular box) where the base measures cm by cm and height measures cm.

The surface area of the carton, cm^{2}, and volume, cm^{3}, are given by

Suppose we want to minimize the surface area of the carton given the constraint from the volume . The optimization problem we want to solve is then given by

We can rewrite the constraint as

expressing the height in terms of . We can then rewrite the surface area as a function of only:

In order to find the minimum surface area, we begin by taking the first derivative of this function and setting it equal to zero:

Solving for , we find the critical point as

To determine the nature of this critical point, we substitute it into the second derivative of the surface area and apply the second derivative test. The second derivative of the area function is given by

Substituting the critical point into the second derivative gives

Thus, since , by the second derivative test, the critical point is a local minimum of the surface area . The minimal surface area can be found by substituting :

Now letβs look at a few examples to practice and deepen our understanding of solving optimization problems and how they apply to real-world problems. In the first example, we want to find two numbers with the minimum sum of their squares, given their sum. This may seem abstract, but it can also represent a real-world scenario, as we shall see.

### Example 3: Finding Two Numbers with the Minimum Sum of Their Squares given Their Sum Using Differentiation

Find two numbers whose sum is 156 and the sum of whose squares is the least possible.

### Answer

In this example, we want to find two numbers with a given sum whose sum of squares is minimal.

Let and denote the two numbers whose sum is 156. The optimization problem we want to solve is then given by

Subtracting from both sides of the constraint, we have . This allows us to rewrite the sum as a function of only:

In order to determine the critical points, we take the first derivative of this function with respect to and set it equal to zero:

Solving for then gives us the critical point as . To determine the nature of this critical point, we can use the second derivative test. The second derivative of is given by

Since the value of the second derivative is positive for all values of and thus , by the second derivative test, the critical point is a local minimum of the function . We can now find the second number, , by substituting into the constraint:

Therefore, the two numbers whose sum is 156 and whose sum of squares is the least possible are .

Although this example deals with an abstract problem, it could represent a mathematical model of a real-world scenario. For example, if we had to place two square shields side by side across a 156 cm gap, we might want to do that in such a way as to minimize the total area of the shields and hence the amount of material needed to make them. We could let be the side length (in centimetres) of the first shield and be the side length (in centimetres) of the second shield. We could have one small shield and one large shield, or maybe they could be roughly the same size, but, either way, to fill the 156 cm gap, the sum of and would need to be equal to 156. For this scenario, we have found from the last example that the two squares which minimize the sum of their areas would be equal and both have lengths of 78 cm.

Now, letβs look at a similar example where we use optimization to maximize the area of a rectangle, given its perimeter. We will determine the maximum area and the dimensions of the rectangle.

### Example 4: Finding the Maximum Area of a Rectangular Region given Its Perimeter Using Differentiation

Find the maximum area of a rectangular piece of land that can be surrounded by a fence that is 12 metres long.

### Answer

In this example, we want to determine the maximum area of a rectangular piece of land, with a given perimeter.

Let and denote the length and width of the rectangle, respectively, as shown in the diagram; the perimeter of the rectangle is given by which is equivalent to the length of the fence in this problem.

The optimization problem we want to solve is given by

Now, making the subject of the constraint, we have

Using this, we can rewrite as a function of only:

Now we can determine the critical points of the area by taking the first derivative of this function and setting it equal to zero:

Solving for gives us the critical point . To determine the nature of this critical point, we use the second derivative test. The second derivative of the area function is given by

Since the value of the second derivative is negative for all values of and thus , by the second derivative test, the critical point is a local maximum of the area function . At this critical point, the area is given by

We also note that we can determine the width of the rectangle from the constraint as , and we find that the area is maximized if the perimeter is a square.

Thus, the maximum area of a rectangular piece of land surrounded by a fence 12 m long is given by 9 m^{2}.

This problem is similar to the abstract one where we have to determine two numbers with a given sum that give the maximum product . Abstract optimization problems can often be used to solve real-world problems in the right context.

Now, letβs look at an example where we have to find the dimensions of a rectangular cross section of a block of wood cut from a cylindrical log by maximizing the resistance of the block.

### Example 5: Finding the Dimensions of a Rectangular Body Using Differentiation

The rectangular cross section of a block of wood is cut from a cylindrical log of diameter 67 cm. The resistance of this block is proportional to its width and the square of its length. What dimensions give the maximum resistance?

### Answer

In this example, we want to find the dimensions of the rectangular cross section, a block of wood cut from a cylindrical log of a given diameter, which maximizes its resistance. Letβs denote the width of the block as and the length as , as depicted in the diagram.

The resistance, which we can denote as , is a measure of the strength of the rectangular block and it is always positive. Since the resistance is proportional to its width and the square of its length , we have the relation, for some . The width and length are also related to the diameter of the log by using the Pythagorean theorem on the right triangle as . The optimization problem we want to solve is then given by

We can rearrange the constraint as and using this we can rewrite the resistance as a function of only:

Now we can find the critical points by taking the first derivative of this function and setting it equal to zero:

Solving this for gives us

Since only nonnegative values of the width are valid, we can ignore the negative solution and the only critical point is

To determine the nature of this critical point, we use the second derivative test. The second derivative of the resistance function is given by

Substituting the critical value into the second derivative gives

Since and thus , by the second derivative test, the critical point is a local maximum of the resistance function . The length of the rectangular block can also be found from the constraint by substituting the critical point as follows:

Thus, the dimensions of the rectangular cross section that give the maximum resistance are cm, cm.

In the next example, we will find the maximum area of a rectangular shaped playground which ends in two semicircles, with a given perimeter.

### Example 6: Finding the Maximum Area of a Region Composed of a Rectangle Ending in Two Semicircles given the Perimeter of the Region Using Differentiation

A rectangular-shaped playground ends in two semicircles. Given that the perimeter of the playground is 594 m, determine its maximum area.

### Answer

In this example, we want to find the maximum area of a playground, composed of a rectangle ending in two semicircles, with a given perimeter.

Letβs denote the width of the inner rectangle as , which is also the diameter of the semicircles, and the length of the rectangle as . Since there are two semicircles, one on each end of the rectangle, the area and perimeter of the two ends combined are that of a whole circle, of radius , given by

The area of the playground, , will be the sum of the area of the inner rectangle and the total area of the two semicircles (or whole circle):

The perimeter is the length of the outline of the playground, which includes the length of the inner rectangle twice and the perimeter or circumference of the two semicircles (or whole circle):

Since we are given that the perimeter of the playground is 594 m, the optimization problem we want to solve is then given by

Now, making the subject of the constraint, we have

Using this, we can rewrite the total area of the playground as a function of only:

Now, we can find the critical points by taking the first derivative of this function and setting it equal to zero:

Solving for gives

To determine the nature of this critical point, we use the second derivative test. The second derivative of the area function is given by

Since the value of the second derivative is negative for all values of and thus , by the second derivative test, the critical point is a local maximum of the area function of the playground. At this critical point, the area is given by

Thus, the maximum area of the playground with a perimeter of 594 m is
m^{2}.

Again, the perimeter in this example could represent the wire fencing placed around the edge of the playground.

Now, letβs consider an example where we find the radius of a circular sector with a given area that minimizes the perimeter.

### Example 7: Finding the Radius of the Circular Sector with a Given Area That Has the Minimum Perimeter Using Differentiation

A sector of a circle has area 16 cm^{2}. Find the radius that minimizes its perimeter, and then determine the corresponding angle in radians.

### Answer

In this example, we want to find the radius of a circular sector, as shown in the diagram, that has the minimal perimeter for a given area and the corresponding angle .

The area, , and perimeter, , of a sector with radius and angle are given by where is the arc length of the segment. The optimization problem we want to solve is then

Now making the subject in the constraint, we have

Using this, we can rewrite the sector perimeter as a function of only:

Now, we can determine the critical points by taking the first derivative of this function and setting it equal to zero:

Solving this for gives us . However, only nonnegative values of are valid since the radius is always nonnegative () and we have the only critical point . To determine the nature of this critical point, we use the second derivative test. The second derivative of the perimeter function is given by

Substituting the critical point into the second derivative, we have

Thus, since , by the second derivative test, the critical point is a local minimum of the perimeter function . We can find the value of the angle by substituting into the constraint:

Thus, we find that the radius and corresponding angle , in radians, that minimize the perimeter are given by

The sector in this example can represent a slice of pizza, where you want to find the radius and angle of the slice that minimizes its perimeter, with a fixed area.

In the next example, we will find the maximum volume of a cylinder, with a given surface area.

### Example 8: Finding the Maximum Volume of a Cylinder with a Given Surface Area

What is the maximum volume of a right circular cylinder with surface area cm^{2}? Give your answer in terms of .

### Answer

In this example, we want to find the maximum volume of a cylinder with a fixed given surface area, as shown in the diagram.

The surface area and volume of a right circular cylinder with radius and height are given by

The optimization problem we want to solve is given by

Now, making the subject in the constraint, we have

Using this, we can rewrite the cylinder volume as a function of only:

Now, we can determine the critical points by taking the first derivative of this function and setting it equal to zero:

Solving this for gives us . However, only nonnegative values of are valid since the radius is always nonnegative () and we have the only critical point . We can determine the nature of this critical point using the second derivative test. The second derivative of the volume function is given by

Substituting the critical point into the second derivative, we have

Thus, since , by the second derivative test, the critical point is a local maximum of the volume function . At this critical point, the volume is given by

The maximum volume of the cylinder with a fixed surface area is therefore
cm^{3}.

The cylinder in this example can depict a soda can or a tin containing food, and you want to maximize the volume of the cylinder from the amount of material you have available, such as aluminum, corresponding to the surface area.

In the next example, we will demonstrate how to use the properties of a sphere and cylinder to maximize the sum of their volumes.

### Example 9: Finding the Radius of a Sphere and a Cylinder That Maximizes the Sum of Their Volumes given the Sum of Their Surface Areas Using Differentiation

Given that the sum of the surface areas of a sphere and a right circular cylinder is cm^{2} and their radii are equal, find the radius of the sphere that makes the sum of their volume at its maximum value.

### Answer

In this example, we want to find the radius that maximizes the sum of the volumes of a sphere and cylinder, as depicted in the diagram, given a fixed sum of their surface areas.

The surface area and volume of a sphere and right circular cylinder of radius and height are given by

We are given the constraint that the sum of their surface areas is given by cm^{2}, so we have

This expression simplifies to the constraint . The optimization problem we want to solve is then given by

Now, making the subject of the constraint, we have

Using this, we can rewrite the total volume as a function of only:

Now we can find the critical points by taking the first derivative of this function and setting it equal to zero:

Solving this for gives us . However, only nonnegative values of are valid since the radius is always nonnegative () and we have the only critical point . To determine the nature of this critical point, we use the second derivative test. The second derivative of the volume function is given by

Substituting the critical value into the second derivative, we have

Thus, since , by the second derivative test, the critical point is a local maximum of the total volume function . Therefore, the radius of the sphere that makes the sum of their volume at its maximum value is 10 cm.

This example could represent a garden feature or decoration, a wooden sphere or a dome light, placed on a cylindrical support.

In the next example, we will look at how to find the points on a curve that are closest to a given point using optimization.

### Example 10: Finding the Points on a Given Curve Closest to a Given Point Using Differentiation

Find the points on the curve that are closest to the point .

### Answer

In this example, we want to find the points on a particular curve, as shown in the diagram below, with minimal distance to a given point.

By the Pythagorean theorem, the distance between two points and is given by

Thus, for any points on the curve and for , this distance is given by

The optimization problem we want to solve is therefore

Using the constraint given by the equation of the curve and substituting for , we can write as a function for only:

We can now determine the critical points of this function by taking the first derivative and setting it equal to zero. Using the chain rule for two differentiable functions and , , with and , we obtain

Solving for gives us the critical point . We can determine the nature of this critical point using the second derivative test. Again, using the chain rule, the second derivative of the length function is given by

Substituting the critical point into the second derivative, we have

Thus, since , by the second derivative test, the critical point is a local minimum of the distance function from the curve. The -coordinate can be found from the constraint or equation of the curve:

Therefore, . Thus, the points on the curve that are closest to are , .

In celestial mechanics, a parabolic trajectory is a Kepler orbit, with the eccentricity equal to 1, that is exactly on the border between an elliptical and hyperbolic orbit.

The parabolic curve can represent the trajectory of an object around a massive body, such as the Sun, located at a particular point, , shown by the red dot in the plot in the previous example. The abstract optimization problem can be used to find the points in the trajectory of an object around a massive body, at which the object is closest to the massive body.

### Key Points

A real-world optimization problem can be solved in the following way:

- Define the problem: specify the variables and the function to be optimized (minimized or maximized), subject to a constraint relating the independent variables.
- Where appropriate, use the constraint to rewrite the function to be optimized as a function of one variable.
- Differentiate the function to be optimized, setting the derivative to zero and solving for the variable, to determine the critical points.
- Find the second derivative and substitute the critical points to determine their nature using the second derivative test: at a maximum and at a minimum.
- The maximum or minimum is then found by substituting the appropriate critical point into the function to be optimized. The constraint can also be used to determine the other independent variables.