2.5: Optimization

MTH 95: Algebra 3 · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    2.5: Optimization
    Learning Objectives
    • Use the vertex to find the absolute maximum or minimum of a quadratic function
    • Explain how the extreme value formula \(f\left(-\dfrac{b}{2a}\right)\) gives the absolute maximum or minimum of a quadratic function
    • Model real world optimization problems with a quadratic function

    In this section, we will explore the science of optimization. Suppose you are trying to find a pair of numbers with a fixed sum so that the product of the two numbers is maximized. This is an example of an optimization problem. However, optimization is not limited to finding a maximum. For example, consider a manufacturer that wants to minimize its costs based on certain criteria. This is another example of an optimization problem. As you can see, optimization can encompass finding either a maximum or a minimum.

    Optimization can be applied to a broad family of different functions. However, in this section, we will concentrate on finding the maximums and minimums of quadratic functions. There is a large body of real-life applications that quadratic functions can model, so we will find that this is an excellent entry point into the study of optimization.

    Finding the Maximum or Minimum of a Quadratic Function

    Consider the quadratic function

    \[f(x)=-x^{2}+4 x+2 \nonumber \]

    Let’s complete the square to place this quadratic function in vertex form. First, factor out a minus sign.

    \[f(x)=-\left[x^{2}-4 x-2\right] \nonumber \]

    Take half of the coefficient of \(x\) and square, as in \([(1 / 2)(-4)]^{2}=4\). Add and subtract this amount to keep the equation balanced.

    \[f(x)=-\left[x^{2}-4 x+4-4-2\right] \nonumber \]

    Factor the perfect square trinomial, combine the constants at the end, and then redistribute the minus sign to place the quadratic function in vertex form.

    \[\begin{array}{l}{f(x)=-\left[(x-2)^{2}-6\right]} \\ {f(x)=-(x-2)^{2}+6}\end{array} \nonumber \]

    This is a parabola that opens downward, has been shifted 2 units to the right and 6 units upward. This places the vertex of the parabola at (2, 6), as shown below. Note that the maximum function value (\(y\)-value) occurs at the vertex of the parabola. A mathematician would say that the function “attains a maximum value of 6 at \(x\) equals 2.”

    Note that 6 is greater than or equal to any other \(y\)-value (function value) that occurs on the parabola. This gives rise to the following definition.

    Screen Shot 2019-07-08 at 7.52.58 PM.png

    Maximum

    The function \(f\) is said to achieve a maximum at \(x=c\) if \(f(c) \geq f(x)\) for all \(x\).

    Next, let’s look at a quadratic function that attains a minimum on its domain.

    Example 1

    Find the minimum of \(f(x)=2 x^{2}+12 x+12\).

    Solution

    Factor out a 2. \[f(x)=2\left[x^{2}+6 x+6\right] \nonumber \]

    Take half of the coefficient of x and square, as in \([(1 / 2)(6)]^{2}=9\). Add and subtract this amount to keep the equation balanced.

    \[f(x)=2\left[x^{2}+6 x+9-9+6\right] \nonumber \]

    Factor the trinomial and combine the constants, and then redistribute the 2 in the next step.

    \[\begin{array}{l}{f(x)=2\left[(x+3)^{2}-3\right]} \\ {f(x)=2(x+3)^{2}-6}\end{array} \nonumber \]

    The graph is a parabola that opens upward, shifted 3 units to the left and 6 units downward. This places the vertex at (−3, −6). Note that the minimum function value (\(y\)-value) occurs at the vertex of the parabola. A mathematician would say that the function “attains a minimum value of −6 at x equals −3."

    Screen Shot 2019-07-08 at 8.01.12 PM.png

    Note that −6 is less than or equal to any other \(y\)-value (function value) that occurs on the parabola.

    This last example gives rise to the following definition.

    Minimum

    The function f is said to achieve a minimum at \(x=c\) if \(f(c) \leq f(x)\) for all x.

    A Shortcut for the Vertex

    It should now be clear that the vertex of the parabola plays a crucial role when optimizing a quadratic function. We also know that we can complete the square to find the coordinates of the vertex. However, it would be nice if we had a quicker way of finding the coordinates of the vertex. Let’s look at the general quadratic function

    \[y=a x^{2}+b x+c \nonumber \]

    and complete the square to find the coordinates of the vertex. First, factor out the \(a\).

    \[y=a\left[x^{2}+\frac{b}{a} x+\frac{c}{a}\right] \nonumber \]

    Take half of the coefficient of \(x\) and square, as in \([(1 / 2)(b / a)]^{2}=[b /(2 a)]^{2}=b^{2} /\left(4 a^{2}\right)\). Add and subtract this amount to keep the equation balanced.

    \[y=a\left[x^{2}+\frac{b}{a} x+\frac{b^{2}}{4 a^{2}}-\frac{b^{2}}{4 a^{2}}+\frac{c}{a}\right] \nonumber \]

    Factor the perfect square trinomial and make equivalent fractions for the constant terms with a common denominator.

    \[\begin{array}{l}{y=a\left[\left(x+\frac{b}{2 a}\right)^{2}-\frac{b^{2}}{4 a^{2}}+\frac{4 a c}{4 a^{2}}\right]} \\ {y=a\left[\left(x+\frac{b}{2 a}\right)^{2}+\frac{4 a c-b^{2}}{4 a^{2}}\right]}\end{array} \nonumber \]

    Finally, redistribute that \(a\). Note how multiplying by \(a\) cancels one \(a\) in the denominator of the constant term.

    \[y=a\left(x+\frac{b}{2 a}\right)^{2}+\frac{4 a c-b^{2}}{4 a} \nonumber \]

    Now, here’s the key idea. The results depend upon the values of \(a\), \(b\), and \(c\), but it should be clear that the coordinates of the vertex are

    \[\left(-\frac{b}{2 a}, \frac{4 a c-b^{2}}{4 a}\right) \nonumber \]

    The \(y\)-value of the vertex is a bit hard to memorize, but the \(x\)-value of the vertex is easy to memorize.

    Find the Extreme Value

    Extreme Value

    The extreme value of a quadratic function \(f(x)\) is either the minimum or maximum value of the quadratic function \(f(x)\). The extreme value is given as

    \[f\left(-\dfrac{b}{2a}\right)\nonumber\]

    The minimum value is located at the lowest point of an upwards parabola, and the maximum value is located at the highest point of a downwards parabola.

    Note

    Notice in the definition that the extreme value is the \(y\)-coordinate of the vertex. Recall, the vertex is

    \[\left(-\dfrac{b}{2a},f\left(-\dfrac{b}{2a}\right)\right)\nonumber\]

    and we can see the \(y\)-coordinate is just the extreme value. Hence, when we use the words vertex, minimum or maximum value, or extreme value, they are all associated with the vertex of a parabola.

    Example 2

    Find the vertex and the extreme value of the function \(f(x) = x^2 − 4x + 5\).

    Solution

    Notice \(a = 1\), which means \(a > 0\). Hence, \(f(x)\) is an upwards parabola and, from the definition, we expect \(f(x)\) to have a minimum value. Let’s use the formula to find the vertex, where \(a = 1\) and \(b = −4\).

    \[\begin{array}{rl}x=-\dfrac{b}{2a}&\text{} \\ x=-\dfrac{\color{blue}{-4}}{\color{blue}{2(1)}}&\text{Simplify} \\ x=2&\text{The }x\text{-coordinate of the vertex}\end{array}\nonumber\]

    Next, we find the \(y\)-coordinate of the vertex by obtaining \(f(2)\).

    \[\begin{array}{rl}f(x)=x^2-4x+5&\text{} \\ f(\color{blue}{2}\color{black}{)}=(\color{blue}{2}\color{black}{)}^2-4(\color{blue}{2}\color{black}{)}+5&\text{Evaluate} \\ f(2)=1&\text{The }y\text{-coordinate of the vertex}\end{array}\nonumber\]

    Hence, the vertex is \((2, 1)\). Next, we find the extreme value of \(f(x)\). From the vertex calculation, we see \(f\left(-\dfrac{b}{2a}\right)=f(2)=1\). Thus, the extreme value is \(1\), the \(y\)-coordinate of the vertex.

    Example 3

    Find the vertex and the extreme value of the function \(q(n) = −3n^2 − 5n + 3\).

    Solution

    Notice \(a = −3\), which means \(a < 0\). Hence, \(q(n)\) is a downward parabola and, from the definition, we expect \(q(n)\) to have a maximum value. Let’s use the formula to find the vertex, where \(a = −3\) and \(b = −5\).

    \[\begin{array}{rl}n=-\dfrac{b}{2a}&\text{} \\ n=-\dfrac{\color{blue}{-5}}{\color{blue}{2(-3)}}&\color{black}{\text{Simplify}} \\ n=-\dfrac{5}{6}&\text{The }x\text{-coordinate of the vertex}\end{array}\nonumber\]

    Next, we find the \(y\)-coordinate of the vertex by obtaining \(q\left(-\dfrac{5}{6}\right)\).

    \[\begin{array}{rl} q(n)=-3n^2-5n+3&\text{} \\ q\left(\color{blue}{-\dfrac{5}{6}}\color{black}{}\right)=-3\left(\color{blue}{-\dfrac{5}{6}}\color{black}{}\right)^2-5\left(\color{blue}{-\dfrac{5}{6}}\color{black}{}\right) +3&\text{Evaluate} \\ q\left(-\dfrac{5}{6}\right)=\dfrac{61}{12}&\text{The }y\text{-coordinate of the vertex}\end{array}\nonumber\]

    Hence, the vertex is \(\left(-\dfrac{5}{6},\dfrac{61}{12}\right)\). Next, we find the extreme value of \(q(n)\). From the vertex calculation, we see \(q\left(-\dfrac{b}{2a}\right)=q\left(-\dfrac{5}{6}\right)=\dfrac{61}{12}\). Thus, the extreme value is \(\dfrac{61}{12}\), the \(y\)-coordinate of the vertex.

    It may seem redundant to find the vertex and the extreme value, but remember that the goal is to apply this concept to real-world applications involving quadratic functions. Let’s examine a few applications where we encounter the extreme value in the context of a real-world model.

    Projectile Motion

    Example 4

    A rocket is launched at \(t = 0\) seconds. Its height, in meters above sea-level, as a function of time is given by \(h(t) = −4.9t^2 + 46t+ 157\). At what time does the rocket reach its maximum height? At what height does the rocket reach its maximum height above the water? Round the answers to 2 decimal places.

    Solution

    When we read the word maximum, we should think about the vertex of \(h(t)\). Since we need to find the time in which the maximum height occurs, then we can find the \(x\)-coordinate of the vertex.

    \[\begin{aligned}t&=-\dfrac{b}{2a} \\ t&=-\dfrac{46}{2(-4.9)} \\ t&\approx 4.69\end{aligned}\]

    Thus, the maximum height occurs after \(4.69\) seconds. Next, we find the height of the rocket when it reaches its maximum height above the water. Since we need to find the maximum height, then we need to find the \(y\)-coordinate of the vertex, or \(h(4.69)\).

    \[h(4.69)=-4.9(4.69)^2+46(4.69)+157\approx 264.96\nonumber\]

    Thus, the maximum height of the rocket is \(264.96\) meters after \(4.69\) seconds the rocket is launched.

    Revenue and Cost Functions

    Example 5

    The revenue, \(R(x)\), of producing and selling \(x\) Awesome Hearing Aids is modeled by the function \(R(x) = −6x^2 + 108x\). What is the maximum revenue?

    Solution

    To find the maximum revenue, we need to find \(R\left(-\dfrac{b}{2a}\right)\), where \(a = −6\) and \(b = 108\). Let’s plug-n-chug this into \(R(x)\) to find the maximum revenue.

    \[\begin{aligned} R(x)&=-6x^2+108x \\ R\left(-\dfrac{b}{2a}\right)&=-6\left(-\dfrac{b}{2a}\right)^2+108\left(-\dfrac{b}{2a}\right) \\ R\left(-\dfrac{\color{blue}{108}}{2\color{blue}{(-6)}}\right)&=-6\left(-\dfrac{\color{blue}{108}}{2\color{blue}{(-6)}}\right)^2+108\left(-\dfrac{\color{blue}{108}}{2\color{blue}{(-6)}}\right) \\ R\left(-\dfrac{\color{blue}{108}}{2\color{blue}{(-6)}}\right)&=486\end{aligned}\]

    Thus, the maximum revenue is $486.

    Example 6

    The cost, \(C(x)\), of producing \(x\) Totally Cool Coolers is modeled by the function \(C(x) = 0.005x^2 −0.3x+ 17\). What is the minimum cost?

    Solution

    To find the minimum cost, we need to find \(C\left(-\dfrac{b}{2a}\right)\), where \(a=0.005\) and \(b=-0.3\). Let's plug-n-chug this into \(C(x)\) to find the minimum cost.

    \[\begin{aligned}C(x)&=0.005x^2-0.3x+17 \\ C\left(-\dfrac{b}{2a}\right)&=0.005\left(-\dfrac{b}{2a}\right)^2-0.3\left(-\dfrac{b}{2a}\right)+17 \\ C\left(-\dfrac{\color{blue}{-0.3}}{2\color{blue}{(0.005)}}\right)&=0.005\left(-\dfrac{\color{blue}{-0.3}}{2\color{blue}{(0.005)}}\right)^2-0.3\left(-\dfrac{\color{blue}{-0.3}}{2\color{blue}{(0.005)}}\right)+17 \\ C\left(-\dfrac{\color{blue}{-0.3}}{2\color{blue}{(0.005)}}\right)&=12.5\end{aligned}\]

    Area and Perimeter Functions

    Example 7

    Mary wants to fence a rectangular garden to keep the deer from eating her fruit and vegetables. One side of her garden abuts her shed wall, so she will not need to fence that side. However, she also wants to use material to separate the rectangular garden into two sections. She can afford to buy 80 total feet of fencing to use for the perimeter and the section dividing the rectangular garden. What dimensions will maximize the total area of the rectangular garden?

    Screen Shot 2019-07-09 at 10.24.22 PM.png

    Solution

    Again, before we take an algebraic approach, let’s just experiment. Note that we’ve labeled the width with the letter \(x\) and the height with the letter \(y\) in our sketch of the garden.

    There is a total of 80 feet of fence material. Suppose that we let \(y = 5\) ft. Because there are three sides of length \(y = 5\) ft, we’ve used 15 feet of material. That leaves 65 feet of material, which will be used to fence the width of the garden. That is, the width is \(x = 65\) ft. Thus, the dimensions of the garden are \(x=65\) ft by \(y=5\) ft. The area equals the product of these two measures, so \(A=325 \mathrm{ft}^{2}\). Let’s put this result into a table.

    \(x\) \(y\) \(A=xy\)
    65 ft 5 ft 325 \(\text{ft}^{2}\)

    Suppose instead that we let the height be \(y = 10\) ft. Again, there are three sections of this length, so this will take 30 ft of material. That leaves 50 ft of material, so the width \(x = 50\) ft. The area is the product of these two measures, so \(A=500 \mathrm{ft}^{2}\). As a third experiment, let the height \(y = 15\) ft. Subtracting three of these lengths from 80 ft, we see that the width \(x = 35\) ft. The area is the product of these measures, so \(A=525 \mathrm{ft}^{2}\). Let’s add these last two number experiments to our table.

    \(x\) \(y\) \(A=xy\)
    65 ft 5 ft 325 \(\text{ft}^{2}\)
    50 ft 10 ft 500 \(\text{ft}^{2}\)
    35 ft 15 ft 525 \(\text{ft}^{2}\)

    At this point, the last set of dimensions yields the maximum area, but is it possible that another choice of \(x\) and \(y\) will yield a larger area? Experiment further with numbers of your choice to see if you can find dimensions that will yield an area larger than the current maximum in the table, namely 525 \(\mathrm{ft}^{2}\).

    Let’s now call on what we’ve learned in this section to attack this model. First, we’re constrained by the amount of material we have for the job, a total of 80 ft of fencing. This constraint requires that 3 times the height of the garden, plus the width of the garden, should equal the available amount of fencing material. In symbols,

    \[x+3 y=80 \nonumber \]

    We’re asked to maximize the area, so we focus our efforts on finding a formula for the area of the rectangular garden. Because the area \(A\) of the rectangular garden is the product of the width and the height, \[A=x y \nonumber \]

    We now have a formula for the area of the rectangular garden, but unfortunately, we have the area \(A\) as a function of two variables. We need to eliminate one or the other of these variables. This is easily done by solving the fence equation for \(x\). \[x=80-3 y \nonumber \]

    Next, substitute this result in the area equation to get \[A=(80-3 y) y \nonumber \]

    or, equivalently, \[A=-3 y^{2}+80 y \nonumber \]

    Note that we have expressed the area A as a function of a single variable \(y\). Also, the area function is quadratic. Compare \(A=-3 y^{2}+80 y\) with the general form \(A=a y^{2}+b y+c\) and note that \(a = −3\) and \(b = 80\) (we have no need of the fact that \(c = 0\)). Therefore, if we plot \(A\) versus \(y\), the graph is a parabola that opens downward, so the maximum value of \(A\) will occur at the vertex. The \(y\)-coordinate of the vertex is found with

    \[y_{\mathrm{vertex}}=-\frac{b}{2 a}=-\frac{80}{2(-3)}=\frac{80}{6}=\frac{40}{3} \nonumber \]

    To find the width of the rectangular garden, substitute \(y = 40/3\) into equation (20) and solve for \(x\).

    \[x=80-3 y=80-3\left(\frac{40}{3}\right)=80-40=40 \nonumber \]

    Thus, the width of the rectangular garden is 40 ft. We can find the area of the garden by multiplying its width by its height.

    \[A=x y=(40)\left(\frac{40}{3}\right)=\frac{1600}{3}=533 \frac{1}{3} \nonumber \]

    Note that the resulting area, \(A=533\frac {1}{3} \mathrm{ft}^{2}\), is only slightly bigger than the last tabular entry found with our numerical experiments.

    You can also find the area of the rectangular region by substituting \(y=\dfrac{40}{3}\) into the quadratic equation. We’ll leave it to our readers to check that this provides the same measure for the area. You will also notice that the second coordinate of the vertex is the maximum area \(A=1600 / 3 \mathrm{ft}^{2}\).

    Screen Shot 2019-07-09 at 10.35.09 PM.png

    Note

    From all the examples, we see the variety of methods in obtaining the extreme value of a quadratic function. We can either graph the function, find each coordinate of the vertex, or calculate the extreme value directly. It is at the student's discretion to use any method. However, directly calculating the extreme value is recommended when only the extreme value is needed.


    This page titled 2.5: Optimization was last modified on Fri, 29 Aug 2025 03:30:36 GMT and is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Math Department via source content that was edited to the style and standards of the LibreTexts platform.