复合函数计算器

这个计算器对两个多项式函数求 f(g(x)) 和 g(f(x)),将其展开,并在你选择的 x 值处计算两者的值。例如,当 f(x) = 2x + 3、g(x) = x² 时,f(g(x)) = 2x² + 3,g(f(x)) = 4x² + 12x + 9。

一个数或分数

结果

输入数值并点击“计算”查看结果。

公式

(f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x))

Apply g first, then f: replace every x in f with g(x).

(g∘f)(x)=g(f(x))(g \circ f)(x) = g(f(x))

The other order. In general f(g(x)) and g(f(x)) are different.

如何使用此计算器

  1. Type f(x) and g(x) as polynomials, e.g. 2x + 3 and x^2.
  2. Choose a value of x to evaluate the composite functions at.
  3. Press Calculate to see f(g(x)) and g(f(x)) expanded, their values, and the substitution steps. To graph the function, open it in the graphing calculator.

例题

f(g(x)) and g(f(x)) for a linear and a quadratic function

f(g(x)): replace x in 2x + 3 with x², giving 2x² + 3.

g(f(x)): square 2x + 3, giving 4x² + 12x + 9.

At x = 2: g(2) = 4, so f(g(2)) = 11; f(2) = 7, so g(f(2)) = 49.

A shift inside a quadratic

f(g(x)) = (x + 1)² − 1 = x² + 2x.

g(f(x)) = (x² − 1) + 1 = x².

At x = 3: f(g(3)) = f(4) = 15 and g(f(3)) = g(8) = 9.

A cubic composed with a linear function

f(g(x)) = (x − 2)³ = x³ − 6x² + 12x − 8.

g(f(x)) = x³ − 2.

At x = 1 both are −1: (1 − 2)³ = −1 and 1³ − 2 = −1.

常见错误

  • Multiplying instead of composing: f(g(x)) is not f(x)·g(x).
  • Working in the wrong order: f(g(x)) applies g first.
  • Substituting without brackets: with g(x) = x + 1, f(x) = x² gives (x + 1)², not x² + 1.
  • Assuming f(g(x)) = g(f(x)) — it usually isn’t.

常见问题

How do you find f of g of x?

Write f(x), then replace every x with the whole expression g(x) in brackets, and simplify. For f(x) = 2x + 3 and g(x) = x², f(g(x)) = 2x² + 3.

What is the domain of a composite function?

The x-values in the domain of g whose output g(x) is in the domain of f. For the polynomials this calculator takes, both domains are all real numbers, so f(g(x)) is defined everywhere.

Can I graph the function?

Yes — copy f(g(x)) into the Sumzo graphing calculator to plot it, see where it crosses the x-axis and read a table of values.

Which functions can I enter?

Polynomials up to degree 6, such as 3x^2 - x + 4 or (x + 1)^3. Fractions like 1/2 x work as coefficients.

了解更多