1.2 Operations on Functions

We can combine functions in different ways through operations of:

Addition: [latex](𝑓+𝑔)(π‘₯)= 𝑓(π‘₯)+𝑔(π‘₯)[/latex]

Subtraction: [latex](π‘“βˆ’π‘”)(π‘₯)= 𝑓(π‘₯)βˆ’π‘”(π‘₯)[/latex]

Multiplication: [latex](𝑓\cdot 𝑔)(π‘₯)= 𝑓(π‘₯)\cdot 𝑔(π‘₯)[/latex]

Division: [latex]\left(\dfrac{f}{g}\right)(x)=\dfrac{f(x)}{g(x}; \ \ \ \ \ \ \ g(x)\neq 0[/latex]

Composition: [latex](f\circ g)(x)=f(g(x))[/latex]

 

The first four operations should not be surprising or complex to do, but one, as always, must be caareful. Here is an example: Suppose [latex]f(x)=x^2-3x+4[/latex] and [latex]g(x)=x-50[/latex]. Then,

\[
\begin{align*}
(f+g)(x)&=f(x)+g(x)=x^2-3x+4+x-50=x^2-2x-46\\
\\
(f-g)(x)&=f(x)-g(x)=x^2-3x+4-(x-50)\\
&=x^2-3x+4-x+50=x^2-4x+54\\
\\
(f\cdot g)(x)&=f(x)\cdot g(x)=(x^2-3x+4)\cdot(x-50)\\
&=x^3-50x^2-3x^2+150x+4x-200\\
&=x^3-53x^2+154x-200\\
\\
\left(\frac{f}{g}\right)(x)&=\frac{f(x)}{g(x)}=\frac{x^2-3x+4}{x-50}; \ \ \ \ \ \ \Β  x\neq 50
\end{align*}
\]

Note the importance of using brackets when appropriate. Some of the most common mistakes students make are in subtraction and multiplication, by forgetting to add brackets appropriately and then removing them appropriately through algebraic operations on the expressions involved.

Why is this important in business? It is because fundamental business relationships are often represented through functions and combinations of functions that arise from operations on other functions. Here are a couple of examples:

Revenue: [latex]R(p)=x(p)\cdot p[/latex], where [latex]x(p)[/latex] is the number of units sold at price [latex]p[/latex].

Profit: [latex]P(x)=R(x)-C(x)[/latex], where [latex]R(x)[/latex] is the revenue from selling [latex]x[/latex] units and [latex]C(x)[/latex] is the cost of producing [latex]x[/latex] units.

Average cost: [latex]\bar{C}(x)=\frac{C(x)}{x}, \ x>0[/latex], where [latex]C(x)[/latex] is the cost of producing [latex]x[/latex] units.

The last operation listed above is the composition of functions. It is used when one function is applied on the result of another function.

Composition of Functions

Suppose we wanted to calculate how much it costs to heat a house on a particular day of the year. The cost to heat a house will depend on the average daily temperature, and the average daily temperature depends on the particular day of the year.

Notice how we have just defined two relationships: The cost depends on the temperature and the temperature depends on the day. Using descriptive variables, we can use function notation for these two functions:

The first function, [latex]C(T)[/latex], gives the cost [latex]C[/latex] of heating a house when the average daily temperature is [latex]T[/latex] degrees Celsius, and the second, [latex]T(d)[/latex], gives the average daily temperature of a particular city on day [latex]d[/latex] of the year. If we wanted to determine the cost of heating the house on the fifth day of the year, we could do this by linking our two functions together, an idea called composition of functions. Using the function [latex]T(d)[/latex], we could evaluate [latex]T(5)[/latex] to determine the average daily temperature on the fifth day of the year. We could then use that temperature as the input to the [latex]C(T)[/latex] function to find the cost to heat the house on the fifth day of the year: [latex]C(T(5))[/latex].

Composition of Functions

When the output of one function is used as the input of another, we call the entire operation a composition of functions. We write [latex]f(g(x))[/latex], and read this as β€œf of g of x” or β€œf composed with g at x”.

An alternate notation for composition uses the composition operator: [latex]\circ[/latex]

Using the composition operator, [latex](f\circ g)(x)[/latex] is read β€œf of g of x” or β€œf composed with g at x”, just like [latex]f(g(x))[/latex].

 

Example 1

Suppose [latex]c(s)[/latex] gives the number of calories burned doing [latex]s[/latex] sit-ups, and [latex]s(t)[/latex] gives the number of sit-ups a person can do in [latex]t[/latex] minutes. Interpret [latex]c(s(3))[/latex].

Answer:

When we are asked to interpret, we are being asked to explain the meaning of the expression in words. The inside expression in the composition is [latex]s(3)[/latex]. Since the input to the [latex]s[/latex] function is time, the 3 is representing 3 minutes, and [latex]s(3)[/latex] is the number of sit-ups that can be done in 3 minutes. Taking this output and using it as the input to the [latex]c(s)[/latex] function will give us the calories that can be burned by the number of sit-ups that can be done in 3 minutes.

Composition of Functions using Tables and Graphs

When working with functions given as tables and graphs, we can look up values for the functions using a provided table or graph. We start evaluation from the provided input, and first evaluate the inside function. We can then use the output of the inside function as the input to the outside function. To remember this, always work from the inside out.

Example 2

Using the graphs below, evaluate [latex](f\circ g)(1)[/latex] .

[latex]g(x)[/latex]

 

[latex]f(x)[/latex]

 

Answer:

To evaluate [latex](f\circ g)(1)[/latex], we start with the inside evaluation. We evaluate [latex]g(1)[/latex] using the graph of the [latex]g(x)[/latex] function, finding the input of 1 on the horizontal axis and finding the output value of the graph at that input. Here, [latex]g(1)=3[/latex]. Using this value as the input to the [latex]f[/latex] function, [latex]f(g(1))=f(3)[/latex]. We can then evaluate this by looking to the graph of the [latex]f(x)[/latex] function, finding the input of 3 on the horizontal axis, and reading the output value of the graph at this input. Here, [latex]f(3)=6[/latex], so [latex]f(g(1))=6[/latex].

Mathematically, we write this process as follows:

[latex](f\circ g)(1)=f(g(1))=f(3)=6[/latex]

Compositions using Formulas

When evaluating a composition of functions where we have either created or been given formulas, the concept of working from the inside out remains the same. First we evaluate the inside function using the input value provided, then use the resulting output as the input to the outside function.

Example 3

Given [latex]f(x)=x^2-x[/latex] and [latex]h(x)=3x+2[/latex], find [latex](f\circ h)(x)[/latex] and evaluate [latex](f\circ h)(1)[/latex].

Answer:

\begin{align*}
(f\circ h)(x)&=f(h(x))=f(3x+2)=(3x+2)^2-(3x+2)\\
& =9x^2+12x+4-3x-2\\
&=9x^2+9x+2
\end{align*}

From this follows that

\[ (f\circ h)(1)=9(1)^2+9(1)+2=20\]

We are not limited, however, to using a numerical value as the input to the function. We can put anything into the function: a value, a different variable, or even an algebraic expression, provided we use the input expression everywhere we see the input variable.

 

Example 4

Let [latex]f(x)=x^2[/latex] and [latex]g(x)=\dfrac{1}{x}-2x[/latex]. Find [latex](f\circ g)(x)[/latex] and [latex](g\circ f)(x)[/latex].

Answer:

To find [latex]f(g(x))[/latex], note that [latex]f[/latex] is applied to [latex]g[/latex] and so [latex]g[/latex] is the inside function and [latex]f[/latex] is the outside function. So we have:
\begin{align*}
(f\circ g)(x)&=f(g(x))=f\left(\dfrac{1}{x}-2x\right)Β =\left(\dfrac{1}{x}-2x\right)^2
\end{align*}
Likewise, to find [latex]g(f(x))[/latex], we evaluate the inside, which is [latex]f(x)[/latex], and then we evaluate [latex]g(x)[/latex] using [latex]f(x)[/latex] as the input: \[(g\circ f)(x)=g(f(x))=g(x^2)=\dfrac{1}{x^2}-2x^2\]

Note that the expressions for [latex](f\circ g)(x)[/latex] and [latex]g\circ f)(x)[/latex] in the above example were different. This is true in general. In compositions of functions, order matters and, except in very specific cases, the resulting function is different if the inside and the outside functions are reversed.

