Function evaluation calculator
Pick a function type, enter its coefficients and a value of x, and get f(x) at once: f(x)=2x+1 evaluated at 3 gives 7. Inputs outside the real domain are flagged instead of guessed. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Kind
- Linear
- A
- 2
- B
- 1
- X
- 3
- Value
- 7
- Expression
- f(x)=2x+1
- Domain name
- (-∞, +∞)
Function evaluation is the bread-and-butter skill of algebra: given a rule for f, compute the output at a chosen input without hand calculation errors or silent domain mistakes. Students checking homework, tutors building worked examples, and automation scripts that need a deterministic f(x) oracle all hit the same search intent—function evaluation calculator—and expect both the numeric answer and an honest signal when the input is outside the real domain. This capability accepts a function family (linear, quadratic, polynomial via Horner, rational, square root, logarithm, absolute value, reciprocal, power, or exponential), the necessary coefficients, and a finite x.
What function evaluation means and which families are supported
Evaluating a function means applying its defining rule at a single real number x and reporting the unique output y equals f of x when that input is allowed. This calculator does not solve equations for x; it only computes the output for a supplied input, which is the skill tested in early algebra when students substitute values into f of x equals two x plus one or into more constrained forms such as square roots and logarithms. Ten families cover the forms that dominate textbooks and exam prep.
Linear f of x equals a x plus b and quadratic f of x equals a x squared plus b x plus c are defined for every real x. Polynomials accept a coefficient array highest degree first and are evaluated with Horner nesting for numerical stability and a short expression string. Rational functions f of x equals open parenthesis a x plus b close parenthesis over open parenthesis c x plus d close parenthesis exclude the root of the denominator.
Square root of a x plus b requires a non-negative radicand. Logarithm base of a x plus b requires a positive argument and a positive base not equal to one. Absolute value of a x plus b is defined everywhere.
Reciprocal a over x excludes zero. Power a times x to the n follows real-domain rules for integer and non-integer exponents. Exponential a times b to the x needs a positive base b.
What you can do with it
Homework and tutoring checks
Let students pick a function family and x, then verify the returned value—or an explicit out-of-domain reason—against textbook substitution.
LMS and exam auto-grading
Score evaluate-f-at-a-point items with a deterministic oracle that separates invalid parameters from legitimate domain failures.
Notebooks and formula validation
Plug design parameters into linear, rational, sqrt, log, or exponential models without importing a full computer-algebra library.
FAQ
How do I evaluate a function at a given x?
Send kind (for example linear or polynomial), the needed coefficients, and finite x.
What happens if x is outside the domain?
Value is omitted. That is not billed as a parameter error.
Which function kinds are supported?
linear, quadratic, polynomial, rational, sqrt, log, absolute, reciprocal, power, and exponential. Each has documented coefficients and real-domain rules.
How are polynomials evaluated?
Pass coeffs highest degree first (for example [1,-3,2] for x²−3x+2). The calculator uses Horner's method and returns a compact expression string.
Can it solve an equation for x?
No. It only computes the output for an input you supply. To find which x produces a given result, you need an equation solver instead.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/algebra/function-evaluate \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"linear","x":3}'const res = await fetch("https://api.kit.forhosting.com/algebra/function-evaluate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"kind": "linear",
"x": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/function-evaluate",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"kind": "linear",
"x": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/function-evaluate", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"kind":"linear","x":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"kind":"linear","x":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/function-evaluate", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"kind": "linear",
"x": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.function_evaluate",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
On success it returns the expression string, the real domain description, in_domain true, and the rounded value. When x falls outside the domain—negative radicand, non-positive log argument, zero denominator, undefined power—it still returns a structured payload with in_domain false and a plain-language reason instead of inventing a complex or infinite result. Malformed parameters fail with invalid_input and are not billed.
What function evaluation means and which families are supported
Choosing the right kind and coefficients is the only modelling step; the endpoint then substitutes x, checks the domain, and returns a stable rounded number or a domain failure reason.
Input contract, response shape, and domain reporting
Optional coefficients a, b, c, d, exponent n, log base, and polynomial coeffs fill in the chosen family; sensible defaults apply where a coefficient is optional so linear with only x still means f of x equals x. Example: kind linear, a equals two, b equals one, x equals three yields f of x equals two x plus one, domain all reals, value seven. POST a JSON body with required kind from the fixed enum and required finite x. Numbers may arrive as JSON numbers or decimal strings; non-finite values, empty strings, unknown kinds, empty coefficient arrays, and illegal log bases throw invalid_input naming the problem and are not billed. On success the body always includes kind, x, expression, domain as an interval-style string, formula, and in_domain. When in_domain is false—for example sqrt of x minus three at x equals two, or a reciprocal at zero—value is omitted and reason explains the violation in plain English so UIs can show a red domain tip instead of a blank answer. This design separates parameter errors from mathematical domain failures: the first are client bugs, the second are legitimate teaching moments. Example: kind rational with denominator x minus one at x equals one returns in_domain false because the denominator vanishes. Pair the numeric value with your own graphing code if you need a sketch; this endpoint evaluates at one point only and does not emit plots or multi-step symbolic simplification beyond the expression and formula fields.
Where a function evaluation API earns its keep
Classrooms and tutoring platforms use a function evaluation calculator so learners can check substituted values for arbitrary linear, quadratic, root, and log rules without arithmetic slips or silent complex-number surprises. Exam-prep generators and LMS plugins need a deterministic oracle that marks domain errors differently from wrong arithmetic so auto-graders can award partial credit or flag undefined cases. Failed validation does not consume balance. Engineering and science notebooks often plug sensor readings or design parameters into simple algebraic models; calling a tiny parse API avoids pulling a full computer-algebra system for a one-line substitution. Data pipelines that validate user-entered formulas can call the endpoint with candidate x values to reject out-of-domain samples before downstream steps. Keep requests small, pin the rounded value and in_domain flag in tests, and you get reproducible f of x results for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own.
Technical questions
What does the function evaluation calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.