This site is a work in progress. New lessons are added regularly. Contact us

Function Notation and Evaluation

Learning goals

  • Read ff as the function and f(x)f(x) as one value
  • Copy any expression into every slot the argument marks
  • Reject f(a+b)=f(a)+f(b)f(a + b) = f(a) + f(b) as a general rule
  • Simplify the difference quotient into a secant slope
  • Require equal domains before calling two functions equal
  • Evaluate a piecewise rule by choosing the right case

The function is ff; its value is f(x)f(x)

Start by separating two things that the phrase “the function f(x)=x2f(x) = x^2” quietly runs together. Strictly, ff is the function, the whole rule with its domain, as in Relations and Functions, while f(x)f(x) is a number: the output the rule produces at the input xx. Writing “the function f(x)f(x)” is a mild abuse of language that everyone uses. But when a step gets subtle, it pays to remember that ff is the machine and f(x)f(x) is what comes out of it.

This also settles what the parentheses are not. They are not multiplication. f(x)f(x) does not mean ff times xx, and f(3)f(3) is not 3f3f; ff is a rule, not a number, so there is nothing to multiply it by. The parentheses do one job only: they hold the input the rule is about to act on. Keep that job in mind, because the next section widens what is allowed to sit inside them.

The argument is a slot, not the letter xx

Picture the rule with an empty box where the input goes:

f()=2+1.f(\,\square\,) = \square^2 + 1.

The box says “whatever you feed me gets squared, then 11 is added.” The xx in f(x)=x2+1f(x) = x^2 + 1 is just a name written in that box so we can talk about a general input; it is a placeholder, not a special number. So anything at all can go in the slot, and whatever goes in is copied into every place the box appears:

f(3)=32+1,f(x)=(x)2+1,f(2x)=(2x)2+1,f(a)=a2+1.\begin{aligned} f(3) &= 3^2 + 1, &\qquad f(-x) &= (-x)^2 + 1, \\ f(2x) &= (2x)^2 + 1, &\qquad f(a) &= a^2 + 1. \end{aligned}

The input can even be another expression built from xx. Putting x+hx + h in the slot gives

f(x+h)=(x+h)2+1,f(x + h) = (x + h)^2 + 1,

and you may drop a function value into the slot too: f(f(x))=(f(x))2+1=(x2+1)2+1f(f(x)) = (f(x))^2 + 1 = (x^2 + 1)^2 + 1, treating f(x)f(x) as just another expression. Combining functions this way earns its own lesson later in the chapter; here it is nothing more than substitution.

Because the slot only cares about what you put in, not what you call it, the name of the input variable carries no meaning. The rules f(x)=x2+1f(x) = x^2 + 1 and f(t)=t2+1f(t) = t^2 + 1 have the same domain, the same codomain, and pair every input with the same output. So by the equality test later in this lesson, those two rules are the same function. Renaming xx to tt changes the writing, not the function.

The slot also reads backward. Because f(x)f(x) is a number, an equation like f(x)=7f(x) = 7 is an ordinary equation in xx. You solve that equation for the input that produces that output, using only the equation solving of Chapter 1.

The one habit the slot demands is substitution with parentheses. Wrap the whole input before applying the rule. Skip the wrapping and you silently change the problem: for f(x)=x2f(x) = x^2,

f(x)=(x)2=x2,notx2.f(-x) = (-x)^2 = x^2, \qquad \text{not} \qquad -x^2.

The correct result squares the input; the careless x2-x^2 negates a square, and the two disagree at every nonzero input (at x=3x = 3, (3)2=9(-3)^2 = 9 but 32=9-3^2 = -9). The parentheses are what hold the whole expression together inside the slot.

Substituting the whole expression x + h into the slot of ff of the chip x plus h equals the chip x plus h in parentheses squared plus 1, with an arc showing the argument copied into the rule’s slot.the whole expression fills every slotf(x + h) =(x + h)² + 1for f(x) = x² + 1
The argument of f is a slot. Whatever expression you write inside f( ) is copied into every slot of the rule, so f(x + h) squares the whole expression x + h. Here the rule is f(x) = x squared plus 1.

Worked example 1 Substituting whole expressions into the slot

Let f(x)=x2+1f(x) = x^2 + 1. Evaluate f(x)f(-x), f(2x)f(2x), and f(x+h)f(x + h), keeping every input wrapped in parentheses.

