1 Graphs of Quadratic Functions

You may recall studying quadratic equations in a previous Algebra course. If not, you may wish to refer to ?? to revisit this topic. In this section, we review these equations in the context of our next family of functions: the quadratic functions.

The independent variable in Definition 1 is \(x\) while the values \(a\), \(b\) and \(c\) are parameters. Note that \(a \neq 0\) - otherwise we would have a LINEAR FUNCTION.

Show Alt Text A linear function is a function of the form
\[ f(x) = mx + b,\]
where \(m\) and \(b\) are real numbers with \(m \neq 0\).

The most basic quadratic function is \(f(x) = x^2\), the squaring function. Using a table of values, we construct the graph below.

\(\begin{array}{|c||c|} \hline x &f(x) = x^2 \\ \hline -2 & 4 \\ \hline -\frac {3}{2} & \frac {9}{4} \vphantom {\frac {1}{1_{Y}}} \\ \hline -1 & 1 \\ \hline 0 & 0 \\ \hline 1 & 1 \\ \hline \frac {3}{2} & \frac {9}{4} \vphantom {\frac {1}{1_{Y}}} \\ \hline 2 & 4 \\ \hline \end{array}\)

Figure 1: The caption: a parabola
Show Alt Text The alt text: a blue parabola, with marked points

Its shape may look familiar from your previous studies in Algebra – it is called a parabola. The point \((0,0)\) is called the vertex of the parabola because it is the sole point where the function obtains its extreme value, in this case, a minimum of \(0\) when \(x = 0\).

Indeed, the range of \(f(x) = x^2\) appears to be \([0, \infty )\) from the graph. We can substantiate this algebraically since for all \(x\), \(f(x) = x^2 \geq 0\). This tells us that the range of \(f\) is a subset of \([0, \infty )\). To show that the range of \(f\) actually equals \([0, \infty )\), we need to show that every real number \(c\) in \([0, \infty )\) is in the range of \(f\). That is, for every \(c \geq 0\), we have to show \(c\) is an output from \(f\). In other words, we have to show there is a real number \(x\) so that \(f(x) = x^2 = c\). Choosing \(x = \sqrt {c}\), we find \(f(x) = f(\sqrt {c}) = (\sqrt {c})^2 = c\), as required.

The techniques we used to graph many of the absolute value functions in Section ?? can be applied to quadratic functions, too. In fact, knowing the graph of \(f(x) = x^2\) enables us to graph every quadratic function, but there’s some extra work involved. We start with the following theorem:

To prove Theorem 1 the reader is encouraged to revisit the discussion following the proof of Theorem ??, replacing every occurrence of absolute value notation with the squared exponent. Alternatively, the reader can skip ahead and read the statement and proof of Theorem ?? in Section ??. In the meantime we put Theorem 1 to good use in the next two examples.

A few remarks about Example 2 are in order. First note that none of the functions are in the form of Definition 1. However, if we took the time to perform the indicated operations and simplify, we’d find:

  • \(f(x) = \frac {(x-3)^2}{2} = \frac {1}{2} x^2 - 3x + \frac {9}{2} \)
  • \(h(t) = -2(t-3)^2+1 = -2t^2+12t-17\)
  • \(g(x) = (x+2)^2 - 3 = x^2+4x+1\)
  • \(i(t) = \frac {(3-2t)^2 +1}{2} = 2t^2-6t+5\)

While the \(y\)-intercepts of the graphs of the each of the functions are easier to see when the formulas for the functions are written in the form of Definition 1, the vertex is not. For this reason, the form of the functions presented in Theorem 1 are given a special name.

If we proceed as in the remarks following Example 2, we can convert any quadratic function given to us in vertex form and convert to general form by performing the indicated operation and simplifying:

\[ \begin{array}{rcl} f(x) & = & a(x-h)^2 + k \\ &= & a \left (x^2 -2hx + h^2 \right ) + k \\ & = & ax^2 - 2ahx + ah^2 + k \\ & = & a x^2 + (-2ah)x + (ah^2+k). \\ \end{array}\]

With the identifications \(b = -2ah\) and \(c = ah^2+k\), we have written \(f(x)\) in the form \(f(x) = ax^2 + bx+c\). Likewise, through a process known as ‘completing the square’, we can take any quadratic function written in general form and rewrite it in vertex form. We briefly review this technique in the following example – for a more thorough review the reader should see Section ??.