Example 5

A city manager determines that the tax revenue, [latex]R[/latex], in millions of dollars collected on a population of [latex]p[/latex] thousand people can be modeled by the function [latex]R(p)=0.03p+\sqrt{p}[/latex] and that the city’s population, in thousands, is predicted to follow the formula [latex]p(t)=60+2t+0.3t^2[/latex], where [latex]t[/latex] is measured in years after 2010. Find the formula for the tax revenue as a function of the year.

Answer:

Since we want tax revenue as a function of the year, we want year to be our initial input, and revenue to be our final output. To find revenue, we will first have to predict the city population, and then use that result as the input to the tax function. So we need to find [latex](R\circ p)(t)).[/latex] Evaluating this,
\begin{align*}
(R\circ p)(t))&=R(p(t)) = R(60+2t+0.3t^2)\\
& = 0.03(60+2t+0.3t^2)+\sqrt{60+2t+0.3t^2}
\end{align*}

This composition gives us a single formula which can be used to predict the tax revenue during a given year, without needing to find the intermediary population value. For example, to predict the tax revenue in 2017, when [latex]t = 7[/latex] (because [latex]t[/latex] is measured in years after 2010),
\begin{align*}
(R\circ p)(7))&=R(p(7)) \\
&= 0.03\left(60+2(7)+0.3\left(7^2\right)\right)+\sqrt{60+2(7)+0.3\left(7^2\right)}\\
\approx & 12.079\text{ million dollars}
\end{align*}