For f(x)f(-x), put x-x in the slot and square the whole thing:

f(x)=(x)2+1=x2+1.f(-x) = (-x)^2 + 1 = x^2 + 1.

For f(2x)f(2x), the factor 22 is inside the slot, so it is squared along with xx:

f(2x)=(2x)2+1=4x2+1.f(2x) = (2x)^2 + 1 = 4x^2 + 1.

For f(x+h)f(x + h), the entire sum x+hx + h is squared:

f(x+h)=(x+h)2+1=x2+2xh+h2+1.f(x + h) = (x + h)^2 + 1 = x^2 + 2xh + h^2 + 1.

Notice that f(x)f(-x) came back equal to f(x)f(x) here, while f(2x)f(2x) is 4x2+14x^2 + 1, not 2x2+12x^2 + 1. The slot squares whatever it holds, coefficients and all.

Check your understanding

If f(x)=x2+1f(x) = x^2 + 1, which expression equals f(2x)f(2x)?

Answer choices

f(a+b)f(a + b) is usually not f(a)+f(b)f(a) + f(b)

Because the slot swallows the whole input, f(a+b)f(a + b) squares the sum a+ba + b; it does not add the separate outputs. With f(x)=x2f(x) = x^2,

f(a+b)=(a+b)2=a2+2ab+b2,f(a)+f(b)=a2+b2.f(a + b) = (a + b)^2 = a^2 + 2ab + b^2, \qquad f(a) + f(b) = a^2 + b^2.

These differ by the cross term 2ab2ab, which is almost never zero. A single pair of numbers makes the gap concrete: f(2+3)=f(5)=25f(2 + 3) = f(5) = 25, while f(2)+f(3)=4+9=13f(2) + f(3) = 4 + 9 = 13. Pulling a constant out fails the same way: f(2x)=(2x)2=4x2f(2x) = (2x)^2 = 4x^2, but 2f(x)=2x22f(x) = 2x^2. So ff is a rule, not a multiplier. Unless you have checked that the particular rule allows it, you may not distribute ff across a sum or slide a constant through it.

One family of rules does respect both moves: the straight-line rules through the origin, f(x)=mxf(x) = mx.

The rules f(x)=mxf(x) = mx add and scale, and scaling alone pins them down#

Take any rule of the form f(x)=mxf(x) = mx with mm a constant. For all inputs aa and bb, the distributive law gives

f(a+b)=m(a+b)=ma+mb=f(a)+f(b),f(a + b) = m(a + b) = ma + mb = f(a) + f(b),

so the output of a sum is the sum of the outputs. For any constant kk,

f(kx)=m(kx)=k(mx)=kf(x),f(kx) = m(kx) = k(mx) = k\,f(x),

so scaling the input by kk scales the output by kk. Both identities hold for every rule f(x)=mxf(x) = mx.

The reverse direction holds too, and it is the scaling identity that delivers it. Suppose f(kx)=kf(x)f(kx) = k\,f(x) for every real kk and every xx. Put x=1x = 1: then f(k)=kf(1)f(k) = k\,f(1) for all kk, which is exactly f(x)=f(1)xf(x) = f(1)\,x, a rule of the form mxmx with slope m=f(1)m = f(1). So the pair of identities does pin down the through-origin lines, with no extra assumption needed. Additivity by itself is weaker: the identity f(a+b)=f(a)+f(b)f(a + b) = f(a) + f(b) alone does not force f(x)=mxf(x) = mx without a further hypothesis such as the graph having no breaks. Notice as well that adding a nonzero constant already destroys additivity: for f(x)=mx+cf(x) = mx + c,

f(a)+f(b)=ma+mb+2c,f(a+b)=ma+mb+c,f(a) + f(b) = ma + mb + 2c, \qquad f(a + b) = ma + mb + c,

and these agree only when c=0c = 0. Even the lines that everyday language calls linear are additive only when they pass through the origin.

So the rules f(x)=mxf(x) = mx are exactly the rules that respect scaling, and each of them is additive as well. The one caution is that additivity on its own is weaker: it does not single out f(x)=mxf(x) = mx without an added assumption. That gap is why the scaling identity is the one that pins the rules down.

The difference quotient

Now that f(x+h)f(x + h) is expressible, we can measure how much ff changes as the input moves from xx to x+hx + h. The change in output is f(x+h)f(x)f(x + h) - f(x), and dividing by the change in input hh gives the difference quotient

