\chapter{Functions and graphs}
\section{Input and output}
\subsection{Finding the input from a given output}
Given a function, we sometimes know an output value and want to find the corresponding input. This means that
we have an equation such as \(f(x)=y\) where \(y\) is given, and we need to solve the equation for \(x\).
\begin{example}
If we work for \(x\) hours at a job that pays 12 an hour, the function \(f(x)=12x\) represents the amount of money
(in dollars) we earn. We may want to
answer the question: how many hours should we work in order to
earn \$180?
In this example, 180 is the given output, and the quantity we are looking for is the number of hours
\(x\), or the input of the function.
To solve the problem, we substitute the given output value for \(f(x)\) and solve the resulting equation for \(x\): we get \(180=12x\), and dividing by 12, we find
\(x=15\) hours.
\end{example}
The equation in the previous example was easy to solve, because the unknown \(x\) appeared
only once and without any exponent. The next example is harder because it requires \textit{group factoring}.
\begin{example}
Suppose \(f(x)=9x^3+9x^2 -x+3\) and we want to find the input (or inputs) \(x\) that give output \(4\). So we
need to solve the equation \(f(x)=4\):
\[
\begin{array}{rcll}
9x^3+9x^2-x+3&=&4& \mbox{The equation we need to solve}\\[2ex]
9x^3+9x^2-x+3 {\color{red}{-4}}&=&4 {\color{red}{-4}}& \mbox{Subtract 4 from both sides}\\[2ex]
9x^3+9x^2-x-1&=&0& \mbox{Simplify}\\[2ex]
9x^2(x+1)-1(x+1)&=&0& \mbox{Factor \(9x^2\) from the first two terms, and \(-1\) from the last two}\\[2ex]
(x+1)(9x^2-1) &=&0 &\mbox{Factor out the \((x+1)\)}\\[2ex]
(x+1)(3x-1)(3x+1) &=&0 &\mbox{Factor the \(9x^2-1\) }\\[2ex]
x+1=0 \mbox{ or } 3x-1=0 \mbox{ or } 3x+1=0 & &&\mbox{Set each factor equal to 0}\\[2ex]
\displaystyle x=-1 \mbox{ or } x=\frac{1}{3} \mbox{ or } x=-\frac{1}{3} &&&\mbox{Find the solutions}.
\end{array}
\]
\end{example}
In this course, we will often need to solve a \textit{quadratic} equation
\[ax^2+bx+c=0.\]
Such equation can sometimes be solved by factoring, but if that is not possible we need to use the
\textit{quadratic formula}
\[x=\frac{-b\pm \sqrt{b^2-4ac}}{2a}.\]
The next example illustrates a typical use of the quadratic formula.
\begin{example}
The fuel efficiency (in miles per gallon) of a car is given by the formula
\[f(v)=-0.01v^2+1.1v+4.75\]
where \(v\) is the speed of the car (in miles per hour).
So for example if we drive at 80 mph, the fuel efficiency is
\[f(80)=-0.01(80)^2+1.1(80)+4.75=28.75\mbox{ mpg}\]
Suppose we want to find the speed at which we must drive in order to have a fuel efficiency of 32 mpg.
Then we need to solve the equation \(f(v)=32\) for \(v\), or
\(-0.01v^2+1.1v+4.75=32\).
\[
\begin{array}{rcll}
-0.01v^2+1.1v+4.75= 32& \mbox{The equation we need to solve}\\[2ex]
-0.01v^2+1.1v+4.75\color{red}{-32} = 32\color{red}{-32} & \mbox{Subtract 32 from both sides}\\[2ex]
-0.01v^2+1.1v-27.25 = 0& \mbox{Simplify}\\[2ex]
\displaystyle v=\frac{-1.1\pm\sqrt{(1.1)^2-4(-0.01)(-27.25)}}{2(-0.01)} &
\begin{array}{l}
\mbox{Use the quadratic formula with} \\ a=-0.01, b=1.1, c=-27.25 \end{array}\\[2ex]
\displaystyle v=\frac{-1.1\pm\sqrt{0.12}}{-0.02}&\mbox{Simplify}\\[2ex]
\displaystyle v=\frac{-1.1+\sqrt{0.12}}{-0.02} \mbox{ or } \displaystyle v=\frac{-1.1-\sqrt{0.12}}{-0.02}\\[2ex]
v=37.7 \mbox{ mph} \mbox{ or } v=72.3 \mbox{ mph}
\end{array}
\]
So to get a fuel efficiency of 32 miles per gallon we need to drive either at 37.7 mph or at 72.3 mph.
We can check that this is the right
answer by substituting either value of \(v\) in the equation for \(f(v)\) and check that we get 32. (Check that!)
\end{example}
Suppose we are given two functions \(f(x)\) and \(g(x)\).
We may ask the question: when are the two functions equal?
We need to find an input value \(x\) that will produce the same output for the two
functions. This means that we need to form the equation
\[f(x)=g(x)\] and solve it for \(x\).
\begin{example}
We are given \(f(x)=2x+5\) and \(g(x)=3x-1\), and we want to find the input values that make the two functions equal. So we need to solve the equation
\[f(x)=g(x).\]
Substituting the given formulas for \(f(x)\) and \(g(x)\),
in this example we get
\[
\begin{array}{rcll}
2x+5 & = & 3x-1& \mbox{The equation we need to solve}\\[2ex]
2x+5\color{red}{+1} & = & 3x-1 \color{red}{+1} & \mbox{Add 1 to both sides}\\[2ex]
2x+6 & = & 3x& \mbox{Simplify}\\[2ex]
2x+6 \color{red}{-2x}& = & 3x\color{red}{-2x}& \mbox{Subtract \(2x\) from both sides}\\[2ex]
6 & = & x& \mbox{Simplify}
\end{array}
\]
So the input value \(x=6\) will produce the same output for the two functions
(check that!).
\end{example}
\subsection{Zeros of a function}
Of special importance are the input values of a function that will produce zero as output.
These values are called the \textit{zeros} of the function. So the zeros of \(f(x)\) are
found by solving the equation \(f(x)=0\). From the point of view of the graph,
the zeros of a function are just the \(x\)-coordinates of the \(x\)-intercepts. There may be more than
one zero, or there may be none.
\begin{example}
\
\begin{enumerate}
\item
The zeros of \(f(x)= x^2-9\) are found by solving \(x^2-9=0\).
\[\begin{array}{rcll}
x^2-9&=&0 & \mbox{The equation we need to solve}\\[2ex]
x^2-9\color{red}{+9} &=& 0\color{red}{+9} & \mbox{Add 9 to both sides}\\[2ex]
x^2 &=& 9 &\mbox{Simplify}\\[2ex]
x&=&\pm\sqrt{9} & \mbox{Take the square root, with \(\pm\) sign}\\[2ex]
x&=&\pm 3
\end{array}\]
So
\(x=3\) and \(x=-3\) are the zeros of the function.
\item
The zeros of \(g(t)=t^2+4\) are found by solving \(t^2+4=0\). Since \(t^2=-4\) results
in the square root of a negative number, this function has no zeros.
\end{enumerate}
\end{example}
The next example illustrates the \textit{splitting method} that can sometimes be used to solve a quadratic
equation by factoring.
\begin{example}
We are given the function \(f(x)=6x^2-7x-3\) and we want to find the zeros. So we need to solve the equation
\(6x^2-7x-3=0\). Multiply together \(6\) and \(-3\), to get \(6(-3)=-18\). Now look for two numbers that sum to \(-7\)
and that also multiply to \(-18\). Apart from \((6)(3)=18\), another way to factor \(18\) is \((2)(9)=18\), and
so we find \((2)(-9)=-18\), \(2-9=-7\). So the two numbers are \(2\) and \(-9\).
Now we can split the \(-7x\) in the equation using those two numbers, and then do group factoring as in
Example 1.3.2:
\[
\begin{array}{rcll}
6x^2-7x-3&=&0&\\[2ex]
6x^2+2x-9x-3&=&0& \mbox{Split the \(-7x\)}\\[2ex]
2x(3x+1)-3(3x+1)&=&0 &\begin{array}{l}
\mbox{Factor the \(2x\) in first two terms,}\\ \mbox{and }-3 \mbox{ in last two terms}
\end{array}\\[2ex]
(3x+1)(2x-3)&=&0&\mbox{Factor out the \((3x+1)\)}\\[2ex]
3x+1 = 0 \mbox{ or } 2x-3 = 0 &&&\mbox{Set to zero each factor}\\[2ex]
\displaystyle x=-\frac{1}{3} \mbox{ or } x=\frac{3}{2} &&& \mbox{Find the solutions}.
\end{array}
\]
\end{example}
There are equations that do not look quadratic at first sight, but we can turn them into quadratic with a simple
change of variable.
\begin{example}
Consider the function \(f(x)=x^4-x^2-6\), and suppose we want to find the zeros. This means we need to solve the
equation
\[x^4-x^2-6=0.\]
This equation is not quadratic. But if rename \(x^2\) as \(u\), then we find \(x^2=u\), \(x^4=u^2\), and so the equation
becomes quadratic in the variable \(u\):
\[u^2-u-6=0.\]
Then we can solve it by factoring:
\[
\begin{array}{rcll}
u^2-u-6&=&0& \mbox{The given equation}\\[2ex]
(u-3)(u+2)&=&0 & \mbox{Factor}\\[2ex]
u-3=0 \mbox{ or } u+2=0 &&&\mbox{Set each factor equal to 0}\\[2ex]
u=3 \mbox{ or } u=-2 &&& \mbox{Find the solutions for \(u\)}\\[2ex]
x^2=3 \mbox{ or } x^2 = -2 &&&\mbox{Go back to \(x\)}\\[2ex]
x=\pm\sqrt{3} &&& \begin{array}{l}
\mbox{The first equation has two solutions} \\ \mbox{The second equation has no solutions}
\end{array}
\end{array}
\]
\end{example}
Problems
\problem
Let \(g(t)=5t+2\). Find \(t\) such that \(g(t)=17\).
\begin{sol}
We want \(g(t)=17\). So we need to solve the equation:
\[
\begin{array}{rcll}
5t+2 & = & 17 & \mbox{Set \(g(t)=17\)}\\
\ \\
5t+2\color{red}{-2} & = & 17\color{red}{-2} & \mbox{Subtract \(2\)}\\
\ \\
5t & = & 15 & \mbox{Simplify}\\
\ \\
\displaystyle \frac{5t}{\color{red}{5}} & = & \displaystyle \frac{15}{\color{red}{5}} & \mbox{Divide by \(5\)}\\
\ \\
t & = & 3 & \mbox{Find the \(t\) value that gives \(g(t)=17.\)}
\end{array}
\]
\end{sol}
\mproblem
Let \(f(x)=3x-5\). Find \(x\) such that \(f(x)=-11.\)
\problem
Let \(f(x)=x^2-5x-10\). Find all values of \(x\) such that \(f(x)=4\).
\begin{sol}
In this problem we need to solve a quadratic equation.
\[
\begin{array}{rcll}
x^2-5x-10 & = & 4 & \mbox{Set \(f(x)=4\)}\\
\ \\
x^2-5x-10\color{red}{-4}& = & 4\color{red}{-4} & \mbox{Subtract 4 from both sides, to write the equation in standard form}\\
\ \\
x^2-5x-14& = & 0 & \mbox{Simplify}\\
\ \\
(x-7)(x+2) & = & 0 & \mbox{Factor}\\
\ \\
x-7=0 & or & x+2=0 & \mbox{Set each factor equal to \(0\)} \\
\ \\
x=7 & or & x=-2 & \mbox{Find all \(x\)-values that give \(f(x)=4\) (two values.)}\\
\end{array}
\]
\end{sol} \mproblem
Let \(g(t)=t^2-6t+9\). Find all values of \(t\) such that \(g(t)=1\).
\problem
Let \(h(u)=u^4-u^2\). Find all the zeros of \(h(u)\).
\begin{sol}
We need to solve the equation:
\[
\begin{array}{rcll}
u^4-u^2 & = & 0 & \mbox{Set \(h(u)=0\)}\\[2ex]
u^2(u^2-1) & = & 0 & \mbox{Factor}\\[2ex]
u^2(u-1)(u+1) & = & 0 & \mbox{Factor again}\\[2ex]
u^2=0 \mbox{ or } u-1=0 \mbox{ or } u+1=0 & & & \mbox{Set each factor equal to \(0\)}\\[2ex]
u=0 \mbox{ or } u=1 \mbox{ or } u=-1 &&& \mbox{Find the solutions}
\end{array}\]
So there are three zeros:
\(u=0,1,-1\).
\end{sol} \mproblem
Let \(h(z)=z^3+z^2\). Find all the zeros of \(h(z)\).
\problem
Find all the zeros of \(f(t)=t^3-3t^2-4t+12\)
\begin{sol}
We need to solve the equation \(f(t)=0\).
\[
\begin{array}{rcll}
t^3-3t^2-4t+12&=&0 & \mbox{The equation we need to solve}\\[2ex]
t^2(t-3) -4(t-3) &=&0 & \begin{array}{l}
\mbox{Factor \(t^2\) from first two terms,} \\ \mbox{and \(-4\) from last two}
\end{array}\\[2ex]
(t-3)(t^2-4)&=&0& \mbox{Factor out the \((t-3)\)}\\[2ex]
(t-3)(t-2)(t+2)&=&0& \mbox{Factor the \(t^2-4\)}\\[2ex]
t-3=0 \mbox{ or } t-2=0 \mbox{ or } t+2=0 &&&\mbox{Set each factor equal 0}\\[2ex]
t=3 \mbox{ or } t=2 \mbox{ or } t=-2 &&&\mbox{Find the solutions}
\end{array}
\]
\end{sol} \mproblem
Find all the zeros of the function \(g(x)=x^3+2x^2-5x-10\).
\problem
Let \(f(x)=x^4-6x^2+9\). Find all values of \(x\) such that \(f(x)=1\).
\begin{sol}
\[
\begin{array}{rcll}
x^4-6x^2+9&=&1&\mbox{The equation we need to solve}\\[2ex]
x^4-6x^2+9{\color{red}{-1}} &=& 1{\color{red}{-1}}& \mbox{Subtract 1 from both sides}\\[2ex]
x^4-6x^2+8&=&0& \mbox{Simplify}\\[2ex]
u^2-6u+8&=&0&\begin{array}{l}
\mbox{Re-name \(x^2\) as \(u\),}\\ \mbox{so that \(x^4=u^2\)}
\end{array}\\[2ex]
(u-2)(u-4)&=&0&\mbox{Factor}\\[2ex]
u-2 =0 \mbox{ or } u-4=0 &&& \mbox{set each factor to 0}\\[2ex]
u=2 \mbox{ or } u=4 &&&\mbox{Solve for \(u\)}\\[2ex]
x^2=2 \mbox{ or } x^2=4 &&&\mbox{Go back to \(x\)}\\[2ex]
x=\pm\sqrt{2} \mbox{ or } x=\pm 2 &&&\mbox{Solve for \(x\)}
\end{array}
\]
\end{sol} \mproblem
Let \(g(t)=t^4-8t^2+4\). Find all values of \(t\) such that \(f(t)=-3\).
\problem
Let \(f(x)=x^3+x^2\) and \(g(x)=6x\).
Find all \(x\) such that \(f(x)=g(x)\).
\begin{sol}
We need to solve the equation:
\[
\begin{array}{rcll}
x^3+x^2 & = & 6x & \mbox{Set \(f(x)=g(x)\)}\\
\ \\
x^3+x^2 \color{red}{-6x} & = & 0\color{red}{-6x} & \mbox{Subtract \(6x\) from both sides}\\
\ \\
x^3+x^2-6x & = & 0 & \mbox{Simplify}\\
\ \\
x(x^2+x-6) & = & 0 & \mbox{Factor the GCF}\\
\ \\
x(x+3)(x-2) & = & 0 & \mbox{Completely factor}\\
\ \\
x=0 \\
x+3=0 & & & \mbox{Set each factor equal to \(0\)}\\
x-2=0 \\
\ \\
x=0 \\
x=-3 & & & \mbox{Find three solutions.}\\
x=2
\end{array}
\]
\end{sol} \mproblem
Let \(f(x)=x^4-2x^2\) and \(g(x)=2x^2\).
Find all \(x\) such that \(f(x)=g(x)\).