Learn on PengiOpenStax Algebra and TrigonometryChapter 3: Functions

Lesson 3.4: Composition of Functions

In this Grade 7 math lesson from OpenStax Algebra and Trigonometry, students learn how to combine functions using algebraic operations — including addition, subtraction, multiplication, and division of functions — and how to create new functions through composition, written in the form C(T(d)). Students practice evaluating composite functions, finding the domain of a composite function, and decomposing a composite function back into its component parts. This lesson builds essential skills for understanding how functions interact and depend on one another within Chapter 3: Functions.

Section 1

📘 Composition of Functions

New Concept

Function composition links functions by using the output of one as the input for another, creating a new function: (fg)(x)=f(g(x))(f \circ g)(x) = f(g(x)). You'll learn how to build, evaluate, find the domain of, and decompose these functions.

What’s next

Now, let's put this concept into practice. You'll work through interactive examples using formulas, tables, and graphs to master function composition.

Section 2

Combining functions using algebraic operations

Property

For two functions f(x)f(x) and g(x)g(x) with real number outputs, we define new functions f+gf + g, fgf - g, fgfg, and fg\frac{f}{g} by the relations

(f+g)(x)=f(x)+g(x) (f + g)(x) = f(x) + g(x)
(fg)(x)=f(x)g(x) (f - g)(x) = f(x) - g(x)
(fg)(x)=f(x)g(x) (fg)(x) = f(x)g(x)
(fg)(x)=f(x)g(x)where g(x)0 (\frac{f}{g})(x) = \frac{f(x)}{g(x)} \quad \text{where } g(x) \neq 0

Examples

  • Given f(x)=3x+2f(x) = 3x+2 and g(x)=x2g(x) = x^2, the sum is (f+g)(x)=f(x)+g(x)=(3x+2)+x2=x2+3x+2(f+g)(x) = f(x) + g(x) = (3x+2) + x^2 = x^2+3x+2.
  • Given f(x)=2x2f(x) = 2x^2 and g(x)=5x1g(x) = 5x-1, the difference is (fg)(x)=f(x)g(x)=2x2(5x1)=2x25x+1(f-g)(x) = f(x) - g(x) = 2x^2 - (5x-1) = 2x^2-5x+1.
  • Given f(x)=x216f(x) = x^2-16 and g(x)=x4g(x) = x-4, the quotient is (fg)(x)=x216x4=(x4)(x+4)x4=x+4(\frac{f}{g})(x) = \frac{x^2-16}{x-4} = \frac{(x-4)(x+4)}{x-4} = x+4, for x4x \neq 4.

Explanation

Think of this as regular arithmetic, but for functions. For any given input xx, you find the outputs f(x)f(x) and g(x)g(x) and then add, subtract, multiply, or divide them just like numbers. This creates a new combined function.

Section 3

Composition of Functions

Property

When the output of one function is used as the input of another, we call the entire operation a composition of functions. For any input xx and functions ff and gg, this action defines a composite function, which we write as fgf \circ g such that

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

The domain of the composite function fgf \circ g is all xx such that xx is in the domain of gg and g(x)g(x) is in the domain of ff.

Examples

  • If f(x)=x+5f(x) = x+5 and g(x)=x2g(x) = x^2, then f(g(x))f(g(x)) means we plug g(x)g(x) into ff. So, f(g(x))=f(x2)=x2+5f(g(x)) = f(x^2) = x^2+5.
  • If f(x)=x+5f(x) = x+5 and g(x)=x2g(x) = x^2, then g(f(x))g(f(x)) means we plug f(x)f(x) into gg. So, g(f(x))=g(x+5)=(x+5)2=x2+10x+25g(f(x)) = g(x+5) = (x+5)^2 = x^2+10x+25.
  • If r(t)r(t) is the radius of a balloon after tt seconds and V(r)V(r) is the volume for a given radius rr, then V(r(t))V(r(t)) represents the volume of the balloon as a function of time.

Explanation

Function composition is like a chain reaction. The input xx goes into function gg, and its output, g(x)g(x), becomes the input for function ff. The order matters, as f(g(x))f(g(x)) is usually different from g(f(x))g(f(x)).

Section 4

Evaluating composite functions

Property

To evaluate a composite function, we work from the inside out.

  1. Evaluate the inside function using the input value or variable provided.
  2. Use the resulting output as the input to the outside function.