Later in this course, it will be necessary to know how to decompose a composite function, i.e. to write it as a composition of two simpler functions.

Example 6

Write [latex]f(x)=3+\sqrt{5-x^2}[/latex] as a composition of two functions.

Answer:

We are looking for two functions, [latex]g[/latex] and [latex]h[/latex], so that [latex]f(x)=g(h(x))[/latex]. To do this, we look for a function inside a function in the formula for [latex]f(x)[/latex]. As one possibility, we note that the square root component cannot be calculated before [latex]5-x^2[/latex] is calculated. So that tells us that there are layers of functions and [latex]5-x^2[/latex] can be thought of as the inside function. Once [latex]5-x^2[/latex] is calculated, then one can take the square root of it and add 3 to get the final result. So this tells us that we can decompose the function [latex]f(x)[/latex] using \[h(x)=5-x^2, \quad g(x)=3+\sqrt{x}\] where [latex]h[/latex] is the inner and [latex]g[/latex] is the outer function.

We can check our answer by recomposing the functions: \[(g\circ h)(x)=g(h(x))=g(5-x^2)=3+\sqrt{5-x^2}=f(x)\]

Note that this is not the only solution to the problem. Another non-trivial decomposition would be \[h(x)=x^2, \quad g(x)=3+\sqrt{5-x}\] Verify.

Concept Check

Test your understanding of how to determine compositions of functions using their formulas.

MathMatize: Compositions of functions

Transformations of Functions

One application of compositions of functions is transformations of functions. Transformations allow us to construct new functions from our basic types of functions. We will discuss the following transformations:

  • vertical shift
  • horizontal shift
  • reflection in the [latex]x[/latex] axis
  • reflection in the [latex]y[/latex] axis
  • vertical stretch/compression
  • horizontal stretch/compression

The most basic transformations are shifting the graph vertically or horizontally.

Vertical Shift

