Composition of Functions Calculator
Use 'x' as the variable (e.g., x^2 + 5*x – 2)
Results
(f ∘ g)(x)
–
f(g(x))
(g ∘ f)(x)
–
g(f(x))
Understanding Function Composition
In mathematics, the composition of functions is an operation where you apply one function to the result of another. If you have two functions, f(x) and g(x), the composition (f ∘ g)(x) is read as "f of g of x".
The Core Formulas
- 🔵 (f ∘ g)(x) = f(g(x)): You evaluate g(x) first, then plug that result into f.
- 🔴 (g ∘ f)(x) = g(f(x)): You evaluate f(x) first, then plug that result into g.
Step-by-Step Example
Let's say we have the following functions:
- f(x) = x + 5
- g(x) = x2
- x = 3
To find (f ∘ g)(3):
- Find g(3): 32 = 9.
- Plug 9 into f: f(9) = 9 + 5 = 14.
- Result: 14.
To find (g ∘ f)(3):
- Find f(3): 3 + 5 = 8.
- Plug 8 into g: g(8) = 82 = 64.
- Result: 64.
Important Note: Function composition is not usually commutative. This means that (f ∘ g)(x) is rarely equal to (g ∘ f)(x), as shown in the example above (14 vs 64).
Domain and Range Considerations
When working with compositions, the domain of (f ∘ g) is the set of all values x in the domain of g such that g(x) is in the domain of f. This is crucial when dealing with square roots or denominators that cannot be zero.
Common Use Cases
- Physics: Calculating nested rates of change (e.g., how pressure changes over time as altitude changes).
- Economics: Applying a tax function to a price function.
- Computer Science: Piping the output of one algorithm as the input to the next in data processing.