2.7: New Functions From Old

It is possible to take multiple functions, smash them together, and the result is still a function!

There are two ways:

Using Operations


$+, -, \times, \div$ functions together is simple: just substitute. But...

When you are subtracting and multiplying functions with two or more terms, do not forget parenthesis.
Suppose $f(x) = x^2 + x$ and $g(x) = -x^2 - x$.
Evaluate and expand/simplify $f(x)+g(x), f(x)-g(x)$ and$ f(x)g(x)$ and find their domains.
Substituting and expanding: \begin{align} f(x) + g(x) &= x^2 + x + -x^2 - x \\&= \boxed{0} \end{align} \begin{align} f(x) - g(x) &= x^2 + x - (-x^2 - x) \\&= x^2 + x + x^2 + x \\&= \boxed{2x^2 + 2x} \end{align} \begin{align} f(x)g(x) &= (x^2 + x)(-x^2 - x) \\&= (x^2 + x)(-x^2) + (x^2 + x)(-x) \\&= -x^4 - x^3 - x^3 - x^2 \\&= \boxed{-x^4 - 2x^3 - x^2} \end{align}

When you cancel a common factor in a divided function, you must exclude the zero of that factor from the domain.

Such a factor is called a hole.

With the functions from the previous example, evaluate $\dfrac{f(x)}{g(x)}$ and find the domain.
\begin{align} \frac{f(x)}{g(x)} &= \frac{x^2 + x}{-x^2 -x} \\&= \frac{x(x+1)}{-x(x + 1)} \\&= \frac{1}{-1} \\&= \boxed{-1 , \ x \neq 0, x \neq -1} \end{align} The holes are at $x = 0$ and $x = -1$. Remove the holes to obtain the domain: $(-\infty, -1) \cup (-1, 0) \cup (0, \infty)$.

Here's a typical problem from Calculus.

Suppose \begin{align} f(x) &= (2x+1)^2 \\ f'(x) &= 4(2x+1) \\ g(x) &= (3x^2 - 2)^2 \\ g'(x) &= 12x(3x^2 - 2) \end{align} Simplify $\dfrac{g(x)f'(x) - f(x)g'(x)}{\left[g(x)\right]^2}$.
Upon substitution, you need to simplify a fraction. Section 1.4 says to factor and cancel.
Don't forget parentheses! \begin{align} \dfrac{g(x)f'(x) - f(x)g'(x)}{\left[g(x)\right]^2} &= \dfrac{(3x^2 - 2)^2\cdot 4(2x+1) - (2x+1)^2\cdot 12x(3x^2 - 2)}{\left[(3x^2 - 2)^2\right]^2} \\&= \dfrac{4(2x+1)(3x^2 - 2)\left[(3x^2 - 2) - 3x(2x+1)\right]}{(3x^2 - 2)^4} \\&= \dfrac{4(2x+1)(3x^2 - 2)(3x^2 - 2 - 6x^2 - 3x)}{(3x^2 - 2)^4} \\&= \dfrac{4(2x+1)(-3x^2 -3x - 2)}{(3x^2 - 2)^3} \\&= \boxed{-\dfrac{4(2x+1)(3x^2 + 3x + 2)}{(3x^2 - 2)^3}} \end{align}

Using Composition (evaluation)


What if we evaluate a function on another function? This idea is called function composition.

composite function
Given two functions $f$ and $g$, the composite function $f \circ g$ is defined by \[(f\circ g)(x) = f(g(x))\]

To evaluate a function composition, you first plug in $g(x)$ into $f(x)$, and wherever there is an $x$ in $f(x)$, substitute the definition of $g(x)$ there.

Suppose $f(x) = x^2$ and $g(x) = x-3$. Find $f\circ g, g \circ f, (f\circ g)(5), (g\circ f)(5)$

We see that \[(f\circ g)(x) = f(g(x)) = f(x-3) = (x-3)^2\] and \[(g\circ f)(x) = g(f(x)) = g(x^2) = x^2 - 3\] Thus $(f\circ g)(5) = (5-3)^2 = 4$ and $(g\circ f)(5) = 5^2 - 3 = 22$.
Ideas:

We can also take compositions of three or more functions. For example, $f\circ g \circ h = f(g(h(x)))$.

Find $f\circ g \circ h$ where $f(x) = \frac{x}{x+1}, g(x) = x^{10}, h(x) = x+3$.
\begin{align} (f\circ g \circ h)(x) &= f(g(h(x)))\\ &= f(g(x+3))\\ &= f((x+3)^{10})\\ &= \frac{(x+3)^{10}}{(x+3)^{10}+1} \end{align}

In Calculus, given a composition, you will be expected to find a decomposition.

Try to pick parent functions, except for the function $f(x) = x$.

Given $F(x) = \sqrt[2]{x + 4}$, find functions $f$ and $g$ such that $F = f\circ g$.

We can think of this function as $\sqrt[2]{\cdot}$ as the outside function, and $x+4$ as the inside function.

Since $f\circ g$ is the desired composition, let $g(x) = x+4$ and $f(x) = \sqrt[2]{x}$.

Then \[(f\circ g)(x) = f(g(x)) = f(x+4) = \sqrt[2]{x+4} = F(x)\]

Also, in Calculus, when you pick a decomposition, try to pick a function that isn't a composition itself.

Given $F(x) = \sqrt[3]{(3x^2 + 1)^2}$, find functions $f$ and $g$ such that $F = f\circ g$.
Refer to in-class notes.