Function Composition Calculator
Substituting one function inside another can give different answers depending on the order. MiniWebtool’s Function Composition Calculator finds both f(g(x)) and g(f(x)), showing the algebraic steps from your two expressions.
For Gemini, paste the copied question into the chat. You can also copy it below.Need help using this tool? Ask AI
View the question
Enter f(x) and g(x) below to get both (f ∘ g)(x) and (g ∘ f)(x) with the algebra steps, and optionally their values at one x.
About Function Composition Calculator
Welcome to our Function Composition Calculator, a free online tool that helps you calculate the composition of two functions with detailed step-by-step instructions. Whether you are a student learning about function composition, preparing for calculus, or a teacher creating examples, this calculator provides clear explanations of the algebraic process.
At a Glance
Function Composition Calculator finds both f(g(x)) and g(f(x)) from two expressions in x. It shows the substitution and simplification steps and detects when the two functions are inverses.
| Feature | What you get | Good for |
|---|---|---|
| Both orders | Computes (f o g)(x) = f(g(x)) and (g o f)(x) = g(f(x)) so you can see that the order changes the result. | Showing that composition is not commutative |
| Function types | Accepts polynomial, rational, radical, exponential, logarithmic and trigonometric functions written with x as the variable. | Algebra and precalculus problems |
| Step-by-step solution | Shows the inner function substituted into the outer one, then the expansion and simplification. | Learning the method for homework |
| Input syntax | Use * for multiplication, ^ or ** for powers, sqrt(x), log(x) for natural log, and exp(x) or e^x. | Typing expressions the tool will read correctly |
| Inverse detection | Detects when f and g are inverse functions, meaning both compositions simplify to x. | Verifying that two functions are inverses |
| Formula display | Results are displayed as typeset LaTeX formulas. | Reading and copying clean notation |
What is Function Composition?
Function composition is the process of combining two functions to create a new function. When we compose functions f and g, we write it as $(f \circ g)(x)$, which is read as "f composed with g" or "f of g of x".
The notation $(f \circ g)(x)$ means $f(g(x))$, where:
- First, we apply g to the input x, getting $g(x)$
- Then, we apply f to that result, getting $f(g(x))$
- The inner function is applied first, then the outer function
How to Calculate Function Composition
To find $(f \circ g)(x) = f(g(x))$, follow these steps:
Step 1: Identify the Inner and Outer Functions
In $(f \circ g)(x)$, g is the inner function (applied first) and f is the outer function (applied second).
Step 2: Substitute g(x) into f(x)
Replace every occurrence of x in f(x) with the entire expression for g(x).
Step 3: Simplify
Expand, combine like terms, factor, or otherwise simplify the resulting expression.
Step 4: Write the Final Answer
Express your result as $(f \circ g)(x) = $ simplified expression.
Important Properties of Function Composition
Function Composition is NOT Commutative
In general, $(f \circ g)(x) \neq (g \circ f)(x)$. The order matters! This is one of the most important properties to remember.
Function Composition is Associative
If you have three functions f, g, and h, then $f \circ (g \circ h) = (f \circ g) \circ h$.
Identity Function
The identity function $I(x) = x$ satisfies $(f \circ I)(x) = (I \circ f)(x) = f(x)$ for any function f.
Inverse Functions
If f and g are inverse functions, then $(f \circ g)(x) = x$ and $(g \circ f)(x) = x$.
Common Examples of Function Composition
| $f(x)$ | $g(x)$ | $(f \circ g)(x) = f(g(x))$ |
|---|---|---|
| $f(x) = 2x + 1$ | $g(x) = x^2$ | $2x^2 + 1$ |
| $f(x) = x^2$ | $g(x) = 2x + 1$ | $(2x + 1)^2 = 4x^2 + 4x + 1$ |
| $f(x) = \sqrt{x}$ | $g(x) = x + 4$ | $\sqrt{x + 4}$ |
| $f(x) = e^x$ | $g(x) = \ln(x)$ | $e^{\ln(x)} = x$ |
| $f(x) = \ln(x)$ | $g(x) = e^x$ | $\ln(e^x) = x$ |
| $f(x) = \frac{1}{x}$ | $g(x) = x + 2$ | $\frac{1}{x + 2}$ |
Domain of Composite Functions
The domain of $(f \circ g)(x)$ consists of all x in the domain of g such that $g(x)$ is in the domain of f.
For example, if $f(x) = \sqrt{x}$ and $g(x) = x - 4$:
- $g(x) = x - 4$ is defined for all real numbers
- $f(x) = \sqrt{x}$ requires $x \geq 0$
- For $(f \circ g)(x) = \sqrt{x - 4}$, we need $x - 4 \geq 0$, so $x \geq 4$
Applications of Function Composition
In Calculus
Function composition is essential for the chain rule in differentiation: If $h(x) = f(g(x))$, then $h'(x) = f'(g(x)) \cdot g'(x)$.
In Real-World Problems
Function composition models sequential processes. For example:
- Temperature conversion: Convert Fahrenheit to Kelvin by first converting F to C, then C to K
- Business: Apply a discount to a price, then add sales tax
- Physics: Velocity is the derivative of position, acceleration is the derivative of velocity
Examples
Example 1: Polynomial Functions
Let $f(x) = 2x + 3$ and $g(x) = x^2 - 1$. Find $(f \circ g)(x)$.
Solution:
- $(f \circ g)(x) = f(g(x))$
- Substitute $g(x) = x^2 - 1$ into $f(x) = 2x + 3$:
- $f(x^2 - 1) = 2(x^2 - 1) + 3$
- $= 2x^2 - 2 + 3$
- $= 2x^2 + 1$
Example 2: Rational and Polynomial Functions
Let $f(x) = \frac{1}{x}$ and $g(x) = x + 2$. Find both $(f \circ g)(x)$ and $(g \circ f)(x)$.
Solution:
- $(f \circ g)(x) = f(g(x)) = f(x + 2) = \frac{1}{x + 2}$
- $(g \circ f)(x) = g(f(x)) = g\left(\frac{1}{x}\right) = \frac{1}{x} + 2 = \frac{1 + 2x}{x}$
- Notice: $(f \circ g)(x) \neq (g \circ f)(x)$
Example 3: Verifying Inverse Functions
Let $f(x) = 2x + 3$ and $g(x) = \frac{x - 3}{2}$. Verify that f and g are inverses.
Solution:
- Check $(f \circ g)(x)$: $f\left(\frac{x - 3}{2}\right) = 2 \cdot \frac{x - 3}{2} + 3 = x - 3 + 3 = x$ ✓
- Check $(g \circ f)(x)$: $g(2x + 3) = \frac{(2x + 3) - 3}{2} = \frac{2x}{2} = x$ ✓
- Since both compositions equal x, f and g are inverses.
Tips for Using This Calculator
- Enter functions using x as the variable
- Use * for multiplication (e.g., 2*x instead of 2x)
- Use ^ or ** for exponents (e.g., x^2 or x**2)
- Use sqrt(x) for square root
- Use log(x) for natural logarithm
- Use exp(x) or e^x for exponential function
- Use parentheses to clarify order of operations
Frequently Asked Questions
What is the difference between (f ∘ g)(x) and f(x) × g(x)?
$(f \circ g)(x)$ is function composition, meaning $f(g(x))$. In contrast, $f(x) \times g(x)$ is function multiplication, where you multiply the outputs of both functions. These are completely different operations.
How do I read the notation (f ∘ g)(x)?
Read it as "f composed with g of x" or simply "f of g of x". The small circle ∘ indicates composition, not multiplication.
Does order matter in function composition?
Yes! Function composition is not commutative. $(f \circ g)(x)$ usually gives a different result than $(g \circ f)(x)$. Always pay attention to which function is applied first.
How do I find the domain of a composite function?
The domain of $(f \circ g)(x)$ consists of all x-values where: (1) x is in the domain of g, AND (2) $g(x)$ is in the domain of f. You must check both conditions.
Additional Resources
To learn more about function composition:
Reference this content, page, or tool as:
"Function Composition Calculator" at https://MiniWebtool.com/function-composition-calculator/ from MiniWebtool, https://MiniWebtool.com/
by miniwebtool team. Updated: Dec 13, 2025
Chat with your favorite AI
For Gemini, paste the copied question into the chat. You can also copy it below.
View the question
Algebra Calculators:
- Absolute Value Equation Solver
- Absolute Value Inequality Solver
- Age Word Problem Solver New
- Algebraic Expression Simplifier
- Binomial Theorem Expansion Calculator New
- Coin Word Problem Solver New
- Completing the Square Calculator New
- Cubic Equation Solver New
- Descartes' Rule of Signs Calculator New
- Distance-Speed-Time Triangle Calculator New
- Domain and Range Calculator
- Expand Polynomials Calculator
- Exponential Equation Solver New
- Function Composition Calculator
- Function Grapher
- Function Odd Even Neither Checker
- Inequality Solver
- Inverse Function Calculator
- Linear Equation Solver
- Literal Equation Solver New
- Logarithmic Equation Solver Popular
- Mixture Problem Solver New
- Polar Equation Plotter New
- Polynomial Factoring Calculator
- Polynomial Long Division Calculator Popular
- Quartic Equation Solver New
- Radical Equation Solver
- Radical Simplifier
- Rational Equation Solver New
- Rational Expression Calculator
- Rational Root Theorem Calculator New
- Standard Form to Slope-Intercept Converter New
- Synthetic Division Calculator
- System of Inequalities Grapher
- System of Linear Equations Solver
- System of Nonlinear Equations Solver New
- Train Meeting Problem Solver New
- Trigonometric Equation Solver New
- Vertex and Axis of Symmetry Calculator
- Work Rate Problem Solver New
- X and Y Intercept Calculator