Notes on Function Composition: Examples and DIY Problem (copy)
Composition of Functions: Overview and Procedure
- When we compose functions, the result is a new function defined by plugging the inside function into the outside function: (f \circ g)(x) = f(g(x)) .
- This shows we can compose entire functions, not just plug in a single value for x.
- General approach to (f \circ g):
- Identify f and g.
- Compute the inner function g(x).
- Substitute g(x) into f to obtain the composed function: (f \circ g)(x) = f(g(x)) .
- Simplify the expression if possible.
- Determine the domain of the composition using the rule: \mathrm{Dom}(f \circ g) = { x \in \mathrm{Dom}(g) \mid g(x) \in \mathrm{Dom}(f) } \textrm{.}
- Important conceptual points:
- The domain of the composition depends on both the domain of g and the domain of f after substituting g(x).
- You may compose a function with itself, e.g., h(h(x)) , just as you can repeatedly apply a function.
- In practice, you often simplify the inner expression first, then substitute and simplify the outer expression.
Example 1: f(x) = \frac{1}{x+1}, g(x) = \frac{5}{2x}
- Define the functions: f(x) = \frac{1}{x+1}, \quad g(x) = \frac{5}{2x} \,.
- Compute the composition:
- (f \circ g)(x) = f\left(g(x)\right) = f\left( \frac{5}{2x} \right) = \frac{1}{\frac{5}{2x} + 1} \,.
- Simplify: ( \frac{1}{\frac{5}{2x} + 1} = \frac{1}{\frac{5+2x}{2x}} = \frac{2x}{5+2x} ).
- Therefore, (f \circ g)(x) = \frac{2x}{5+2x} \,.
- Domain considerations:
- Dom(f) = (-\infty, -1) \cup (-1, \infty).
- Dom(g) = (-\infty, 0) \cup (0, \infty).
- For the composition, x must be in Dom(g) and g(x) must be in Dom(f): so we require g(x) \neq -1.
- Solve for g(x) \neq -1: \n \frac{5}{2x} \neq -1 \quad \Rightarrow\quad 5 \neq -2x \quad \Rightarrow\quad x \neq -\tfrac{5}{2}.
- Thus:
\mathrm{Dom}(f \circ g) = (-\infty, -\tfrac{5}{2}) \cup (-\tfrac{5}{2}, 0) \cup (0, \infty).
- Note: The domain of the simplified form ( \frac{2x}{5+2x} ) excludes the same points: ( x \neq 0 ) (from Dom(g)) and ( x \neq -\tfrac{5}{2} ) (to avoid division by zero in the simplified form).
Example 2: New pair: f(x) = |x|, g(x) = \sqrt{2x-1}
- Compute f \circ g:
- (f \circ g)(x) = f\left( g(x) \right) = |\sqrt{2x-1}| = \sqrt{2x-1} \,.
- Domain for this composition: require g(x) to be defined, i.e., 2x - 1 \ge 0 \Rightarrow x \ge \tfrac{1}{2}.
- Compute g \circ f:
- (g \circ f)(x) = g\left( f(x) \right) = \sqrt{2|x| - 1} \,.
- Domain for this composition: require inside the square root nonnegative: 2|x| - 1 \ge 0 \Rightarrow |x| \ge \tfrac{1}{2} \Rightarrow x \le -\tfrac{1}{2} \text{ or } x \ge \tfrac{1}{2}.
DIY Problem: h(x) = \sqrt{4 - x^2}
- Define: h(x) = \sqrt{4 - x^2} \,.
- Compute h \circ h:
- (h \circ h)(x) = h(h(x)) = \sqrt{4 - (h(x))^2} = \sqrt{4 - (\sqrt{4 - x^2})^2}
- Simplify inside: ( (\sqrt{4 - x^2})^2 = 4 - x^2 )
- So, (h \circ h)(x) = \sqrt{4 - (4 - x^2)} = \sqrt{x^2} = |x| \,.
- Domain for h: require (4 - x^2 \ge 0) ⇒ ( -2 \le x \le 2 ).
- Since the inner output h(x) lies in [0, 2], which is within the outer domain [-2, 2], the composition is defined on the same domain as the inner function:
- Domain of ( h \circ h ) is ([ -2, 2 ]).
- Result summary:
- (h \circ h)(x) = |x|, \quad x \in [-2, 2].
- If desired, piecewise form on this domain is: ( (h \circ h)(x) = -x ) for ( x < 0 ) and ( (h \circ h)(x) = x ) for ( x \ge 0 ).
Quick recap: Key takeaways
- General rule: \mathrm{Dom}(f \circ g) = { x \in \mathrm{Dom}(g) \mid g(x) \in \mathrm{Dom}(f) } ).
- Always verify that the inner function’s output lies in the outer function’s domain before concluding the domain of the composition.
- You can compose with itself; the process is the same as composing two distinct functions and often reveals simplifications or constraints not obvious at first glance.
- Practical tip: when simplifying, keep track of domain restrictions separately from algebraic simplification to ensure the final domain is correct.