f(x+h)f(x)h.\frac{f(x + h) - f(x)}{h}.

Work it out for f(x)=x2f(x) = x^2. The numerator expands and the x2x^2 terms cancel:

f(x+h)f(x)=(x+h)2x2=(x2+2xh+h2)x2=2xh+h2.f(x + h) - f(x) = (x + h)^2 - x^2 = (x^2 + 2xh + h^2) - x^2 = 2xh + h^2.

Every term left has a factor of hh, so divide:

2xh+h2h=h(2x+h)h=2x+h,h0.\frac{2xh + h^2}{h} = \frac{h(2x + h)}{h} = 2x + h, \qquad h \ne 0.

Hold on to that restriction h0h \ne 0, because it is the whole point. Cancelling the hh is a division, and you can only divide by hh when h0h \ne 0. The original difference quotient 2xh+h2h\frac{2xh + h^2}{h} is undefined at h=0h = 0, where it reads 0/00/0, while the simplified 2x+h2x + h is perfectly happy at h=0h = 0. The two expressions agree for every h0h \ne 0 but have different domains, so they are genuinely different expressions that happen to match wherever both are defined. This is exactly the effect you met in Chapter 1, where clearing a denominator could change which inputs are allowed. Here cancelling an hh does the same thing, and the next section names why it matters.

The quantity itself has a meaning worth naming. The points (x,f(x))(x, f(x)) and (x+h,f(x+h))(x + h, f(x + h)) sit on the graph of ff, and f(x+h)f(x)h\frac{f(x + h) - f(x)}{h} is the slope of the straight line through them, the secant line. It is the average rate of change of ff between the two inputs. A later course lets hh shrink toward 00 to turn this secant slope into the slope of the curve at a single point, but that is calculus. Here we go only as far as the algebra, and the algebra is exactly the careful substitution of this lesson.

The secant line and the difference quotientPoints P at x and Q at x plus h on the graph of f, joined by a secant line whose slope is the rise f of x plus h minus f of x divided by the run h.PQsecanthf(x+h) - f(x)xx + h
The difference quotient is the slope of the secant line through P = (x, f(x)) and Q = (x + h, f(x + h)). The run is h and the rise is f(x + h) - f(x), so the quotient equals the average rate of change of f from x to x + h.

Worked example 2 A difference quotient with a linear term

Simplify f(x+h)f(x)h\dfrac{f(x + h) - f(x)}{h} for f(x)=x2+3xf(x) = x^2 + 3x, with h0h \ne 0.

Substitute x+hx + h into the whole rule, wrapping it in parentheses everywhere:

f(x+h)=(x+h)2+3(x+h)=x2+2xh+h2+3x+3h.f(x + h) = (x + h)^2 + 3(x + h) = x^2 + 2xh + h^2 + 3x + 3h.

Subtract f(x)=x2+3xf(x) = x^2 + 3x. The x2x^2 and 3x3x terms cancel, leaving only terms with a factor of hh:

f(x+h)f(x)=2xh+h2+3h.f(x + h) - f(x) = 2xh + h^2 + 3h.

Now divide by hh, which is allowed because h0h \ne 0:

2xh+h2+3hh=2x+h+3.\frac{2xh + h^2 + 3h}{h} = 2x + h + 3.

The linear term contributes the constant 33 to the answer, and the squared term contributes the 2x+h2x + h you saw for x2x^2.

Worked example 3 A difference quotient for f(x)=1/xf(x) = 1/x

Simplify f(x+h)f(x)h\dfrac{f(x + h) - f(x)}{h} for f(x)=1xf(x) = \dfrac{1}{x}, with h0h \ne 0.

Put x+hx + h in the slot, then combine the two fractions over the common denominator x(x+h)x(x + h):

f(x+h)f(x)=1x+h1x=x(x+h)x(x+h)=hx(x+h).f(x + h) - f(x) = \frac{1}{x + h} - \frac{1}{x} = \frac{x - (x + h)}{x(x + h)} = \frac{-h}{x(x + h)}.

Dividing by hh means multiplying by 1h\dfrac{1}{h}, and the hh in the numerator cancels the one in the denominator:

1hhx(x+h)=1x(x+h),h0.\frac{1}{h} \cdot \frac{-h}{x(x + h)} = \frac{-1}{x(x + h)}, \qquad h \ne 0.

