4.5 Algebra of Functions & Function Composition

Key Takeaways

  • Function arithmetic defines (f + g)(x), (f - g)(x), (f · g)(x), and (f/g)(x) with domains equal to the intersection D_f ∩ D_g (excluding denominator zeros for quotients).
  • Function composition (f ∘ g)(x) = f(g(x)) evaluates the inner function g(x) first and feeds that output directly into the outer function f(x).
  • The domain of (f ∘ g)(x) consists of all x in the domain of g such that g(x) lies within the domain of f.
  • Function composition is non-commutative in general: f(g(x)) ≠ g(f(x)) for most functions.
  • Decomposing complex composite functions h(x) = f(g(x)) into inner and outer components is an essential analytical skill for calculus.
Last updated: August 2026

4.5 Algebra of Functions & Function Composition

Just as real numbers can be added, subtracted, multiplied, and divided, functions can also be combined using arithmetic operations to create new functions. Furthermore, functions can be composed by using the output of one function as the direct input to another. Understanding function operations, domain restrictions, and composition is essential for advanced algebra and calculus.


1. Arithmetic Operations on Functions

Given two functions f(x)f(x) and g(x)g(x) with domains DfD_f and DgD_g respectively, we define the four fundamental algebraic operations as follows:

  1. Sum Function: (f+g)(x)=f(x)+g(x)(f + g)(x) = f(x) + g(x)
  2. Difference Function: (fg)(x)=f(x)g(x)(f - g)(x) = f(x) - g(x)
  3. Product Function: (fg)(x)=f(x)g(x)(f \cdot g)(x) = f(x) \cdot g(x)
  4. Quotient Function: (fg)(x)=f(x)g(x),where g(x)0\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}, \quad \text{where } g(x) \ne 0

Domain Rules for Arithmetic Combination

For the sum, difference, and product functions, the new domain consists of all real numbers that are common to both individual domains (the intersection of DfD_f and DgD_g):

Domain of (f+g),(fg),(fg)=DfDg\text{Domain of } (f + g), (f - g), (f \cdot g) = D_f \cap D_g

For the quotient function (fg)(x)\left(\frac{f}{g}\right)(x), the domain requires an additional restriction: any input xx that causes the denominator g(x)=0g(x) = 0 must be excluded:

Domain of (fg)={x(DfDg)g(x)0}\text{Domain of } \left(\frac{f}{g}\right) = \{ x \in (D_f \cap D_g) \mid g(x) \ne 0 \}

Worked Example 1: Domain of a Quotient Function

Let f(x)=x1f(x) = \sqrt{x - 1} and g(x)=x5g(x) = x - 5. Determine the domain of (fg)(x)\left(\frac{f}{g}\right)(x).

  • Step 1: Find DfD_f. The radical requires x10    x1x - 1 \ge 0 \implies x \ge 1, so Df=[1,)D_f = [1, \infty).
  • Step 2: Find DgD_g. Polynomial function g(x)=x5g(x) = x - 5 has no restrictions, so Dg=(,)D_g = (-\infty, \infty).
  • Step 3: Intersect domains: DfDg=[1,)D_f \cap D_g = [1, \infty).
  • Step 4: Exclude zeros of g(x)g(x): Set g(x)=0    x5=0    x=5g(x) = 0 \implies x - 5 = 0 \implies x = 5.
  • Conclusion: Exclude x=5x = 5 from [1,)[1, \infty). The domain of (fg)(x)\left(\frac{f}{g}\right)(x) is [1,5)(5,)[1, 5) \cup (5, \infty).

2. Function Composition (fg)(x)(f \circ g)(x)

Function composition is the process of evaluating one function inside another function. The operation is denoted by the circle symbol \circ.

(fg)(x)=f(g(x))(f \circ g)(x) = f\big(g(x)\big)

Read as "ff composed with gg of xx" or "ff of gg of xx".

  • Inner Function (gg): Evaluated first on input xx.
  • Outer Function (ff): Evaluated second on the resulting output g(x)g(x).

Non-Commutativity of Composition

Unlike addition and multiplication, function composition is not commutative. In general:

(fg)(x)(gf)(x)(f \circ g)(x) \ne (g \circ f)(x)

Worked Example 2: Evaluating Composite Functions

