From the free course College Algebra on Lykke
Advanced Functions and Composition
Key concepts: Piecewise functions · Function composition · Verifying inverses · Absolute value transformations
Studying complex function types including piecewise, absolute value, and composite functions.
Advanced Functions and Composition
In the foundational study of algebra, functions are often presented as monolithic entities—a single rule applied to a single input to produce a single output. However, as we transition into higher-level mathematics and engineering, we encounter systems that require more nuance. Real-world phenomena rarely follow a single linear or quadratic trajectory across their entire existence. Instead, they are modular, conditional, and interconnected.
This section delves into the sophisticated architecture of functions. We will explore Piecewise Functions, which allow for conditional logic within a mathematical model; Absolute Value Transformations, which introduce symmetry and non-differentiable "corners"; and Function Composition, the process of chaining operations where the output of one system becomes the raw material for the next. Finally, we will establish the rigorous criteria for Inverses, using composition as the ultimate tool for verification.
Piecewise Functions: Modeling Discontinuity and Conditions
A Piecewise Function is a function defined by multiple sub-functions, each applying to a specific interval of the main function's domain. Mathematically, it is expressed using a large brace to group the various "pieces" and their corresponding constraints.
Definition: A function $f(x)$ is piecewise if: $$f(x) = \begin{cases} g_1(x) & \text{if } x \in D_1 \ g_2(x) & \text{if } x \in D_2 \ \vdots & \vdots \ g_n(x) & \text{if } x \in D_n \end{cases}$$ where $D_1, D_2, \dots, D_n$ are disjoint subsets of the domain.
Why Piecewise Functions Matter
In engineering and economics, piecewise functions are the standard for modeling "threshold" behavior. A classic example is the progressive income tax system, where different tax rates apply only to specific "brackets" of income. Similarly, in physics, the force applied by a spring might be linear (Hooke's Law) until it reaches a point of plastic deformation, at which point the governing equation changes entirely.
Mechanics of Evaluation and Graphing
To evaluate a piecewise function at $x = a$, one must first identify which interval $D_i$ contains $a$, and then apply only the rule associated with that interval.
When graphing, the most critical aspect is handling the boundaries (the "fences"). We use:
- Closed circles (●) for inclusive boundaries ($\le$ or $\ge$).
- Open circles (○) for exclusive boundaries ($<$ or $>$).
| Feature | Description | Visual Representation |
|---|---|---|
| Sub-domain | The specific $x$-range for a rule. | $x < 2$ or $[5, \infty)$ |
| Jump Discontinuity | A gap where the function "jumps" from one value to another. | Vertical break in the graph |
| Point Discontinuity | A single "hole" in an otherwise continuous line. | An open circle at a specific $(x, y)$ |
| Continuity | When the pieces meet exactly at the boundary. | $g_1(k) = g_2(k)$ |
Worked Example: The Shipping Cost Algorithm
Consider a logistics company that charges based on weight $w$:
- $5 flat rate for weights up to 2kg.
- $2 per kg for weights between 2kg and 10kg.
- $1.50 per kg plus a $5 heavy-handling fee for weights over 10kg.
Absolute Value Transformations
The absolute value function, $f(x) = |x|$, is technically the simplest piecewise function: $$|x| = \begin{cases} x & \text{if } x \ge 0 \ -x & \text{if } x < 0 \end{cases}$$ However, its transformations are so common in algebra that they are studied as a distinct class of "V-shaped" functions.
The General Form
The standard transformation model for absolute value is: $$g(x) = a|x - h| + k$$
| Parameter | Effect | Mathematical Name |
|---|---|---|
| $a$ | Changes the "steepness" or flips the V upside down. | Vertical Stretch/Compression & Reflection |
| $h$ | Shifts the vertex left or right. | Horizontal Translation |
| $k$ | Shifts the vertex up or down. | Vertical Translation |
| $(h, k)$ | The "tip" of the V. | Vertex |
How it Works: The Order of Operations
When graphing $g(x) = -2|x + 3| + 4$, follow the "Inside-Out" rule:
- Horizontal Shift: Move left by 3 units ($h = -3$).
- Vertical Stretch/Reflection: Multiply all $y$-values by $-2$. This makes the V narrower and points it downward.
- Vertical Shift: Move the entire structure up 4 units ($k = 4$).
Pitfalls in Absolute Value
A common mistake is treating $|x - h|$ as $|x| - |h|$. This is the Triangle Inequality error. For example, $|5 - 3| = 2$, but $|5| - |3| = 2$ is a coincidence; consider $|3 - 5| = 2$, whereas $|3| - |5| = -2$. Absolute value is non-linear; it does not distribute.
Function Composition: The Pipeline Model
Function Composition is the mathematical equivalent of a "pipe" in computing. It is the application of one function to the results of another.
Notation: The composition of $f$ and $g$ is written as $(f \circ g)(x)$, which is read as "$f$ of $g$ of $x$." $$(f \circ g)(x) = f(g(x))$$
The Mechanics of the "Inner" and "Outer"
In the expression $f(g(x))$, $g(x)$ is the inner function and $f(x)$ is the outer function.
- Input $x$ into $g$.
- Take the output $g(x)$.
- Use that output as the input for $f$.
Domain Restrictions: The Hidden Complexity
The domain of $(f \circ g)(x)$ is not simply the domain of the resulting simplified expression. It is restricted by two conditions:
- $x$ must be in the domain of $g$.
- $g(x)$ must be in the domain of $f$.
If $g(x) = \sqrt{x}$ and $f(x) = \frac{1}{x-4}$, then $x$ must be $\ge 0$ (for $g$) AND $\sqrt{x}$ cannot be 4 (for $f$). Thus, $x \neq 16$. The domain is $[0, 16) \cup (16, \infty)$.
Comparison: $f(g(x))$ vs $g(f(x))$
Composition is not commutative. The order of operations radically changes the result.
| Operation | Definition | Example: $f(x)=x^2, g(x)=x+1$ |
|---|---|---|
| $f(g(x))$ | Apply $g$ then $f$ | $(x+1)^2 = x^2 + 2x + 1$ |
| $g(f(x))$ | Apply $f$ then $g$ | $(x^2) + 1 = x^2 + 1$ |
| $f(f(x))$ | Self-composition | $(x^2)^2 = x^4$ |
Mathematical Derivation: Composing Rational Functions
Let $f(x) = \frac{2}{x-1}$ and $g(x) = \frac{3}{x}$. Find $(f \circ g)(x)$.
(f \circ g)(x) = f(g(x))
= f\left(\frac{3}{x}\right)
= \frac{2}{\left(\frac{3}{x}\right) - 1}
= \frac{2}{\frac{3-x}{x}}
= \frac{2x}{3-x}
Domain constraints: $x \neq 0$ (from $g$) and $x \neq 3$ (from the final denominator).
Verifying Inverses through Composition
The most rigorous way to prove that two functions are inverses of each other is through the Inverse Function Property.
The Inverse Theorem: Two functions $f$ and $g$ are inverses if and only if:
- $f(g(x)) = x$ for all $x$ in the domain of $g$.
- $g(f(x)) = x$ for all $x$ in the domain of $f$.
If both compositions collapse into the Identity Function $I(x) = x$, the functions effectively "undo" each other.
The Horizontal Line Test
Before seeking an inverse, a function must be one-to-one (injective). If any horizontal line crosses the graph of $f(x)$ more than once, $f(x)$ does not have an inverse function (unless the domain is restricted). For example, $f(x) = x^2$ fails the horizontal line test, but $f(x) = x^2$ for $x \ge 0$ passes.
Step-by-Step Verification
To verify if $f(x) = \frac{x-3}{2}$ and $g(x) = 2x + 3$ are inverses:
- Compute $f(g(x))$: $f(2x + 3) = \frac{(2x + 3) - 3}{2} = \frac{2x}{2} = x$
- Compute $g(f(x))$: $g(\frac{x-3}{2}) = 2(\frac{x-3}{2}) + 3 = (x - 3) + 3 = x$
- Conclusion: Since both equal $x$, they are inverses.
Common Inverse Pairs
| Function $f(x)$ | Inverse $f^{-1}(x)$ | Domain Restriction |
|---|---|---|
| $x^n$ | $\sqrt[n]{x}$ | $x \ge 0$ if $n$ is even |
| $e^x$ | $\ln(x)$ | $x > 0$ for $\ln(x)$ |
| $\frac{1}{x}$ | $\frac{1}{x}$ | $x \neq 0$ (Self-inverse) |
| $ax + b$ | $\frac{x-b}{a}$ | $a \neq 0$ |
Real-World Application: Functional Programming and Data Pipelines
In modern software engineering, the concepts of composition and inverses are used to build robust data pipelines. In functional programming (languages like Haskell, Scala, or Elixir), "composition" is a first-class citizen.
Example: Data Transformation Pipeline
Imagine a system that takes raw user input (string), trims whitespace, converts it to an integer, and then calculates the tax.
This is a direct application of $(f \circ g \circ h)(x)$. If we needed to reverse this process (e.g., to find the original input from the final price), we would need the inverse of each step in reverse order: $h^{-1}(g^{-1}(f^{-1}(y)))$.
Common Pitfalls and Advanced Nuances
-
The "Inverse" vs. "Reciprocal" Confusion: Students often confuse $f^{-1}(x)$ with $\frac{1}{f(x)}$.
- $f^{-1}(x)$ is the inverse function (undoes the operation).
- $[f(x)]^{-1}$ is the reciprocal (multiplicative inverse).
- Example: If $f(x) = x+3$, then $f^{-1}(x) = x-3$, but $[f(x)]^{-1} = \frac{1}{x+3}$.
-
Piecewise Continuity: When designing piecewise functions, ensure the boundaries are defined. If $f(x)$ is defined for $x < 2$ and $x > 2$, the function is undefined at $x=2$. This creates a "hole" in the domain.
-
Composition Order: In $f(g(x))$, always work from the inside out. Evaluating the outer function first is a recipe for algebraic disaster.
-
Absolute Value and Square Roots: Remember that $\sqrt{x^2} = |x|$, not just $x$. This is a fundamental identity that links power functions, radicals, and absolute value.
Study Guide: Advanced Functions
Piecewise Functions
- Definition: Functions with different rules for different domain intervals.
- Key Task: Identify the correct interval before evaluating.
- Graphing: Pay attention to open vs. closed circles at boundaries.
Absolute Value Transformations
- Form: $y = a|x-h|+k$.
- Vertex: Located at $(h, k)$.
- Symmetry: The graph is symmetric about the vertical line $x=h$.
Function Composition
- Notation: $(f \circ g)(x) = f(g(x))$.
- Order: Order matters! $f(g(x)) \neq g(f(x))$ in most cases.
- Domain: The input must survive the inner function AND the resulting output must be valid for the outer function.
Inverses
- Verification: $f(g(x)) = x$ AND $g(f(x)) = x$.
- Existence: Only one-to-one functions have inverses (Horizontal Line Test).
- Graphing: $f(x)$ and $f^{-1}(x)$ are reflections across the line $y=x$.
Interactive demos for this section
- Piecewise Function Interactive Sandbox: a free interactive demo that runs in your browser
Study College Algebra on Lykke
This course page is free to open: signed out, you can read its first two sections, and signing in, on any plan, opens the rest. The free Lykke Chrome extension syncs your own Canvas courses, so ChatGPT, Claude and Muse can answer from your classes and deadlines. It only reads Canvas.
Add the free extensionSign in to open every section