函数复合计算器
在给定的x值处评估两个函数f(x)、g(x)、f(g(x))和g(f(x)),并提供逐步的代入推导。
输入
x的函数,用标准数学记号表示(^表示幂,sqrt()、sin()等)。
x的第二个函数,使用相同的记号。
用于评估两个函数及其复合的x值。
输出
使用此工具的更多方式
REST API
curl -X POST https://api.iotools.cloud/v1/tool/function-composition-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"functionF": "x + 3",
"functionG": "x - 3",
"x": "5"
}'替换成您账户中的密钥。工具的字段即为请求体——没有额外包装。
让 AI 代理执行
Use the IOTools `function-composition-calculator` tool (Function Composition Calculator) on this input:
YOUR_INPUT_HERE将此粘贴给任何已连接 IOTools MCP 服务器的代理,再加上您的输入内容。
嵌入式小组件
<iframe
src="https://iotools.cloud/embed/function-composition-calculator/"
width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
title="函数复合计算器 — iotools.cloud"
sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
allow="clipboard-write"
style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>把它放到您自己的页面上——免费,无需密钥,只需保留一个反向链接。
| 每次 API/MCP 调用费用 | 5 积分起 |
|---|---|
| 需要更多积分? | 查看定价 |
也可通过
使用指南
The Function Composition Calculator evaluates two functions, f(x) and g(x), at a given value of x, then combines them into the composite functions f(g(x)) and g(f(x)) — showing every substitution along the way.
It's built for algebra and precalculus students checking composition homework, and anyone who needs to verify how two functions combine without working through the algebra by hand.
How to use it
- Enter f(x) and g(x) in terms of x — standard math notation works:
^for powers, plussqrt(),sin(),cos(),log(), and the other functions supported by mathjs's expression parser. - Enter the x value to evaluate both functions and their compositions at.
- Read f(x), g(x), f(g(x)), and g(f(x)) for the four evaluated results.
- Step-by-Step Derivation shows the substitution behind each composition.
Results update automatically as you type. For example, f(x) = x + 3, g(x) = x - 3, at x = 5 gives f(x) = 8, g(x) = 2, f(g(x)) = 5, and g(f(x)) = 5 — since these two functions are inverses of each other, both compositions return the original x.
What is function composition?
Composing two functions means feeding the output of one into the other. f(g(x)) means "first apply g to x, then apply f to that result" — computed as f(g(x)), not f(x) · g(x). g(f(x)) reverses the order: apply f first, then g. The two compositions are generally not equal — composition isn't commutative, which is exactly why this calculator computes both.
Why do f(g(x)) and g(f(x)) usually differ?
Because the order of substitution changes which expression gets plugged into which. For f(x) = 2x + 1 and g(x) = x^2, f(g(x)) = 2x^2 + 1 while g(f(x)) = (2x + 1)^2 — entirely different expressions that only coincide at specific x values, if at all. Checking both, as this calculator does, is the fastest way to confirm which composition a problem is actually asking for.
What functions can I enter?
Anything mathjs's expression evaluator understands: polynomials (x^3 - 2x + 1), trigonometric functions (sin(x), cos(x), tan(x)), roots and logarithms (sqrt(x), log(x)), and combinations of these. Angles in trig functions are in radians by default — write pi for π. If a composition isn't defined at your chosen x (for example, f(x) = sqrt(x) composed with a g(x) that goes negative), the calculator flags it rather than showing an invalid result.
To check whether a function is symmetric rather than compose two of them, see the Function Odd/Even/Neither Checker. To evaluate arbitrary math expressions directly, see the Math Evaluator.
Privacy
This calculator runs entirely in your browser. Your functions and x value are never uploaded, logged, or stored — the computation happens locally on your device.