Given f(x)=x24f(x) = x^2 - 4 and g(x)=3x+2g(x) = 3x + 2, evaluate (fg)(2)(f \circ g)(2) and (gf)(2)(g \circ f)(2).

  1. Evaluate (fg)(2)=f(g(2))(f \circ g)(2) = f\big(g(2)\big):

    • Compute inner value g(2)g(2): g(2)=3(2)+2=6+2=8g(2) = 3(2) + 2 = 6 + 2 = 8.
    • Substitute into outer function ff: f(8)=(8)24=644=60f(8) = (8)^2 - 4 = 64 - 4 = 60.
    • Thus, (fg)(2)=60(f \circ g)(2) = 60.
  2. Evaluate (gf)(2)=g(f(2))(g \circ f)(2) = g\big(f(2)\big):

    • Compute inner value f(2)f(2): f(2)=(2)24=44=0f(2) = (2)^2 - 4 = 4 - 4 = 0.
    • Substitute into outer function gg: g(0)=3(0)+2=2g(0) = 3(0) + 2 = 2.
    • Thus, (gf)(2)=2(g \circ f)(2) = 2.

Notice that (fg)(2)=602=(gf)(2)(f \circ g)(2) = 60 \ne 2 = (g \circ f)(2), confirming non-commutativity.


3. Finding the Domain of Composite Functions

Determining the domain of (fg)(x)=f(g(x))(f \circ g)(x) = f(g(x)) requires a strict two-step domain analysis:

Domain of (fg)={xDgg(x)Df}\text{Domain of } (f \circ g) = \{ x \in D_g \mid g(x) \in D_f \}

To find the domain of (fg)(x)(f \circ g)(x) algebraically:

  1. Step 1: State any domain restrictions on the inner function g(x)g(x) (xDgx \in D_g).
  2. Step 2: Form the combined rule f(g(x))f(g(x)) and state any additional restrictions imposed by the outer function.
  3. Step 3: Take the intersection of both sets of restrictions.

Worked Example 3: Rational Composite Domain

Find the domain of (fg)(x)(f \circ g)(x) where f(x)=1x9f(x) = \frac{1}{x - 9} and g(x)=x2g(x) = x^2.

  • Step 1: Inner function g(x)=x2g(x) = x^2 has domain Dg=(,)D_g = (-\infty, \infty). No inner restrictions.
  • Step 2: Compose rule: (fg)(x)=f(x2)=1x29(f \circ g)(x) = f(x^2) = \frac{1}{x^2 - 9}. The outer function requires the denominator x290x^2 - 9 \ne 0: x290    (x3)(x+3)0    x3 and x3x^2 - 9 \ne 0 \implies (x - 3)(x + 3) \ne 0 \implies x \ne 3 \text{ and } x \ne -3
  • Step 3: Combining all restrictions gives: Domain: (,3)(3,3)(3,)\text{Domain: } (-\infty, -3) \cup (-3, 3) \cup (3, \infty)

4. Decomposing Composite Functions

In advanced mathematics and calculus (such as using the Chain Rule), it is often necessary to reverse the composition process by breaking a single complex function h(x)h(x) into an inner function g(x)g(x) and an outer function f(x)f(x) such that h(x)=f(g(x))h(x) = f(g(x)).

Strategy for Decomposition

  1. Identify the Inner Function g(x)g(x): Look for expressions inside parentheses, under radicals, inside absolute value bars, or in denominators.
  2. Replace g(x)g(x) with variable uu or xx: The remaining outer structure becomes f(x)f(x).

Worked Example 4: Decomposing a Radical Expression

Decompose h(x)=4x293h(x) = \sqrt[3]{4x^2 - 9} into h(x)=f(g(x))h(x) = f(g(x)).

  • Identify inner function: The expression inside the cube root is g(x)=4x29g(x) = 4x^2 - 9.
  • Identify outer function: Replacing the inner expression with variable input xx yields f(x)=x3f(x) = \sqrt[3]{x}.
  • Check composition: f(g(x))=f(4x29)=4x293=h(x)f(g(x)) = f(4x^2 - 9) = \sqrt[3]{4x^2 - 9} = h(x), verifying the decomposition.
Test Your Knowledge

Given f(x) = x^2 - 4 and g(x) = 3x + 2, what is the value of (f ∘ g)(2)?

A
B
C
D
Test Your Knowledge

What is the domain of (f ∘ g)(x) where f(x) = 1 / (x - 9) and g(x) = x^2?

A
B
C
D
Test Your Knowledge

If f(x) = sqrt(x - 1) and g(x) = x - 5, what is the domain of the quotient function (f/g)(x)?

A
B
C
D
Test Your Knowledge

Which choice represents a correct decomposition of h(x) = cube root of (4x^2 - 9) into inner function g(x) and outer function f(x) such that h(x) = f(g(x))?

A
B
C
D