Skip to main content
Mathematics LibreTexts

3.4: Optimization

  • Page ID
    83927
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    In Section 3.2 we noticed that the high and low points of the graph of a function often coincided with a point where the derivative of the function was 0. In a business setting, we are often concerned with finding the maximum and minimum values of a function, because one or the other will be a best, or optimum value. We typically want to maximize functions like profit, utility, revenue, and market share. We typically want to minimize functions like cost and liability. We will use the same basic process to optimize, whether the extremum we are finding is a maximum and minimum.

    Recall, we said that the derivative can be thought of as the slope of the apparent line, obtained by zooming in on the graph of a function. Clearly, we cannot have an extremum at an interior point of the domain if the derivative is nonzero, because we could go either higher or lower by moving a little to the right or left. Thus we can only have extrema at a critical point, a place when the derivative is zero or undefined, or at an endpoint where we cannot go both left and right. This gives us a small list of candidate points for the optimum value.

    Our process for optimization will be to find all the candidate points, then to see which gives the highest and lowest values. When our curve has a point that is a maximum or minimum in some interval around the point, we call it a relative maximum or minimum. If it is the highest or lowest point for the whole domain of the function it is called a global maximum or minimum.

    Example 3.4.1: Profit Function for Widgets.

    Figure \(3.4.2.\) Video presentation of this example

    We have determined that the profit function for selling widgets is

    \[ \profit(\quantity)=\quantity*(400-\quantity)-5000\text{,} \nonumber \]

    with the function valid on the interval \(0\le \quantity\le 500\text{.}\) Find the minimum and maximum profit in the given interval.

    Solution

    Solution. 1 Solution A: without calculus

    The first example was chosen because it can be done without using any calculus, so we solve it with easier methods first. The profit function is a quadratic function in quantity, so it is a downward pointing parabola. The location of the vertex is at \(\quantity=200\text{,}\) which we obtain from the coefficients of the quadratic and linear terms. Thus we need to check this point and the two endpoints. Plugging in values, we get \((0,-5000)\text{,}\) \((200, 35000)\) and \((500, -55000)\text{.}\) The maximum occurs when we sell 200 widgets and our profit is $35,000, the minimum occurs when we sell 500 widgets and our loss is $55,000. A relative minimum occurs when we sell 0 widgets and our loss is $5,000.

    Solution. 2 Solution B: with calculus

    We want to set up the problem to be able to graph the profit function and its derivative on the same graph. We will us the calculator approximation of the derivative. As we did in the last section, we set up a worksheet with columns for \(q\text{,}\) \(q+.001\text{,}\) \(q-0.001\text{,}\) \(p(q)\text{,}\) \(p(q+.001)\text{,}\) \(p(q-0.001)\text{,}\) and \(p'(q)\text{.}\) This allows most of the worksheet to be filled in with quick fill.

    clipboard_ecfe07b5ec062590b6b8b7107f349f823.png

    We then look at the values, and compare the table to a graph. We find the same three candidate points and the same maximum and minimum values.

    clipboard_e668d6351d4a9c81187ff5ad2978e3166.png

    For a second example we want to look at a function where we can’t find the maximum by algebraic means.

    Example 3.4.3: Cumquat Oil.

    Figure \(3.4.4.\) Video presentation of this example

    We have determined that the profit function for selling cumquat oil is

    \[ \profit(\quantity)=(10\quantity-20)*exp(-\quantity/50)-10\text{.} \nonumber \]

    We understand that the function is valid on the interval \(0\le \quantity\le 400\text{,}\) where the quantity is measured in thousands of pints and profit is measured in thousands of dollars. Find the minimum and maximum profit in the given interval.

    Solution

    The spreadsheet is set up like it was in the first example, but with the function changed.

    clipboard_efff061e016905d1cb49a0a92302d4f91.png

    Looking at the graph and the chart we expect to find local minima at the endpoints, and the maximum when \(q\) is close to 50. We use goal seek to find where the derivative is zero. As we see below, Goal Seek does not find a point where the derivative is zero. Instead it finds a point where the derivative is “close enough” to zero. By default, “close enough” is understood by Excel as being within 0.001.

    clipboard_e84ea9bcad84be21d9b9fa105540e1ce2.png

    If the default definition of “close enough” is good enough for our purposes, then the maximum profit of $166,727 occurs when we sell 51,998 pints of oil. (In fact, selling 2 more pints of oil will yield an extra 0.01 cents.) The minimum profit occurs when we sell no product, in which case we have a loss of $30,000.

    One of the things to notice about the last example is the robustness of the method. From an algebraic point of view, the function was rather ugly. All we needed to know to use the method was that the function was smooth enough, that when we zoomed in to a scale of \(x\) changing by 0.001 the graph looked like a straight line.

    Throughout the section we have looked for places where the derivative is zero when looking for extrema. We have not paid any attention to how we decide if the point we find is a local maximum or a local minimum. There are several approaches we could use. Since we are computing the derivative we could note that a local maximum is a place where the function goes from increasing to decreasing, so the derivative goes from positive to negative. (Similarly, a local minimum is at a place where the derivative goes from positive to negative.) There is also a test that looks at the derivative of the derivative. Those tests will be more useful in the next chapter when we are finding a formula for the derivative by symbolic means. However, with the numeric technique we are using, the easiest test is that a local maximum is greater than or equal to points a little bit to both the left and right. We simply plug in points a little bit to each side to test. Since a change in \(q\) of 0.001 makes the graph look like a flat straight line, we change \(q\) by 0.01.

    clipboard_e9c98722e9a250c157bad58c48763776d.png

    As expected, profit goes down as we move away from our expected maximum.

    Example 3.4.5: Gizmo Profit.

    Figure \(3.4.6.\) Video presentation of this example

    A plant can produce between 150 and 300 gizmos. The profit function for the plant is:

    \[ \profit(\quantity)=4 \quantity^2-1300 \quantity+125000\text{.} \nonumber \]

    Find the production level that maximizes profit.

    Solution

    We set up the problem as before, using goal seek on the derivative to find critical points, and checking the ends of the interval.

    clipboard_e805b176b90ee8b1280f5243112d8158e.png

    We have three candidates for the extrema, the two endpoints and the critical point at 162.5. However by looking at the points to the side of the critical point, we see it is a local minimum. We also see, that of our 3 candidate points, the one that gives the maximum profit is the right endpoint, when quantity is 300.

    For our first three examples we have been trying to find the minimum or maximum of a functions that has been given to us as a function of one variable. Sometimes we need to do a bit of work to get the function in that format.

    Example 3.4.7: Minimizing Material Costs.

    Figure \(3.4.8.\) Video presentation of this example

    I am manufacturing goop, a liquid that needs to be put in cans. We will use cans that have a standard cylindrical shape. Find the height and radius of a 1 liter can that uses a minimal amount of metal surface.

    clipboard_e568fc5219e6286530756495e7877b66d.png

    Solution

    Using basic geometry we recall the formulas for the volume and surface area of a cylinder.

    \begin{align*} \text{volume} \amp = \pi \text{radius}^2*\text{height}\\ \text{area} \amp =2 \pi \text{radius}^2+2 \pi*\text{radius}*\text{height}\text{.} \end{align*}

    Since I am measuring volume in liters, I want to measure radius and height in decimeters so the units work correctly. In order to optimize, we need to reduce the problem to a single function of a single variable. We are told that the volume is 1, so we can solve for height as a function of radius, then plug it into the equation for area. Then area is a function of a single variable, radius, and we can find the critical points and check for a minimum.

    \begin{align*} \text{height} \amp =1/( \pi \text{radius}^2)\\ \text{area} \amp =2 \pi \text{radius}^2+\frac{2}{\text{radius}} \text{.} \end{align*}

    Since we now have area as a function of the single variable radius we can take a derivative to find the critical point, then find the optimal shape.

    clipboard_ef58b735ee3f27bc6aca6d96dfb34883e.png

    Solving for where the derivative of area is zero, we find the radius of the can should be 0.5419 deciliters. We plug that value back into the formula for height in terms of radius and see that the height should be 1.083854 deciliters. To understand the shape of the can we see that the height is twice the radius, or the same thing as the diameter of the can. The can is optimally shaped when it is the shape of a large paint can.

    There are three technical details worth mentioning from the last example. First, in Excel, the best way to put \(\pi\) in a formula is with the constant PI(). Second, the function for area is defined on an open interval where the radius is positive. There is no maximum area for a can of fixed volume. (However inefficient our can is, we can always make it worse, by moving farther from the optimum.) Third, one should also note that for this problem, we wanted several numbers as part of our answer. The worksheet for the problem puts the best height and radius at the top, where the reader can easily find it.

    In this last example we had to reduce two equations in two unknowns to a single equation in one unknown to be able to optimize. We may also need to produce an equation from data.

    Example 3.4.9: Maximized Profits and Break-Even Points.

    Figure \(3.4.10.\) Video presentation of this example

    For widget production and sales we have the following data on profit based on sales.

    Quantity 10 100 200 250 300 400
    Profit -$2,083 $31,040 $48,587 $49,845 $46,146 $23,670

    Find the break even points and the quantity that maximizes profit.

    Solution

    From looking at a quick plot of the data, I am going to assume that the profit function is a downward facing parabola, so I find the best fitting quadratic polynomial for the data. Using trendlines, my profit function is

    \[ \profit(q)=-1.002 q^2+477.22 q=6720.9\text{.} \nonumber \]

    clipboard_e6e28067d8ffff0d175ac9aced45e0f5b.png

    I now set up the table for special values with goal seek. I use starting points of 20 and 450 for the break even points and 250 for the maximum. To find break even points, I Goal Seek on the profit function. To find the maximum point, I Goal Seek on the derivative of the profit function.

    clipboard_e10f085546c3e03f2583b767220c16c07.png

    Rounding to the nearest whole number in each case, my break even points are for selling 15 and 460 widgets. My maximum profit of $50,032 occurs when I sell 238 widgets.

    Example 3.4.11: Minimizing Expenses.

    Figure \(3.4.12.\) Video presentation of this example

    We are running a business and want to minimize equipment expenses. For a particular piece of equipment the costs can be broken into initial outlays to buy the equipment, fixed annual expenses to keep the equipment in the inventory, and repair costs which we anticipate rising as the equipment gets older. A widget press costs $10,000 to buy, and the operating expenses are $500 a year, and the total repair costs are \(300t^2\) over the first \(t\) years. What is the optimal length of time to use a widget press before replacing it?

    Solution

    My annual cost equation is total cost divided by \(t\text{.}\) This annual cost is:

    \[ \AnnualCost(t)=10000/t+500+300t\text{.} \nonumber \]

    I create a spreadsheet that calculates the cost and its derivative over the first 10 years.

    clipboard_e9758fdd2c313d9021b030c540c3e4213.png

    Looking at the data, the minimal annual cost is obtained by keeping the press between 5.5 and 6.0 years. Using Goal seek on the derivative, I find the minimal annual cost of $3,964.10 is obtained by keeping the press for 5.77 years.

    class="

    Exercises: Optimization

    • For the given function and domain:
    1. Plot the function and its derivative on the same graph.
    2. Identify the regions where the function is increasing and the regions where the function is decreasing.
    3. Identify the local maximum and minimum for the given domain.
    4. Identify the global maximum and minimum for the given domain
    Exercise 1:

    \(f(x)=-2x^2+17x+23\) on the interval \(0\le x\le 50\text{.}\)

    Answer

    Setting up these problems in Excel follows the same process.

    • We create columns for \(x, x+.001, x-.001, f(x), f(x+.001), f(x-.001)\text{,}\)and \(f'(x)\)
    • Once you enter \(f(x)\text{,}\) doing a right quick fill easily finds \(f(x+.001)\) and \(f(x-.001)\text{,}\) and then \(f'(x)\) is easy to compute.
    • Once you graph \(f\) and \(f'\text{,}\) it is usually a good idea to graph the derivative using the secondary axis: double click on the derivative function and choose the appropriate button in the dialogue box.
    1. clipboard_ea7a57c1bbc05628429bd6146271b4073.png

    The table is truncated at \(x = 25\text{,}\) but the rest was used to create the graph.


    This page titled 3.4: Optimization is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Mike May, S.J. & Anneke Bart via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.