We now generalize the procedure demonstrated in Example 3. Let \(f(x) = ax^2 + bx + c\) for \(a \neq 0\):

\(f(x)\) \(=\) \(ax^2 + bx +c\)
\(f(x) - c\) \(=\) \(ax^2 + bx\) Subtract \(c\) from both sides.
\(\frac {f(x)-c}{a}\) \(=\) \(\frac {ax^2 + bx}{a}\) Divide both sides by \(a \neq 0\).
\(\frac {f(x)-c}{a}\) \(=\) \(x^2 + \frac {b}{a} x\)
\(\frac {f(x)-c}{a} + \left (\frac {b}{2a}\right )^2\) \(=\) \(x^2 + \frac {b}{a} x + \left (\frac {b}{2a}\right )^2\) Add \( \left (\frac {b}{2a}\right )^2 \) to both sides.
\(\frac {f(x)-c}{a} + \frac {b^2}{4a^2}\) \(=\) \(\left (x + \frac {b}{2a}\right )^2\) Factor the perfect square trinomial.
\(\frac {f(x)-c}{a}\) \(=\) \(\left (x + \frac {b}{2a}\right )^2 - \frac {b^2}{4a^2}\) Solve for \(f(x)\).
\(f(x)-c\) \(=\) \(a \left [ \left (x + \frac {b}{2a}\right )^2 - \frac {b^2}{4a^2}\right ]\)
\(f(x)-c\) \(=\) \(a\left (x + \frac {b}{2a}\right )^2 - a\frac {b^2}{4a^2}\)
\(f(x)\) \(=\) \(a\left (x + \frac {b}{2a}\right )^2 - \frac {b^2}{4a} + c\)
\(f(x)\) \(=\) \(a\left (x + \frac {b}{2a}\right )^2 + \frac {4ac - b^2}{4a}\) Get a common denominator.

By setting \(h = -\frac {b}{2a}\) and \(k = \frac {4ac - b^2}{4a}\), we have written the function in the form \(f(x) = a(x-h)^2 + k\). This establishes the fact that every quadratic function can be written in vertex form. Moreover, writing a quadratic function in vertex form allows us to identify the vertex rather quickly, and so our work also shows us that the vertex of \(f(x) = ax^2+bx+c\) is \(\left (-\frac {b}{2a}, \frac {4ac - b^2}{4a}\right )\). It is not worth memorizing the expression \(\frac {4ac - b^2}{4a}\) especially since we can write this as \(f\left (-\frac {b}{2a}\right )\). (Think about this last statement for a moment.)

We summarize the information detailed above in the following:

Equation 0.1. Vertex Formulas for Quadratic Functions:

Suppose \(a\), \(b\), \(c\), \(h\) and \(k\) are real numbers where \(a \neq 0\).

  • If \(f(x) = a(x-h)^2 + k\) then the vertex of the graph of \(y=f(x)\) is the point \((h,k)\).
  • If \(f(x) = ax^2+bx+c\) then the vertex of the graph of \(y=f(x)\) is the point \(\left (-\frac {b}{2a}, f\left (-\frac {b}{2a}\right )\right )\).

Completing the square is also the means by which we may derive the celebrated Quadratic Formula, a formula which returns the solutions to \(ax^2+bx+c = 0\) for \(a \neq 0\). Before we state it here for reference, we wish to encourage the reader to pause a moment and read the derivation if the Quadratic Formula found in Section ??. The work presented in this section transforms the general form of a quadratic function into the vertex form whereas the work in Section ?? finds a formula to solve an equation. There is great value in understanding the similarities and differences between the two approaches.

Equation 0.2. The Quadratic Formula: The zeros of the quadratic function \(f(x) = ax^2+bx+c\) are:

\[ x = \frac {-b \pm \sqrt {b^2-4ac}}{2a} \]

It is worth pointing out the symmetry inherent in Equation 0.2. We may rewrite the zeros as:

\[ x = \frac {-b \pm \sqrt {b^2-4ac}}{2a} = -\frac {b}{2a} \pm \frac {\sqrt {b^2-4ac}}{2a}, \]

so that, if there are real zeros, they (like the rest of the parabola) are symmetric about the line \(x = -\frac {b}{2a}\). Another way to view this symmetry is that the \(x\)-coordinate of the vertex is the average of the zeros. We encourage the reader to verify this fact in all of the preceding examples, where applicable.

Next, recall that if the quantity \(b^2-4ac\) is strictly negative then we do not have any real zeros. This quantity is called the discriminant and is useful in determining the number and nature of solutions to a quadratic equation. We remind the reader of this below.