Given a function [latex]f(x)[/latex], if we define a new function [latex]g(x)[/latex] as [latex]g(x)=f(x)+k[/latex], where [latex]k[/latex] is a constant, then [latex]g(x)[/latex] is a vertical shift of the function [latex]f(x)[/latex], where all the output values have been increased by [latex]k[/latex].
If [latex]k[/latex] is positive, then the graph will shift up. If [latex]k[/latex] is negative, then the graph will shift down.

Visual demonstration:

Follow the link below and use the slider for the vertical shift parameter [latex]k[/latex] to see the effect of adding [latex]k[/latex] to the value of function [latex]f(x)[/latex]. In this demonstration we use the function [latex]f(x)=x^3[/latex] but you can change it to a function of your choice to explore this transformation in different settings.

Vertical shift

Horizontal Shift

Given a function [latex]f(x)[/latex], if we define a new function [latex]g(x)[/latex] as [latex]g(x)=f(x+k)[/latex], where [latex]k[/latex] is a constant, then [latex]g(x)[/latex] is a horizontal shift of the function [latex]f(x)[/latex], where all the input values have been increased by [latex]k[/latex].
If [latex]k[/latex] is positive, then the graph will shift left. If [latex]k[/latex] is negative, then the graph will shift right.

 

Visual demonstration:

Follow the link below and use the slider for the horizontal shift parameter [latex]k[/latex] to see the effect of adding [latex]k[/latex] to the value ofΒ  [latex]x[/latex]. In this demonstration we use the function [latex]f(x)=x^3[/latex] but you can change it to a function of your choice to explore this transformation in different settings.

Horizontal shift

 

Example 7

Given [latex]f(x)=|x|[/latex], sketch a graph of [latex]h(x)=f(x+1)-3=|x+1|-3[/latex].

Answer:

The function $latex $ is our basic absolute value function. We know that this graph has a V shape, with the point at the origin. The graph of [latex]h[/latex] has transformed [latex]f[/latex] in two ways: [latex]f(x+1)[/latex] is a change on the inside of the function, giving a horizontal shift left by 1, then the subtraction by 3 in [latex]f(x+1)-3[/latex] is a change to the outside of the function, giving a vertical shift down by 3. Transforming the graph gives:

Example 8

Write a formula for the graph shown, a transformation of the toolkit square root function.

Answer:

The graph of the toolkit function starts at the origin, so this graph has been shifted 1 to the right, and up 2. In function notation, we could write that as [latex]h(x)=f(x-1)+2[/latex]. Using the formula for the square root function we can write [latex]h(x)=\sqrt{x-1}+2[/latex].

Note that this transformation has changed the domain and range of the function. This new graph has domain [latex][1,\infty)[/latex] and range [latex][2,\infty)[/latex].

Another transformation that can be applied to a function is a reflection over the horizontal or vertical axis.

Reflections

Given a function [latex]f(x)[/latex], if we define a new function [latex]g(x)[/latex] as [latex]-f(x)[/latex],
then [latex]g(x)[/latex] is a vertical reflection of the function [latex]f(x)[/latex], sometimes called a reflection about the x-axis.

If we define a new function [latex]g(x)[/latex] as [latex]f(-x)[/latex],
then [latex]g(x)[/latex] is a horizontal reflection of the function [latex]f(x)[/latex], sometimes called a reflection about the [latex]y[/latex]-axis.

Visual demonstration:

Follow the links below to see the effect of changing the sign of [latex]x[/latex] and the sign of [latex]f(x)[/latex]. In this demonstration we use the function [latex]f(x)=x^3[/latex] but you can change it to a function of your choice to explore this transformation in different settings.

Reflection across the horizontal axis

Reflection across the vertical axis

Example 9

A common model for learning has an equation similar to [latex]k(t)=-2^t+1[/latex] , where [latex]k[/latex] is the percentage of mastery that can be achieved after [latex]t[/latex] practice sessions. This is a transformation of the function [latex]f(t)=2^t[/latex] shown here. Sketch the graph of [latex]k(t)[/latex].

[latex]f(t)=2^t[/latex]

 

Answer:

This function is a combination of three transformations into one transformation.

a vertical reflection:
[latex]f(-t)=2^{-t}[/latex]
combined with