Examples

  • Given f(x)=2x+1f(x) = 2x+1 and h(x)=x2h(x) = x^2, to evaluate f(h(3))f(h(3)), first find h(3)=32=9h(3) = 3^2 = 9. Then use this output as the input for ff: f(9)=2(9)+1=19f(9) = 2(9)+1 = 19.
  • Given f(t)=t25f(t) = t^2-5 and h(x)=2xh(x) = 2x, to evaluate h(f(2))h(f(2)), first find f(2)=225=1f(2) = 2^2-5 = -1. Then use this output as the input for hh: h(1)=2(1)=2h(-1) = 2(-1) = -2.
  • From a table where g(4)=7g(4)=7 and f(7)=1f(7)=1, evaluating f(g(4))f(g(4)) means finding g(4)g(4) first, which is 7. Then we find f(7)f(7), which is 1. So, f(g(4))=1f(g(4))=1.

Explanation

Always start with the innermost function. Calculate its value for the given input first. Then, take that result and use it as the new input for the outer function to get your final answer. It is a two-step process.

Section 5

Domain of a Composite Function

Property

The domain of a composite function f(g(x))f(g(x)) is the set of those inputs xx in the domain of gg for which g(x)g(x) is in the domain of ff.
To find the domain of a composition f(g(x))f(g(x)):

  1. Find the domain of gg.
  2. Find the domain of ff.
  3. Find those inputs xx in the domain of gg for which g(x)g(x) is in the domain of ff. Exclude inputs xx from the domain of gg for which g(x)g(x) is not in the domain of ff.

Examples

  • For f(x)=1x2f(x) = \frac{1}{x-2} and g(x)=3x4g(x) = \frac{3}{x-4}, the domain of gg is x4x \neq 4. We also need g(x)2g(x) \neq 2. Solving 3x4=2\frac{3}{x-4}=2 gives x=5.5x=5.5. So the domain is (,4)(4,5.5)(5.5,)(-\infty, 4) \cup (4, 5.5) \cup (5.5, \infty).
  • For f(x)=x3f(x) = \sqrt{x-3} and g(x)=2x+5g(x) = 2x+5, the domain of gg is all real numbers. We need the output g(x)g(x) to be in the domain of ff, so g(x)3g(x) \ge 3. This means 2x+532x+5 \ge 3, which simplifies to x1x \ge -1. The domain is [1,)[-1, \infty).
  • For f(x)=1xf(x) = \frac{1}{x} and g(x)=x225g(x) = x^2-25, the domain of gg is all real numbers. We need g(x)0g(x) \neq 0, so x2250x^2-25 \neq 0. This means x5x \neq 5 and x5x \neq -5. The domain is (,5)(5,5)(5,)(-\infty, -5) \cup (-5, 5) \cup (5, \infty).

Explanation

To find the domain of a composite function, you must satisfy two conditions. First, the input xx must be allowed in the inner function gg. Second, the output of the inner function, g(x)g(x), must be an allowed input for the outer function ff.

Section 6

Decomposing a composite function

Property

To decompose a function, we write it as a composition of two simpler functions. When looking for a decomposition of f(x)f(x) into g(h(x))g(h(x)), we search for a function h(x)h(x) inside the formula for f(x)f(x). Then the outer function g(x)g(x) is what remains. There may be more than one way to decompose a composite function.

Examples

  • To decompose f(x)=(2x7)4f(x) = (2x-7)^4, we can choose the inner part as h(x)=2x7h(x) = 2x-7. The outer operation is raising to the fourth power, so g(x)=x4g(x) = x^4.
  • To decompose f(x)=x2+9f(x) = \sqrt{x^2+9}, we can choose the expression inside the square root as the inner function: h(x)=x2+9h(x) = x^2+9. The outer function is then g(x)=xg(x) = \sqrt{x}.
  • To decompose f(x)=5x+3f(x) = \frac{5}{x+3}, we can set the denominator as the inner function, h(x)=x+3h(x) = x+3. The outer function then becomes g(x)=5xg(x) = \frac{5}{x}.

Explanation

Decomposition is like working backward. You look at a complex function and try to spot an 'inner' piece. This inner piece becomes your inside function, h(x)h(x), and the operation being performed on it becomes your outer function, g(x)g(x).

Book overview

Jump across lessons in the current chapter without opening the full course modal.

Continue this chapter

Chapter 3: Functions

  1. Lesson 1

    Lesson 3.1: Functions and Function Notation

  2. Lesson 2

    Lesson 3.2: Domain and Range

  3. Lesson 3

    Lesson 3.3: Rates of Change and Behavior of Graphs

  4. Lesson 4Current

    Lesson 3.4: Composition of Functions

  5. Lesson 5

    Lesson 3.5: Transformation of Functions

  6. Lesson 6

    Lesson 3.6: Absolute Value Functions

  7. Lesson 7

    Lesson 3.7: Inverse Functions

