Functions#

A function is a rule that assigns each input exactly one output. We call the output the image of the input. The set of all inputs for a function is called the domain. The set of all allowable outputs is called the codomain. We would write \(f : X → Y\) to describe a function with name \(f\), domain \(X\) and codomain \(Y\). This does not tell us which function \(f\) is though. To define the function, we must describe the rule. This is often done by giving a formula to compute the output for any input (although this is certainly not the only way to describe the rule).

For example, consider the function \(f : ℕ → ℕ\) defined by \(f(x) = x ^ 2 + 3\). Here the domain and codomain are the same set (the natural numbers). The rule is: take your input, multiply it by itself and add \(3\).This works because we can apply this rule to every natural number (every element of the domain) and the result is always a natural number (an element of the codomain). Notice though that not every natural number is actually an output (there is no way to get \(0\), \(1\), \(2\), \(5\), etc.). The set of natural numbers that are outputs is called the range of the function (in this case, the range is \(\{ 3, 4, 7, 12, 19, 28, ... \}\), all the natural numbers that are 3 or more than a perfect square).

The key thing that makes a rule a function is that there is exactly one output for each input. That is, it is important that the rule be a good rule. What output do we assign to the input \(7\)? There can only be one answer for any particular.

Function Properties

  1. Injection

  2. Surjection

  3. Bijection

How To Find Domain of a Function

For polynomial functions, the domain is \(D(-∞, ∞)\).

For rational functions, equate the denominator not equal to \(0\), and solve to isolate \(x\). Example:

\[ \begin{align}\begin{aligned}f(x) = \frac{5}{x - 2}\\x - 2 ≠ 0\\x ≠ 2\end{aligned}\end{align} \]

Therefore, the domain of \(f(x)\) is \(D(-∞, 2) ∪ D(2, ∞)\).

For radical functions, equate the radicand not equal to \(0\), and solve to isolate \(x\).

Arithmetic Operations#

Addition#

To add two functions, you combine their outputs for the same input by writing \((f + g)(x) = f(x) + g(x)\).

How To Add Functions

Write the rule

Express the sum as the two individual function rules added together.

Substitute expressions

Replace \(f(x)\) and \(g(x)\) with their algebraic formulas.

Combine like terms

Group matching variable powers and constants to simplify the final expression.

Example

Given \(f(x) = 2x + 1\) and \(g(x) = 3x ^ 2 - 5\):

Set up the addition:

\[(f + g)(x) = (2x + 1) + (3x ^ 2 - 5)\]

Order by powers:

\[(f + g)(x) = 3x^2 + 2x + 1 - 5\]

Simplify constants:

\[(f + g)(x) = 3x^2 + 2x - 4\]

Subtraction#

Subtracting two functions means creating a new function by taking the output of the second function away from the first, written as \((f - g)(x) = f(x) - g(x)\).

How To Subtract Functions

Write the rule

Express the operation as \((f - g)(x) = f(x) - g(x)\)

Use parentheses

Put the second function \(g(x)\) inside parentheses.

Distribute the negative

Multiply every term inside the second function’s parentheses by \(-1\).

Combine like terms

Add or subtract matching power terms to simplify the final expression.

Example

Given \(f(x) = 3x - 4\) and \(g(x) = x^2 + 1\):

Set up the subtraction:

\[(f - g)(x) = (3x - 4) - (x^2 + 1)\]

Distribute the negative sign:

\[(f - g)(x) = 3x - 4 - x^2 - 1\]

Combine like terms and rearrange:

\[(f - g)(x) = -x^2 + 3x - 5\]

Multiplication#

To multiply two functions, you multiply their individual outputs together for any given input \(x\), written as \((f ⋅ g)(x) = f(x) ⋅ g(x)\).

How To Multiply Functions

Write the rule

The product of two functions is written as \((f ⋅ g)(x)\) or \(f(x) ⋅ g(x)\).

Substitute the expressions

Replace \(f(x)\) and \(g(x)\) with their given algebraic formulas.

Expand and distribute

Use the distributive property, FOIL (First, Outer, Inner, Last), or a multiplication grid to multiple the terms.

Combine like-terms

Add or subtract any matching power terms to simplify the final polynomial expression.

Example

Given \(f(x) = 2x - 3\) and \(g(x) = x + 1\), find \((f ⋅ g)(x)\):

Set up the product:

\[(f ⋅ g)(x) = (2x - 3)(x + 1)\]

Distribute each term and multiply:

\[(f ⋅ g)(x) = 2x^2 + 2x - 3x - 3\]

Combine like-terms:

\[(f ⋅ g)(x) = 2x^2 - x - 3\]

Division#

The division of two functions, \(f(x)\) and \(g(x)\), is written as \((f / g)(x)\) and equals \(\frac{f(x)}{g(x)}\), provided that the denominator \(g(x)\) is not equal to zero.

