Free Calculator Tool

Function Composition Calculator

Calculate f(g(x)) and g(f(x)) with step-by-step solutions. Enter two functions and get the composed result instantly.

Want to solve ANY math problem? Just take a screenshot.

Math.Photos handles algebra, calculus, geometry, statistics, and more — all from a photo.

Install

Compose Two Functions

f(x) =
g(x) =

How It Works

What is function composition?

Function composition combines two functions by plugging one into the other. f(g(x)) means "first apply g, then apply f to the result." It's written as (f ∘ g)(x).

f(g(x)) vs g(f(x))

Order matters! f(g(x)) applies g first, then f. g(f(x)) applies f first, then g. These usually give different results.

How to compute f(g(x))

Replace every x in f(x) with the entire expression g(x). Then simplify by expanding and combining like terms.

Evaluating at a point

To find f(g(2)): first compute g(2), then plug that result into f. For example, if g(x) = 2x+1, then g(2) = 5, and f(5) gives your answer.

Related Tools

Need more than a function composition calculator?

Math.Photos solves any math problem from a screenshot — algebra, calculus, geometry, statistics, and more. With step-by-step explanations.

Install

Frequently Asked Questions

How do you find f(g(x)) step by step?

To find f(g(x)): (1) Write out f(x) and g(x), (2) Wherever you see x in f(x), replace it with the entire expression for g(x), (3) Expand and simplify. For example, if f(x) = x² + 1 and g(x) = 2x + 3, then f(g(x)) = (2x+3)² + 1 = 4x² + 12x + 10.

Is f(g(x)) the same as g(f(x))?

No. Function composition is not commutative. f(g(x)) and g(f(x)) usually give different results. For example, if f(x) = x² and g(x) = x + 1, then f(g(x)) = (x+1)² = x² + 2x + 1, but g(f(x)) = x² + 1.

What is the domain of a composite function?

The domain of f(g(x)) is all x values in the domain of g where g(x) is in the domain of f. You must check both conditions.

How do you evaluate f(g(x)) at a specific value?

First compute g at that value, then plug the result into f. For f(g(2)) with f(x) = x² and g(x) = 3x: g(2) = 6, then f(6) = 36.