Lesson overview

Expand to review the lesson summary and core properties.

Expand

Section 1

📘 Composition of Functions

New Concept

Function composition links functions by using the output of one as the input for another, creating a new function: (fg)(x)=f(g(x))(f \circ g)(x) = f(g(x)). You'll learn how to build, evaluate, find the domain of, and decompose these functions.

What’s next

Now, let's put this concept into practice. You'll work through interactive examples using formulas, tables, and graphs to master function composition.

Section 2

Combining functions using algebraic operations

Property

For two functions f(x)f(x) and g(x)g(x) with real number outputs, we define new functions f+gf + g, fgf - g, fgfg, and fg\frac{f}{g} by the relations

(f+g)(x)=f(x)+g(x) (f + g)(x) = f(x) + g(x)
(fg)(x)=f(x)g(x) (f - g)(x) = f(x) - g(x)
(fg)(x)=f(x)g(x) (fg)(x) = f(x)g(x)
(fg)(x)=f(x)g(x)where g(x)0 (\frac{f}{g})(x) = \frac{f(x)}{g(x)} \quad \text{where } g(x) \neq 0

Examples

  • Given f(x)=3x+2f(x) = 3x+2 and g(x)=x2g(x) = x^2, the sum is (f+g)(x)=f(x)+g(x)=(3x+2)+x2=x2+3x+2(f+g)(x) = f(x) + g(x) = (3x+2) + x^2 = x^2+3x+2.
  • Given f(x)=2x2f(x) = 2x^2 and g(x)=5x1g(x) = 5x-1, the difference is (fg)(x)=f(x)g(x)=2x2(5x1)=2x25x+1(f-g)(x) = f(x) - g(x) = 2x^2 - (5x-1) = 2x^2-5x+1.
  • Given f(x)=x216f(x) = x^2-16 and g(x)=x4g(x) = x-4, the quotient is (fg)(x)=x216x4=(x4)(x+4)x4=x+4(\frac{f}{g})(x) = \frac{x^2-16}{x-4} = \frac{(x-4)(x+4)}{x-4} = x+4, for x4x \neq 4.

Explanation

Think of this as regular arithmetic, but for functions. For any given input xx, you find the outputs f(x)f(x) and g(x)g(x) and then add, subtract, multiply, or divide them just like numbers. This creates a new combined function.

Section 3

Composition of Functions

Property

When the output of one function is used as the input of another, we call the entire operation a composition of functions. For any input xx and functions ff and gg, this action defines a composite function, which we write as fgf \circ g such that

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

The domain of the composite function fgf \circ g is all xx such that xx is in the domain of gg and g(x)g(x) is in the domain of ff.

Examples

  • If f(x)=x+5f(x) = x+5 and g(x)=x2g(x) = x^2, then f(g(x))f(g(x)) means we plug g(x)g(x) into ff. So, f(g(x))=f(x2)=x2+5f(g(x)) = f(x^2) = x^2+5.
  • If f(x)=x+5f(x) = x+5 and g(x)=x2g(x) = x^2, then g(f(x))g(f(x)) means we plug f(x)f(x) into gg. So, g(f(x))=g(x+5)=(x+5)2=x2+10x+25g(f(x)) = g(x+5) = (x+5)^2 = x^2+10x+25.
  • If r(t)r(t) is the radius of a balloon after tt seconds and V(r)V(r) is the volume for a given radius rr, then V(r(t))V(r(t)) represents the volume of the balloon as a function of time.

Explanation

Function composition is like a chain reaction. The input xx goes into function gg, and its output, g(x)g(x), becomes the input for function ff. The order matters, as f(g(x))f(g(x)) is usually different from g(f(x))g(f(x)).

Section 4

Evaluating composite functions

Property

To evaluate a composite function, we work from the inside out.

  1. Evaluate the inside function using the input value or variable provided.
  2. Use the resulting output as the input to the outside function.

