Use this f∘g(x) calculator to evaluate function composition quickly. Enter coefficients for quadratic functions in the form a x² + b x + c, choose an x-value, and compute both f(g(x)) and g(f(x)).
Function f(x) = afx² + bfx + cf
Function g(x) = agx² + bgx + cg
What is a fog x calculator?
A fog x calculator helps you compute function composition, written as f(g(x)). In algebra, this means you evaluate g(x) first, then plug that result into f. This page also computes g(f(x)) so you can compare both orders side by side.
The key idea: composition is usually not commutative. In plain language, the order matters. Most of the time, f(g(x)) and g(f(x)) produce different expressions and different values.
How this calculator works
1) Define two functions
You enter coefficients for two quadratics:
- f(x) = afx² + bfx + cf
- g(x) = agx² + bgx + cg
2) Choose an x-value
The calculator evaluates both functions at your chosen x, then computes each composition directly.
3) View expanded polynomial forms
For deeper learning, the tool also outputs expanded forms of f(g(x)) and g(f(x)) as full polynomials in x.
Step-by-step usage
- Enter the three coefficients for f(x).
- Enter the three coefficients for g(x).
- Type an x-value (integer or decimal).
- Click Calculate f(g(x)).
- Read numeric outputs and expanded equations.
Worked example
Suppose:
- f(x) = x² + 2x + 1
- g(x) = 2x² - x + 3
- x = 2
First compute g(2), then feed that value into f. Next compute f(2), then feed that into g. You’ll see that the two composition outputs differ, which reinforces one of the most important composition rules in algebra.
Why f(g(x)) and g(f(x)) are often different
Composition acts like a pipeline. The first function transforms x, and the second function transforms the first result. If you reverse the pipeline, the input to each stage changes. That usually changes the final output.
This is the same reason “put on socks, then shoes” gives a different result than “shoes, then socks.” The actions are the same pieces, but order changes meaning.
Common mistakes to avoid
- Mixing order: f(g(x)) is not the same as g(f(x)).
- Substitution errors: replace every x in the outside function with the inside function.
- Sign errors: watch negative coefficients when squaring or distributing.
- Skipping parentheses: write substitutions clearly before expanding.
When to use a fog x calculator
This is useful for algebra homework, pre-calculus practice, SAT/ACT preparation, and quick verification when checking symbolic steps. It is especially handy when compositions get messy and manual expansion takes too long.
Quick FAQ
Does this support decimals and negatives?
Yes. All coefficient and x inputs accept decimal and negative values.
Can I use linear functions?
Yes. Set the x² coefficient to 0 and the calculator behaves like linear composition.
Is this only for numeric output?
No. It provides both numeric answers and expanded polynomial forms so you can learn the structure of composition, not just the final number.