Equation 0.3. The Discriminant of a Quadratic Function: Given a quadratic function in general form \(f(x) = ax^2 + bx + c\), the discriminant is the quantity \(b^2-4ac\).

  • If \(b^2-4ac>0\) then \(f\) has two unequal (distinct) real zeros.
  • If \(b^2-4ac=0\) then \(f\) has one (repeated) real zero.
  • If If \(b^2-4ac<0\) then \(f\) has two unequal (distinct) non-real zeros.

We’ll talk more about what we mean by a ‘repeated’ zero and how to compute ‘non-real’ zeros in Section ??. For us, the discriminant has the graphical implication that if \(b^2-4ac>0\) then we have two \(x\)-intercepts; if \(b^2-4ac=0\) then we have just one \(x\)-intercept, namely, the vertex; and if \(b^2-4ac<0\) then we have no \(x\)-intercepts because the parabola lies entirely above or below the \(x\)-axis. We sketch each of these scenarios below assuming \(a>0\). (The sketches for \(a<0\) are similar - see Exercise ?? .)

We now revisit the economic scenario first described in Examples ?? and ?? where we were producing and selling PortaBoy game systems. Recall that the cost to produce \(x\) PortaBoys is denoted by \(C(x)\) and the price-demand function, that is, the price to charge in order to sell \(x\) systems is denoted by \(p(x)\). We introduce two more related functions below: the revenue and profit functions.

Said differently, the revenue is the amount of money collected by selling \(x\) items whereas the profit is how much money is left over after the costs are paid.

We hope Example 4 shows the value of using a continuous model to describe a discrete situation. True, we could have ‘run the numbers’ and computed \(P(1)\), \(P(2)\), …, \(P(166)\) to eventually determine the maximum profit, but the vertex formula made much quicker work of the problem.

Along these same lines, in our next example we revisit Skippy’s temperature data from Example ?? in Section ??. We found a piecewise-linear model in Section ?? to model the temperature over the course the day and now we seek a quadratic function to do the job. The methodology used here is similar to that of the least squares regression line discussed in Section ?? but instead of finding the line closest to the data points, we want the parabola closest to them that comes from a function of the form \(f(x) = ax^{2} + bx + c\). The Mathematics required to find the desired quadratic function is beyond the scope of this text, but most graphing utilities can do these quickly. In the quadratic case, the machine will return a value of \(R^{2}\) such that \(0 \leq R^{2} \leq 1\). The closer \(R^{2}\) is to \(1\), the better the fit. (Again, how \(R^{2}\) is computed is beyond this text.)

It is interesting how close the predictions from Examples ?? and 5 despite one using linear models and one using a quadratic model. Which model is the ‘better’ model? We leave that discussion to the reader and their classmates.

Our next example is classic application of optimizing a quadratic function.

The function \(f\) in Example 6 is called the objective function for this problem - it’s the function we’re trying to optimize. In the case above, we were trying to maximize \(f\). The equation \(\ell +2w = 200\) along with the inequalities \(w>0\) and \(\ell >0\) are called the constraints. As we saw in this example, and as we’ll see again and again, the constraint equation is used to rewrite the objective function in terms of just one of the variables where constraint inequalities, if any, help determine the applied domain.

2 Inequalities involving Quadratic Functions

We now turn our attention to solving inequalities involving quadratic functions. Consider the inequality \(x^2 \leq 6\). We could use the fact that the square root is increasing to get: \(\sqrt {x^2} \leq \sqrt {6}\), or \(|x| \leq \sqrt {6}\). This reduces to \(-\sqrt {6} \leq x \leq \sqrt {6}\) or, using interval notation, \([-\sqrt {6}, \sqrt {6}]\). If, however, we had to solve \(x^2 \leq x+6\), things are more complicated. One approach is to complete the square:

\[ \begin{array}{rcl} x^2 & \leq & x+6 \\ x^2 - x & \leq & 6 \\ x^2 - x + \frac {1}{4} & \leq & 6 + \frac {1}{4} \\ \left (x - \frac {1}{2} \right )^2 & \leq & \frac {25}{4} \\ \sqrt {\left (x - \frac {1}{2} \right )^2} & \leq & \sqrt {\frac {25}{4}} \\ \left | x - \frac {1}{2} \right | & \leq & \frac {5}{2} \\ -\frac {5}{2} \quad \leq & x - \frac {1}{2} & \leq \quad \frac {5}{2} \\ -2 \quad & \leq x \leq & 3 \\ \end{array} \]