a horizontal reflection:
[latex]-f(-t)=-2^{-t}[/latex]
combined with

a vertical shift up 1:
[latex]-f(-t)+1=-2^{-t}+1[/latex].

We can sketch a graph by applying these transformations one at a time to the original function:

The original graph

 

Horizontally reflected

 

Then vertically reflected

 

Then, after shifting up 1, we get the final graph: \[k(t)=-f(-t)+1=-2^{-t}+1\]

Final graph

 

Note: As a model for learning, this function would be limited to a domain of [latex]t\geq 0[/latex], with corresponding range [latex][0,1)[/latex].

With horizontal and vertical shifts, we saw the effect of adding or subtracting to the inputs or outputs of a function. We now explore the effects of multiplying the outputs.

Vertical Stretch/Compression

Given a function [latex]f(x)[/latex], if we define a new function [latex]g(x)[/latex] as [latex]g(x)=k\cdot f(x)[/latex], where k is a constant, then [latex]g(x)[/latex] is a vertical stretch or compression of the function [latex]f(x)[/latex].

  • If [latex]k \gt 1[/latex], then the graph will be stretched
  • If [latex]0\lt k \lt 1[/latex], then the graph will be compressed
  • If [latex]k \lt 0[/latex], then there will be combination of a vertical stretch or compression with a vertical reflection

 

Example 10

The graph below is a transformation of the toolkit function [latex]f(x)=x^3[/latex]. Relate this new function [latex]g(x)[/latex] to [latex]f(x)[/latex], then find a formula for [latex]g(x)[/latex].

When trying to determine a vertical stretch or shift, it is helpful to look for a point on the graph that is relatively clear. In this graph, it appears that [latex]g(2)=2[/latex]. With the basic cubic function at the same input, [latex]f(2)=2^3=8[/latex]. Based on that, it appears that the outputs of [latex]g[/latex] are [latex]\frac{1}{4}[/latex] the outputs of the function [latex]f[/latex], since [latex]g(2)=\frac{1}{4}f(x)[/latex]. From this we can fairly safely conclude that \[g(x)=\frac{1}{4}f(x).\]
We can write a formula for [latex]g[/latex] by using the definition of the function [latex]f[/latex]: \[g(x)=\frac{1}{4}f(x)=\frac{1}{4}x^3.\]

Visual demonstration:

Follow the links below to see the effect of multiplying the value of [latex]f(x)[/latex] by a parameter [latex]k[/latex]. In this demonstration we use the function [latex]f(x)=x^3[/latex] but you can change it to a function of your choice to explore this transformation in different settings.

Vertical compression/stretch

Combining Transformations

Since transformations are compositions of functions, when combining transformations, it is very important to consider the order of the transformations. For example, vertically shifting by 3 and then vertically stretching by 2 does not create the same graph as vertically stretching by 2 and then vertically shifting by 3. The order follows from analyzing the order of operations.

Combining Vertical Transformations

When combining vertical transformations written in the form [latex]a\cdot f(x)+k[/latex], first vertically stretch by [latex]a[/latex], then vertically shift by [latex]k[/latex].

As a rule, when translating an algebraic transformation into a graph, follow the order of operations as they are applied on the input value.

Example 11

Write an equation for the transformed graph of the quadratic function shown.

Since this is a quadratic function, first consider what the basic quadratic tool kit function looks like and how this has changed. Observing the graph, we notice several transformations: The original tool kit function has been flipped over the x axis, some kind of stretch or compression has occurred, and we can see a shift to the right 3 units and a shift up 1 unit. In total there are four operations:

  1. Vertical Reflection, requiring a negative sign outside the function.
  2. Vertical Stretch
  3. Horizontal Shift Right 3 units, which tells us to put x-3 on the inside of the function.
  4. Vertical Shift up 1 unit, telling us to add 1 on the outside of the function.