Examples

  • Given f(x)=2x+1f(x) = 2x+1 and h(x)=x2h(x) = x^2, to evaluate f(h(3))f(h(3)), first find h(3)=32=9h(3) = 3^2 = 9. Then use this output as the input for ff: f(9)=2(9)+1=19f(9) = 2(9)+1 = 19.
  • Given f(t)=t25f(t) = t^2-5 and h(x)=2xh(x) = 2x, to evaluate h(f(2))h(f(2)), first find f(2)=225=1f(2) = 2^2-5 = -1. Then use this output as the input for hh: h(1)=2(1)=2h(-1) = 2(-1) = -2.
  • From a table where g(4)=7g(4)=7 and f(7)=1f(7)=1, evaluating f(g(4))f(g(4)) means finding g(4)g(4) first, which is 7. Then we find f(7)f(7), which is 1. So, f(g(4))=1f(g(4))=1.

Explanation

Always start with the innermost function. Calculate its value for the given input first. Then, take that result and use it as the new input for the outer function to get your final answer. It is a two-step process.

Section 5

Domain of a Composite Function

Property

The domain of a composite function f(g(x))f(g(x)) is the set of those inputs xx in the domain of gg for which g(x)g(x) is in the domain of ff.
To find the domain of a composition f(g(x))f(g(x)):

  1. Find the domain of gg.
  2. Find the domain of ff.
  3. Find those inputs xx in the domain of gg for which g(x)g(x) is in the domain of ff. Exclude inputs xx from the domain of gg for which g(x)g(x) is not in the domain of ff.

Examples

  • For f(x)=1x2f(x) = \frac{1}{x-2} and g(x)=3x4g(x) = \frac{3}{x-4}, the domain of gg is x4x \neq 4. We also need g(x)2g(x) \neq 2. Solving 3x4=2\frac{3}{x-4}=2 gives x=5.5x=5.5. So the domain is (,4)(4,5.5)(5.5,)(-\infty, 4) \cup (4, 5.5) \cup (5.5, \infty).
  • For f(x)=x3f(x) = \sqrt{x-3} and g(x)=2x+5g(x) = 2x+5, the domain of gg is all real numbers. We need the output g(x)g(x) to be in the domain of ff, so g(x)3g(x) \ge 3. This means 2x+532x+5 \ge 3, which simplifies to x1x \ge -1. The domain is [1,)[-1, \infty).
  • For f(x)=1xf(x) = \frac{1}{x} and g(x)=x225g(x) = x^2-25, the domain of gg is all real numbers. We need g(x)0g(x) \neq 0, so x2250x^2-25 \neq 0. This means x5x \neq 5 and x5x \neq -5. The domain is (,5)(5,5)(5,)(-\infty, -5) \cup (-5, 5) \cup (5, \infty).

Explanation

To find the domain of a composite function, you must satisfy two conditions. First, the input xx must be allowed in the inner function gg. Second, the output of the inner function, g(x)g(x), must be an allowed input for the outer function ff.

Section 6

Decomposing a composite function

Property

To decompose a function, we write it as a composition of two simpler functions. When looking for a decomposition of f(x)f(x) into g(h(x))g(h(x)), we search for a function h(x)h(x) inside the formula for f(x)f(x). Then the outer function g(x)g(x) is what remains. There may be more than one way to decompose a composite function.

Examples

  • To decompose f(x)=(2x7)4f(x) = (2x-7)^4, we can choose the inner part as h(x)=2x7h(x) = 2x-7. The outer operation is raising to the fourth power, so g(x)=x4g(x) = x^4.
  • To decompose f(x)=x2+9f(x) = \sqrt{x^2+9}, we can choose the expression inside the square root as the inner function: h(x)=x2+9h(x) = x^2+9. The outer function is then g(x)=xg(x) = \sqrt{x}.
  • To decompose f(x)=5x+3f(x) = \frac{5}{x+3}, we can set the denominator as the inner function, h(x)=x+3h(x) = x+3. The outer function then becomes g(x)=5xg(x) = \frac{5}{x}.

Explanation

Decomposition is like working backward. You look at a complex function and try to spot an 'inner' piece. This inner piece becomes your inside function, h(x)h(x), and the operation being performed on it becomes your outer function, g(x)g(x).

Book overview

Jump across lessons in the current chapter without opening the full course modal.

Continue this chapter

Chapter 3: Functions

  1. Lesson 1

    Lesson 3.1: Functions and Function Notation

  2. Lesson 2

    Lesson 3.2: Domain and Range

  3. Lesson 3

    Lesson 3.3: Rates of Change and Behavior of Graphs

  4. Lesson 4Current

    Lesson 3.4: Composition of Functions

  5. Lesson 5

    Lesson 3.5: Transformation of Functions

  6. Lesson 6

    Lesson 3.6: Absolute Value Functions

  7. Lesson 7

    Lesson 3.7: Inverse Functions