We get the solution \([-2,3]\). While there is nothing wrong with this approach, we seek methods here that will generalize to higher degree polynomials such as those we’ll see in Section ??.

To that end, we look at the inequality \(x^2 \leq x+6\) graphically. Identifying \(f(x) = x^2\) and \(g(x) = x+6\) , we graph \(f\) and \(g\) on the same set of axes below and look for where the graph of \(f\) (the parabola) meets or is below the graph of \(g\) (the line).

There are two points of intersection which we determine by solving \(f(x) = g(x)\) or \(x^2=x+6\). As usual, we rewrite this equation as \(x^2-x-6 = 0\) in order to use the primary tools we’ve developed to handle these types of quadratic equations: factoring, or failing that, the Quadratic Formula. We find \(x^2-x-6 = (x+2)(x-3)\) so we get two solutions to \((x+2)(x-3) = 0\), namely \(x = -2\) and \(x = 3\). Putting these together with the graph, we obtain the same solution: \([-2,3]\).

Yet a third way to attack \(x^2 \leq x+6\) is to rewrite the inequality as \(x^2-x-6 \leq 0\). Here, we graph \(f(x) = x^2-x-6\) to look for where the graph meets or is below the graph of \(g(x) = 0\), a.k.a. the \(x\)-axis.

To find where the graph of \(f\) meets the \(x\)-axis, we find the zeros of \(f\) by solving \(f(x) = x^2-x-6=0\). We obtain \(x =-2\) and \(x = 3\) as before, and find the same solution, \([-2,3]\).

One advantage to using this last approach is that we are essentially concerned with one function and its zeros. This approach can be generalized to all functions - not just quadratics, so we take the time to develop this method more thoroughly now.

Consider the graph of \(f(x) = x^2-x-6\) below.

The zeros of \(f\) are \(x=-2\) and \(x=3\) and they divide the domain (the \(x\)-axis) into three intervals: \((-\infty , -2)\), \((-2,3)\) and \((3, \infty )\). For every number in \((-\infty , -2)\), the graph of \(f\) is above the \(x\)-axis; in other words, \(f(x) > 0\) for all \(x\) in \((-\infty , -2)\). Similarly, \(f(x) < 0\) for all \(x\) in \((-2,3)\), and \(f(x) > 0\) for all \(x\) in \((3, \infty )\). We represent this schematically with the sign diagram below.

The \((+)\) above a portion of the number line indicates \(f(x) > 0\) for those values of \(x\) and the \((-)\) indicates \(f(x) < 0\) there. The numbers labeled on the number line are the zeros of \(f\), so we place \(0\) above them. For the inequality \(f(x) = x^2-x-6 \leq 0\), we read from the sign diagram that the solution is \([-2,3]\).

Our next goal is to establish a procedure by which we can generate the sign diagram without graphing the function. While parabolas aren’t that bad to graph knowing what we know, our sights are set on more general functions whose graphs are more complicated.

An important property of parabolas is that a parabola can’t be above the \(x\)-axis at one point and below the \(x\)-axis at another point without crossing the \(x\)-axis at some point in between. Said differently, if the function is positive at one point and negative at another, the function must have at least one zero in between. This property is a consequence of quadratic functions being continuous. A precise definition of ‘continuous’ requires the language of Calculus, but it suffices for us to know that the graph of a continuous function has no gaps or holes. This allows us to determine the sign of all of the function values on a given interval by testing the function at just one value in the interval.

The result below applies to all continuous functions defined on an interval of real numbers, but we restrict our attention to quadratic functions for the time being,

Steps for Creating A Sign Diagram for A Quadratic Function

Suppose \(f\) is a quadratic function.

  1. Find the zeros of \(f\) and place them on the number line with the number \(0\) above them.
  2. Choose a real number, called a test value, in each of the intervals determined in step 1.
  3. Determine and record the sign of \(f(x)\) for each test value in step 2.

To use a sign diagram to solve an inequality, we must always remember to compare the function to \(0\).

Solving Inequalities using Sign Diagrams

To solve an inequality using a sign diagram:

  1. Rewrite the inequality so some function \(f(x)\) is being compared to ‘\(0\).’
  2. Make a sign diagram for \(f\).
  3. Record the solution.

We practice this approach in the following example.

We end this section with an example that combines quadratic inequalities with piecewise functions.