Composite Function f(g(x)) Calculator
Free online composite function calculator. Easily calculate f(g(x)), g(f(x)), f(f(x)), and g(g(x)) with step-by-step math logic and simplification.
Calculate $f(g(x))$, $g(f(x))$, and evaluate at points.
Results
Understanding how functions interact is a cornerstone of algebra and calculus.
Our Composite Function Calculator is for helping students, educators, and professionals quickly determine the result of "nesting" one function inside another. Whether you are dealing with linear equations, quadratics, or complex rational functions, this tool provides clear, simplified results for all possible compositions.
What is a Composite Function?
In mathematics, function composition is an operation that takes two functions, f and g, and produces a new function where the output of one becomes the input of the other. The most common notation is $(f \circ g)(x)$, which is read as "f composed with g" or "f of g of x."
Mathematically, this is expressed as:
- $(f \circ g)(x) = f(g(x))$
- $(g \circ f)(x) = g(f(x))$
How to Calculate Composite Function f(g(x))?
Using this tool is straightforward. Follow these steps to get your results instantly:
- Enter Function f(x): Type your first expression (e.g.,
2x + 3). - Enter Function g(x): Type your second expression (e.g.,
x^2 + 5). - Optional Point: If you want to evaluate the composition at a specific number, enter it in the "Point" field.
- Calculate: Click the "Calculate" button to see the results for $f(g(x))$, $g(f(x))$, $f(f(x))$, and $g(g(x))$.
Composite Function Formula and Logic
The calculator follows the standard substitution rule. To find $f(g(x))$, the logic replaces every instance of the variable x in the outer function $f$ with the entire expression of the inner function $g$.
For example, if:
- $f(x) = x^2$
- $g(x) = x + 1$
Then $(f \circ g)(x) = f(x + 1) = (x + 1)^2$. The calculator then expands and simplifies this to $x^2 + 2x + 1$.
Step-by-Step Example
Given:
$f(x) = 2x + 3$
$g(x) = -x^2 + 5$
Finding $g(f(x))$:
- Identify the outer function: $g(x) = -x^2 + 5$.
- Replace x with the expression for $f(x)$: $g(2x + 3) = -(2x + 3)^2 + 5$.
- Expand the square: $-(4x^2 + 12x + 9) + 5$.
- Distribute the negative: $-4x^2 - 12x - 9 + 5$.
- Combine like terms: $-4x^2 - 12x - 4$.
Frequently Asked Questions
Does the order of composition matter?
Yes! In almost all cases, $f(g(x))$ is not equal to $g(f(x))$. This is why our calculator provides both results simultaneously so you can compare the difference.
Can I compose a function with itself?
Absolutely. This is known as $f(f(x))$ or $f^2(x)$. It is common in recursive mathematics and power series. Our tool calculates both $f(f(x))$ and $g(g(x))$ for your convenience.
What mathematical symbols can I use?
You can use standard operators like +, -, *, /, and ^ for exponents. For example, x^2 + 2x + 1.