The equality holds where both sides are defined, and that needs h0h \ne 0, because you divided by hh to reach it. The equality also needs x0x \ne 0 and x+h0x + h \ne 0, so that ff is defined at both xx and x+hx + h. The simplified 1x(x+h)\dfrac{-1}{x(x + h)} is itself perfectly defined at h=0h = 0, where it equals 1x2-\dfrac{1}{x^2}. That value of hh is the one the cancellation dropped, the same way clearing a denominator in Chapter 1 changed which inputs were allowed.

The same wrap-the-whole-input rule handles higher powers. For f(x)=x3f(x) = x^3, expand the cube (x+h)3=x3+3x2h+3xh2+h3(x + h)^3 = x^3 + 3x^2 h + 3x h^2 + h^3, subtract x3x^3, and divide by hh:

(x+h)3x3h=3x2h+3xh2+h3h=3x2+3xh+h2,h0.\frac{(x + h)^3 - x^3}{h} = \frac{3x^2 h + 3x h^2 + h^3}{h} = 3x^2 + 3xh + h^2, \qquad h \ne 0.

Nothing new happens: the whole input is cubed, and every surviving term carries a factor of hh.

Check your understanding

For f(x)=x2f(x) = x^2, simplify f(x+h)f(x)h\dfrac{f(x + h) - f(x)}{h} for h0h \ne 0.

Answer choices

When are two functions equal?

The difference quotient just handed us two expressions that agree everywhere they are both defined yet are not the same, because their domains differ. That is a clue about what equality of functions should mean, and it deserves a precise statement.

Two functions are equal exactly when their domains, codomains, and values all match#

Recall from Relations and Functions that a function is a set of input-output pairs, with no repeated first coordinate, together with a declared codomain. We prove that ff and gg are the same function if and only if three conditions all hold. The three are: the same domain, the same codomain, and f(x)=g(x)f(x) = g(x) at every input xx in that domain.

Suppose first that ff and gg are the same function. Then they are literally the same set of pairs and the same codomain. The domain of a function is the set of its first coordinates, so the two domains match. For each input xx the one pair with first coordinate xx is shared by both sets, so f(x)=g(x)f(x) = g(x) at every xx. Equal functions therefore agree on domain, codomain, and every value.

Conversely, suppose ff and gg have the same domain DD, the same codomain, and f(x)=g(x)f(x) = g(x) for every xx in DD. Then for each xx in DD the pair (x,f(x))(x, f(x)) is the pair (x,g(x))(x, g(x)), so the two sets of pairs are identical, and the codomains match by assumption. Having the same pairs and the same codomain, ff and gg are the same function.

Both directions hold, so the equality of two functions is precisely the equality of their domains, their codomains, and all their values, no more and no less.

This is why f(x)=x2xf(x) = \dfrac{x^2}{x} and g(x)=xg(x) = x are different functions, not equal ones. For x0x \ne 0 the fraction cancels, x2x=x\dfrac{x^2}{x} = x, so the two rules agree wherever both are defined. But x=0x = 0 lies in gg‘s domain and not in ff‘s, since x2x\dfrac{x^2}{x} reads 0/00/0 there. Their domains differ, so by the test above they are not the same function. It is the same lesson the difference quotient taught: 2x+h2x + h and 2xh+h2h\dfrac{2xh + h^2}{h} agree for h0h \ne 0 but part ways at h=0h = 0, and matching values on the overlap is not enough. This is also why every cancelling step in Chapter 1 had to record the inputs it removed.

Worked example 4 Same formula after cancelling, different function

Decide whether f(x)=x21x1f(x) = \dfrac{x^2 - 1}{x - 1} and g(x)=x+1g(x) = x + 1 are the same function.

Factor the numerator with the difference of squares, x21=(x1)(x+1)x^2 - 1 = (x - 1)(x + 1). For x1x \ne 1 the common factor cancels:

x21x1=(x1)(x+1)x1=x+1.\frac{x^2 - 1}{x - 1} = \frac{(x - 1)(x + 1)}{x - 1} = x + 1.

So the two rules agree at every input except possibly x=1x = 1. Check that input directly. The denominator x1x - 1 is 00 there, so f(1)f(1) is 00\dfrac{0}{0}, undefined, and 11 is not in ff‘s domain. But g(1)=2g(1) = 2, so 11 is in gg‘s domain:

f(1) is undefined,g(1)=2.f(1) \ \text{is undefined}, \qquad g(1) = 2.

The domains differ, so ff and gg are different functions, even though ff simplifies to gg everywhere ff is defined.

Piecewise definitions

A piecewise definition gives a single function by splitting the input into cases and naming a rule on each. For example,

f(x)={x2if x<02x+1if x0f(x) = \begin{cases} x^2 & \text{if } x < 0 \\ 2x + 1 & \text{if } x \ge 0 \end{cases}

is one function, not two. To evaluate it, first find which case the input falls in, then use that case’s rule. Since 3<0-3 < 0, use the top rule: f(3)=(3)2=9f(-3) = (-3)^2 = 9. Since 404 \ge 0, use the bottom rule: f(4)=2(4)+1=9f(4) = 2(4) + 1 = 9. The boundary input x=0x = 0 is caught by the second case, because 000 \ge 0 is true while 0<00 < 0 is false, so f(0)=2(0)+1=1f(0) = 2(0) + 1 = 1.

For a piecewise rule to define a function at all, the cases must do two things: cover the whole domain, and never assign one input two different outputs. If some input were left out of every case, it would get no output. And if two cases overlapped and disagreed on the overlap, that input would be handed two different outputs, which Relations and Functions forbids. Cases are allowed to overlap when they agree there. For instance x\lvert x \rvert can be written as xx for x0x \ge 0 and x-x for x0x \le 0, which overlap at 00 yet agree, since both give 00. The easy way to rule out any conflict is to make the cases disjoint, which is what this example does. Here x<0x < 0 and x0x \ge 0 share no input and together cover every real number, so ff is well defined.

Worked example 5 Evaluating a piecewise rule

Evaluate g(3)g(-3), g(0)g(0), g(1)g(1), and g(4)g(4) for

g(x)={xif x<1x2if 1x12x1if x>1g(x) = \begin{cases} -x & \text{if } x < -1 \\ x^2 & \text{if } -1 \le x \le 1 \\ 2x - 1 & \text{if } x > 1 \end{cases}

For each input, pick the case whose condition it satisfies, then apply that rule.

At x=3x = -3, the condition x<1x < -1 holds, so use x-x: g(3)=(3)=3g(-3) = -(-3) = 3. At x=0x = 0, the condition 1x1-1 \le x \le 1 holds, so use x2x^2: g(0)=02=0g(0) = 0^2 = 0. At the boundary x=1x = 1, the middle case still applies, because 111-1 \le 1 \le 1 is true while x>1x > 1 is false, so g(1)=12=1g(1) = 1^2 = 1. At x=4x = 4, the condition x>1x > 1 holds, so use 2x12x - 1:

g(3)=3,g(0)=0,g(1)=1,g(4)=2(4)1=7.g(-3) = 3, \qquad g(0) = 0, \qquad g(1) = 1, \qquad g(4) = 2(4) - 1 = 7.

The only care needed is at a boundary: read the inequalities to see which single case owns that point.

Check your understanding

Let f(x)=x+5f(x) = x + 5 for x<0x < 0 and f(x)=x2f(x) = x^2 for x0x \ge 0. What is f(0)f(0)?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Free Response Questions (FRQ)

Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its own so you can check yourself and try again, then the full worked solution, plus a rubric to mark your own work against.

Free response Work it out on paper 5 questions Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (Optional)

A rule once had no name of its own. To say what squaring does to some other quantity, you wrote the whole formula out again with the new quantity in place of the old. There was nothing shorter to write, because no symbol stood for the rule apart from its ingredients.

Leonhard Euler, a Swiss mathematician, supplied one in 1734. He wrote ff for the rule and put its input in parentheses after it, giving the f(x)f(x) you have used all lesson. The notation does two jobs at once, and both deserve naming. It gives the rule a name that survives when the input changes. And it marks the input as a position, a slot standing ready for whatever you care to drop into it.

The second job is the one that pays here. Once the slot is a position rather than a particular letter, you may fill it with a number, with another letter, or with a whole expression. Nothing about ff has to be rewritten to accommodate any of them.

Euler was not saving anyone ink. He was making a question askable that nobody could ask before, the question of what this same rule does at an input a little further along. That question is f(x+h)f(x + h), and the difference quotient at the center of this lesson is its answer.