DGS Studio

Functions & Inverses

Function Composition

Compare functions and their composition with preserved real domains.

f(x)=x^2+1, g(x)=2*x, (f∘g)(x) means f(g(x))=(2*x)^2+1=4*x^2+1. Both functions and this composition have all real inputs.

The numeric version at 3 returns 37. The three-function example (f∘g∘h)(x), with f(x)=x+1, g(x)=2*x and h(x)=x^2, returns 2*x^2+1. Use Equations for the exact simplification or Graph to compare the original functions and the composition.

Equation

f(x)=x^2+1, g(x)=2*x, (f∘g)(x)

Substitution order and domains

Composition applies the rightmost function first. To form f(g(x)), substitute the whole expression g(x) for every occurrence of the input in f. Parentheses matter: squaring 2*x gives 4*x^2, not 2*x^2. The symbol ∘ and nested function calls describe the same operation, and changing their order can change the answer.

The input must belong to the inner function's domain, and the inner output must belong to the outer function's domain. Simplification cannot remove an original hole or make a forbidden square root real. The equation workflow reports the symbolic expression and substitution steps. The graph workflow compares the functions and their composition on their valid domains.

Reading the input

Try a change

Generate Graph opens this input in the graph workspace with its domain restrictions. The interactive result keeps the existing zoom, pan, and export controls.

Edit and generate

Generate Graph opens the studio homepage and runs this field. Open in DGS Studio loads the same text and waits for you to generate it. The equation is sent once, as a query parameter.

Related examples