By observation, the basic tool kit function has a vertex at (0, 0) and symmetrical points at (1, 1) and (-1, 1). These points are 1 unit up and 1 unit over from the vertex. The new points on the transformed graph are 1 unit away horizontally but 2 units away vertically. They have been stretched vertically by 2.
Not everyone can see this by simply looking at the graph. If you can, great, but if not we can solve for it. First, we will write the equation for this graph, with an unknown vertical stretch:

[latex]f(x)=x^2[/latex]
The original function

[latex]-f(x)=-x^2[/latex]
Vertically reflected

[latex]-a\cdot f(x)=-a x^2[/latex]
Vertically stretched

[latex]-a\cdot f(x-3)=-a(x-3)^2[/latex]
Shifted right 3

[latex]-a\cdot f(x-3)+1=-a(x-3)^2+1[/latex]
Shifted up 1

We now know our graph is going to have an equation of the form [latex]g(x)=-a(x-3)^2+1[/latex]. To find the vertical stretch, we can identify any point on the graph (other than the highest point), such as the point (2,-1), which tells us [latex]g(2)=-1[/latex]. Using our general formula, and substituting 2 for [latex]x[/latex], and -1 for [latex]g(x)[/latex].
This tells us that to produce the graph we need a vertical stretch by two.
Thus the function that produces this graph is \[g(x)=-2(x-3)^2+1.\]

Example 12

On what interval(s) is the function [latex]g(x)=\dfrac{-2}{(x-1)^2}+3[/latex] increasing and decreasing?
This is a transformation of the basic reciprocal squared function, [latex]f(x)=\dfrac{1}{x^2}[/latex]

Answer:

The function [latex]g(x)[/latex] is a transformation of the basic reciprocal squared function, which is increasing on [latex](-\infty,0)[/latex] and decreasing on [latex](0,\infty)[/latex]. Analyze the transformation and the consequent effect on the function trends.

Step by step transformations from [latex]f(x)=\dfrac{1}{x^2}[/latex] to [latex]g(x)=\dfrac{-2}{(x-1)^2}+3[/latex]:

[latex]-2f(x)=\dfrac{-2}{x^2}[/latex]
A vertical flip and vertical stretch by 2

[latex]-2f(x-1)=\dfrac{-2}{(x-1)^2}[/latex]
A shift right by 1

[latex]-2f(x-1)+3=\dfrac{-2}{(x-1)^2}+3[/latex]
A shift up by 3

Because of the vertical flip, the [latex]g(x)[/latex] function will be decreasing on the left and increasing on the right. The horizontal shift right by 1 will also shift these intervals to the right one. From this, we can determine [latex]g(x)[/latex] will be increasing on [latex](1,\infty)[/latex] and decreasing on [latex](-\infty,1)[/latex]. We also could graph the transformation to help us determine these intervals.

Graph of the transformed function.

Exercises

In questions 1. – 10., perform the indicated operation.

  1. [latex]g(t)=t-5; f(t)=2t-2; (g\cdot f)(t)=?[/latex]
  2. [latex]f(n)=2n-4; g(n)=n^2-n; (f\circ g)(n)=?[/latex]
  3. [latex]f(n)=n^2+5n; g(n)=4n-5; (f-g)(n)=?[/latex]
  4. [latex]g(a)=4a+1; f(a)=\sqrt{3a+1}; \left(\frac{g}{f}\right)(a)=?[/latex]
  5. [latex]g(x)=x^2+x+3; h(x)=(4x+2)^2; (g\circ h)(x)=?[/latex]
  6. [latex]f(n)=4n+4; g(n)=n-2; (f-g)(n)=?[/latex]
  7. [latex]N(t)=4t+5; p(t)=t^2+4; (N\circ p)(t)=?[/latex]
  8. [latex]f(x)=-x+4; g(x)=3x^2-1; \left(\frac{f}{g}\right)(x)=?[/latex]
  9. [latex]g(n)=2n+3;f(n)=-3n^3-2n^2; (g\cdot f)(n)=?[/latex]
  10. [latex]g(a)=3a+1; f(a)=3a; (2g-3f)(a)=?[/latex]

 

License

Share This Book