ThisCalculator

Everyday

Functions f and g Calculator: Evaluate and Compare

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Functions f and g Calculator: Evaluate and Compare

A functions f and g calculator evaluates one or both functions at an input value, and can also compare their outputs or calculate a composition such as f(g(x)). Enter the function rules and the value of x; the result depends on which operations the calculator supports. This page provides a numerical calculator for two linear functions, with inputs for their slopes, intercepts, and x-value.

Formula

This calculator uses the linear function rules f(x) = ax + b and g(x) = cx + d. It substitutes the entered x-value into each rule, then subtracts g(x) from f(x).

  • a: slope of f; b: y-intercept of f.
  • c: slope of g; d: y-intercept of g.
  • x: the input value.
  • f(x) and g(x): the resulting function values.
  • f(x) − g(x): the signed difference. A positive answer means f(x) is larger; a negative answer means g(x) is larger.

These are pure numbers, so the calculator labels them with “-” rather than a physical unit. If your functions describe quantities, the inputs and outputs may have units in your own context; keep those units consistent. Slopes have units of output per unit of input, while intercepts and function values have output units.

Worked Example

Using the defaults, f(x) = 2x + 1, g(x) = 3x − 2, and x = 4:

  1. Evaluate f: f(4) = 2 × 4 + 1 = 9.
  2. Evaluate g: g(4) = 3 × 4 − 2 = 10.
  3. Subtract in the specified order: f(4) − g(4) = 9 − 10 = −1.

The displayed outputs are f(x) = 9.00, g(x) = 10.00, and f(x) − g(x) = −1.00. The negative difference indicates that g(4) exceeds f(4) by 1.

What “Functions f and g” Means

In algebra, f and g are names for functions: rules that take an input and return an output. The notation f(x) means “the value of function f when its input is x.” The letters are labels, not special operations. For example, if f(x) = x² and g(x) = x + 3, then at x = 2, f(2) = 4 and g(2) = 5.

The phrase “functions f and g calculator” can refer to several different tasks. A calculator may evaluate function values, find where two graphs intersect, compare outputs, or compose functions. The block above specifically evaluates two linear functions and their difference; it does not accept arbitrary formulas or solve equations automatically.

How to Use the Calculator

  • Write each function in the form f(x) = ax + b or g(x) = cx + d.
  • Enter each slope in its slope field. Include a negative sign when needed.
  • Enter the constant term as the intercept. For example, the intercept in 3x − 2 is −2.
  • Enter the same x-value for both functions.
  • Read the two function values and the signed difference. The difference is always f(x) minus g(x), not an absolute distance.

For instance, f(x) = −x + 5 corresponds to a = −1 and b = 5. A frequent entry mistake is to enter 2 as the intercept for 3x − 2; the correct value is −2.

Comparing and Combining Functions

The difference output helps compare the functions at one particular input. If f(x) − g(x) is zero, their outputs match at that x. For the default functions, set 2x + 1 equal to 3x − 2: subtract 2x from both sides to get 1 = x − 2, so x = 3. At that input, both functions equal 7.

That is different from finding an intersection in general. Two functions can cross more than once, or not at all, depending on their formulas. For two straight lines, equal slopes with different intercepts mean they never meet; equal slopes and equal intercepts mean they are the same line. The calculator reports a difference at the x-value you provide but does not find an unknown intersection automatically.

Function composition is another common request. The expression (f ∘ g)(x), read “f of g of x,” means first calculate g(x), then use that result as the input to f. It is not the same as multiplying f(x) by g(x), and generally f(g(x)) is not equal to g(f(x)). The calculator block does not calculate composition; use the function rules and substitute in order.

Limits, Units, and Common Errors

This tool is designed for linear rules, not quadratic, piecewise, trigonometric, or other arbitrary functions. It treats entered values as ordinary real numbers and does not check whether a function has a restricted domain. If your rule has a denominator that can be zero, a square root requiring a nonnegative input, or another domain restriction, check that the chosen input is valid before interpreting the result.

  • Sign errors: preserve negative slopes and intercepts, and use parentheses when substituting into a handwritten expression.
  • Difference order: f(x) − g(x) can be negative. Reverse the subtraction only if you specifically want g(x) − f(x).
  • Rounding: the outputs display two decimal places. For decimal inputs, the displayed difference may look slightly different from subtracting rounded display values; the calculation is based on the entered numbers.
  • Units: do not compare function outputs expressed in incompatible units unless you first convert them to the same unit.

Frequently Asked Questions

What does f(x) mean?
It means the output of function f when the input is x. Substitute the chosen x-value into the rule for f and simplify.

How do I calculate f(x) and g(x)?
Apply each function rule separately to the same input. For linear rules, use f(x) = ax + b and g(x) = cx + d, as in the calculator above.

How do I find where f and g are equal?
Set f(x) = g(x) and solve for x. For linear functions, this produces a simple linear equation; then substitute the solution into either function to find the shared output.

Is f(g(x)) the same as f(x)g(x)?
No. f(g(x)) is composition: evaluate g first and feed its output into f. f(x)g(x) is multiplication of the two function values.

Can this calculator evaluate any function?
No. Its fields represent two linear functions. For other function types, use a calculator that accepts the specific formulas and respects their domains.

Related

Formula used
in a | Slope of f | - | 2 | 
in b | Intercept of f | - | 1 | 
in c | Slope of g | - | 3 | 
in d | Intercept of g | - | -2
in x | Input x | - | 4 |
out f | f(x) | - | a * x + b | 2
out g | g(x) | - | c * x + d | 2
out diff | f(x) - g(x) | - | f - g | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.