How To Divide Functions

Notation

Write the first function over the second function as a fraction.

Domain restrictions

Exclude any x-values that make the denominator \(g(x) = 0\).

Simplification

Factor the numerator and denominator when possible to reduce the rational expression to its simplest form.

Example

Given \(f(x) = 2x^2 + 15x - 8\) and \(g(x) = x^2 + 10x + 16\):

Divide:

\[\frac{f(x)}{g(x)} = \frac{2x^2 + 15x - 8}{x^2 + 10x + 16}\]

Factor:

\[\frac{f(x)}{g(x)} = \frac{(2x - 1)(x + 8)}{(x + 2)(x + 8)}\]

Simplify:

\[\frac{f(x)}{g(x)} = \frac{2x - 1}{x + 2}\]

With the restriction \(x ≠ -8\) and \(x ≠ -2\).

Composite#

A composite function is a new function created by using the output of one function as the input for another function.

How It Works

Inside Out

Always evaluate the inner function first, then plug that result into the other function.

Notation

Written as \((f ∘ g)(x)\) or \(f(g(x))\), which means \(g(x)\) goes inside \(f(x)\)

Order matters

In most cases, \(f(g(x))\) is different from \(g(f(x))\).

Example

Given \(f(x) = x^2\) and \(g(x) = x + 3\):

To find \(f(g(x))\), replace the \(x\) in \(f(x)\) with the expression for \(g(x)\):

\[ \begin{align}\begin{aligned}(f ∘ g)(x) = x ^ 2\\(f ∘ g)(x) = g(x) ^ 2\end{aligned}\end{align} \]

Substitute \(x + 3\) into \(x ^ 2\):

\[(f ∘ g)(x) = (x + 3) ^ 2\]

Expand the result:

\[(f ∘ g)(x) = x^2 + 6x + 9\]

Inverse#

An inverse function is a mathematical operation that reverses or “undoes” the actions of an original function, written as \(f^{-1}(x)\).

How To Find the Inverse

  1. Replace \(f(x)\) with \(y\).

  2. Swap every \(x\) with \(y\) and every \(y\) with \(x\).

  3. Solve the new equation to get \(y\) by itself.

  4. Replace \(y\) with the inverse notation \(f^{-1}(x)\).

Example

Find the inverse of \(f(x) = 2x - 7\):

Step 1: Replace \(f(x)\) with \(y\):

\[ \begin{align}\begin{aligned}f(x) = 2x - 7\\y = 2x - 7\end{aligned}\end{align} \]

Step 2: Swap \(x\) and \(y\):

\[x = 2y - 7\]

Step 3: Add \(7\) to both sides, the ndivide by \(2\):

\[ \begin{align}\begin{aligned}x + 7 = 2y\\y = \frac{x + 7}{2}\end{aligned}\end{align} \]

Step 4: Replace \(y\) with the inverse notation:

\[f^{-1}(x) = \frac{x + 7}{2}\]

Types of Functions#

Glossary#

A function is a rule that assigns each element of a set, called the domain, to exactly one element of a second set, called the codomain.

Notation \(f:X→Y\) is the way of saying that the function is called \(f\), the domain is the set \(X\), and the codomain is the set \(Y\).

To specify the rule for a function with small domain, user two-line notation by writing a matrix with each output directly below its corresponding input, as in:

\[\begin{split}f = \begin{pmatrix}1 & 2 & 3 & 4 \\ 2 & 1 & 3 & 1 \end{pmatrix}\end{split}\]

\(f(x)=y\) means the element \(x\) of the domain (input) is assigned to the element \(y\) of the codomain. We say \(y\) is an output. Alternatively, we call \(y\) the image of \(x\) under \(f\).

The range is a subset of the codomain. It is the set of all elements which are assigned to at least one element of the domain by the function. That is, the range is the set of all outputs.

A function is injective if every element of the codomain is the image of at most one element from the domain.

A function is surjective if every element of the codomain is the image of at least one element from the domain.

A bijection is a function which is both an injection and surjection. In other words, if every element of the codomain is the image of exactly one element from the domain.

The image of an element \(x\) in the domain is the element \(y\) in the codomain that \(x\) is mapped to. That is, the image of \(x\) under \(f\) is \(f(x)\).

The complete inverse image of an element \(y\) in the codomain, written \(f^{-1}(y)\), is the set of all elements in the domain which are assigned to \(y\) by the function.

The image of a subset \(A\) of the domain is the set \(f(A) = \{ f(a) \in Y:a \in A \}\).

The inverse image of a subset \(B\) of the codomain is the set \(f^{-1}(B) = \{ x \in X:f(x) \in B \}\).


Sources

discrete.openmathbooks.org