Skip to content

Function notation: evaluating and finding functions

A function is a rule that gives exactly one output for each allowed input. Function notation names the rule and makes the input explicit.

For example,

f(x)=3x4f(x)=3x-4

means: the function called ff multiplies its input by 33, then subtracts 44. If the input is 55, the output is

f(5)=3(5)4=11.f(5)=3(5)-4=11.

The notation f(x)f(x) is read as “ff of xx”. It does not mean f×xf\times x.

Function notation occurs throughout A-level Mathematics, including graphs, transformations, calculus, sequences and numerical methods. The central habit is simple:

Replace every occurrence of the input variable by the complete new input.

You should already be able to:

  • substitute numbers into algebraic expressions;
  • use negative numbers and the order of operations;
  • expand brackets and collect like terms;
  • solve simple linear and quadratic equations.

Review algebraic manipulation and factorisation if substitution or expansion is uncertain. Review linear equations or quadratic equations if solving the final equation causes difficulty.

Think of a function as a machine:

inputapply the ruleoutput.\text{input}\longmapsto\text{apply the rule}\longmapsto\text{output}.

If f(x)=x2+1f(x)=x^2+1, then

222+1=5,2\longmapsto 2^2+1=5,

so f(2)=5f(2)=5. This can also be written as a mapping:

f:25.f:2\mapsto5.

The letter ff is merely the function’s name. Other names are equally valid:

g(x)=2x+7,qquadh(t)=t23t.g(x)=2x+7,qquad h(t)=t^2-3t.

In h(t)h(t), the input variable is tt. The choice of letter does not change the idea.

The statements

y=3x4y=3x-4

and

f(x)=3x4f(x)=3x-4

can describe the same input and output rule. Function notation is more informative because it names the rule. It lets us write f(5)f(5), f(a)f(a) or f(x+1)f(x+1) without inventing a new output variable each time.

To evaluate f(a)f(a), replace every xx in the formula for f(x)f(x) by aa, then simplify.

Given f(x)=72xf(x)=7-2x, find f(4)f(4).

Replace xx by 44:

f(4)=72(4)=78=1.\begin{aligned} f(4)&=7-2(4)\\ &=7-8\\ &=-1. \end{aligned}

The expression f(4)f(4) is the output, not an instruction to multiply ff by 44.

Given g(x)=2x25x+1g(x)=2x^2-5x+1, find g(3)g(-3).

Use brackets around the negative input every time it replaces xx:

g(3)=2(3)25(3)+1=2(9)+15+1=34.\begin{aligned} g(-3)&=2(-3)^2-5(-3)+1\\ &=2(9)+15+1\\ &=34. \end{aligned}

Without brackets, 32-3^2 would mean (32)=9-(3^2)=-9. The function requires the whole input 3-3 to be squared.

Let

h(x)=2x1x+3.h(x)=\frac{2x-1}{x+3}.

Find h(12)h\left(\frac12\right).

h(12)=2(12)112+3=1172=0.\begin{aligned} h\left(\frac12\right) &=\frac{2\left(\frac12\right)-1}{\frac12+3}\\ &=\frac{1-1}{\frac72}\\ &=0. \end{aligned}

The fraction bar groups the complete numerator and denominator. Substitute into both before simplifying.

Let p(x)=x24x+6p(x)=x^2-4x+6. Find:

  1. p(3)p(3);
  2. p(2)p(-2);
  3. p(0)p(0).
Answers
  1. p(3)=324(3)+6=3p(3)=3^2-4(3)+6=3.
  2. p(2)=(2)24(2)+6=18p(-2)=(-2)^2-4(-2)+6=18.
  3. p(0)=024(0)+6=6p(0)=0^2-4(0)+6=6.

In f(3)f(3), the input is 33. In f(a)f(a), it is aa. In f(x+2)f(x+2), the complete input is x+2x+2. The same replacement rule always applies.

Suppose

f(x)=x23x.f(x)=x^2-3x.

Then

f(x)=(x)23(x).f(\boxed{\phantom{x}})=(\boxed{\phantom{x}})^2-3(\boxed{\phantom{x}}).

Putting x+2x+2 into each box gives

f(x+2)=(x+2)23(x+2).f(x+2)=(x+2)^2-3(x+2).

The brackets protect the structure of the new input.

For f(x)=x23xf(x)=x^2-3x, simplify f(x+2)f(x+2).

f(x+2)=(x+2)23(x+2)=x2+4x+43x6=x2+x2.\begin{aligned} f(x+2) &=(x+2)^2-3(x+2)\\ &=x^2+4x+4-3x-6\\ &=x^2+x-2. \end{aligned}

A common incorrect first line is x2+23x+2x^2+2-3x+2. This substitutes into separate pieces instead of replacing each whole occurrence of xx. In particular,

(x+2)2x2+2.(x+2)^2\ne x^2+2.

Given g(x)=4x2+x1g(x)=4x^2+x-1, simplify g(2t)g(2t).

g(2t)=4(2t)2+(2t)1=4(4t2)+2t1=16t2+2t1.\begin{aligned} g(2t) &=4(2t)^2+(2t)-1\\ &=4(4t^2)+2t-1\\ &=16t^2+2t-1. \end{aligned}

Because (2t)2=4t2(2t)^2=4t^2, both the coefficient and variable are squared.

Let f(x)=3x2+2f(x)=3x^2+2. Find and simplify f(x+1)f(x)f(x+1)-f(x).

First evaluate the two function expressions separately:

f(x+1)=3(x+1)2+2=3x2+6x+5,f(x)=3x2+2.\begin{aligned} f(x+1)&=3(x+1)^2+2\\ &=3x^2+6x+5,\\[4pt] f(x)&=3x^2+2. \end{aligned}

Now subtract the complete second expression:

f(x+1)f(x)=(3x2+6x+5)(3x2+2)=6x+3.\begin{aligned} f(x+1)-f(x) &=(3x^2+6x+5)-(3x^2+2)\\ &=6x+3. \end{aligned}

This comparison of nearby outputs is an early version of an idea used later in differentiation.

Given q(x)=2x25q(x)=2x^2-5, simplify:

  1. q(a)q(a);
  2. q(a+1)q(a+1);
  3. q(3a)q(3a);
  4. q(a)q(-a).
Answers
  1. q(a)=2a25q(a)=2a^2-5.
  2. q(a+1)=2(a+1)25=2a2+4a3q(a+1)=2(a+1)^2-5=2a^2+4a-3.
  3. q(3a)=2(3a)25=18a25q(3a)=2(3a)^2-5=18a^2-5.
  4. q(a)=2(a)25=2a25q(-a)=2(-a)^2-5=2a^2-5.

The last answer equals q(a)q(a) because squaring removes the sign. This does not happen for every function.

An equation such as f(x)=17f(x)=17 asks:

Which input or inputs produce the output 1717?

Replace f(x)f(x) by its rule, then solve the resulting equation.

Worked example 7: solve a linear function equation

Section titled “Worked example 7: solve a linear function equation”

Given f(x)=5x3f(x)=5x-3, solve f(x)=22f(x)=22.

5x3=225x=25x=5.\begin{aligned} 5x-3&=22\\ 5x&=25\\ x&=5. \end{aligned}

Check:

f(5)=5(5)3=22.f(5)=5(5)-3=22.

The answer is x=5x=5, not f=5f=5. The function is named ff; the unknown is its input.

Let g(x)=x24g(x)=x^2-4. Solve g(x)=12g(x)=12.

x24=12x2=16x=4orx=4.\begin{aligned} x^2-4&=12\\ x^2&=16\\ x&=4\quad\text{or}\quad x=-4. \end{aligned}

Both inputs give the same output:

g(4)=12,qquadg(4)=12.g(4)=12,qquad g(-4)=12.

A function assigns one output to each input. It may still assign the same output to several different inputs.

Worked example 9: an equation involving two function values

Section titled “Worked example 9: an equation involving two function values”

Given h(x)=x2+2xh(x)=x^2+2x, solve

h(x)=h(3).h(x)=h(3).

First calculate the fixed value:

h(3)=32+2(3)=15.h(3)=3^2+2(3)=15.

Therefore

x2+2x=15x2+2x15=0(x+5)(x3)=0.\begin{aligned} x^2+2x&=15\\ x^2+2x-15&=0\\ (x+5)(x-3)&=0. \end{aligned}

Hence

x=5orx=3.x=-5\quad\text{or}\quad x=3.

Do not cancel the letter hh from h(x)=h(3)h(x)=h(3). Function notation is not multiplication. Instead, evaluate both sides using the stated rule.

Sometimes the formula contains unknown constants. Given enough input and output information, form equations and solve for them.

Worked example 10: determine a linear rule

Section titled “Worked example 10: determine a linear rule”

A function has the form

f(x)=ax+b.f(x)=ax+b.

Given f(2)=7f(2)=7 and f(5)=16f(5)=16, find f(x)f(x).

Substitute each input and output:

2a+b=7,5a+b=16.\begin{aligned} 2a+b&=7,\\ 5a+b&=16. \end{aligned}

Subtract the first equation from the second:

3a=9,3a=9,

so a=3a=3. Use 2a+b=72a+b=7:

2(3)+b=7,2(3)+b=7,

giving b=1b=1. Therefore

f(x)=3x+1.\boxed{f(x)=3x+1}.

Check both facts:

f(2)=7,qquadf(5)=16.f(2)=7,qquad f(5)=16.

Two points determine a linear function because its two constants, gradient and intercept, are then fixed.

Worked example 11: use a stated family of functions

Section titled “Worked example 11: use a stated family of functions”

The function gg has the form

g(x)=x2+px+q.g(x)=x^2+px+q.

Given g(1)=4g(1)=4 and g(2)=10g(-2)=10, find pp and qq.

From g(1)=4g(1)=4,

1+p+q=4,1+p+q=4,

so

p+q=3.\tag{1}

From g(2)=10g(-2)=10,

42p+q=10,4-2p+q=10,

so

-2p+q=6.\tag{2}

Subtract equation (1)(1) from equation (2)(2):

3p=3,-3p=3,

giving p=1p=-1. Then p+q=3p+q=3 gives q=4q=4. Thus

g(x)=x2x+4.\boxed{g(x)=x^2-x+4}.

A function may be given by a table rather than a formula.

xx2-2001144
f(x)f(x)55113-355

From the table:

f(0)=1,qquadf(4)=5.f(0)=1,qquad f(4)=5.

The equation f(x)=5f(x)=5 has two listed solutions:

x=2orx=4.x=-2\quad\text{or}\quad x=4.

The table gives no value for f(3)f(3). Unless a rule or further information is supplied, it cannot be inferred. A function need not follow an obvious pattern merely because a few values are displayed.

Not every formula accepts every real number. The set of allowed inputs is called the domain.

For

r(x)=1x2,r(x)=\frac{1}{x-2},

the input x=2x=2 would make the denominator zero. Therefore r(2)r(2) is undefined.

For

s(x)=x+3,s(x)=\sqrt{x+3},

real outputs require x+30x+3\ge0, so x3x\ge-3.

At this stage, develop the habit of checking for division by zero and square roots of negative numbers. Domains and ranges are treated fully in functions, domains and ranges.

Worked example 12: decide whether a value exists

Section titled “Worked example 12: decide whether a value exists”

Let

k(x)=x+1x29.k(x)=\frac{x+1}{x^2-9}.

Determine whether k(2)k(2) and k(3)k(3) exist.

For x=2x=2,

k(2)=2+1229=35=35.k(2)=\frac{2+1}{2^2-9}=\frac3{-5}=-\frac35.

For x=3x=3, the denominator is

329=0.3^2-9=0.

Division by zero is undefined, so k(3)k(3) does not exist.

  • Reading f(x)f(x) as f×xf\times x. The letter ff names a rule. You cannot cancel or divide by it as though it were a factor.
  • Replacing only some occurrences of the variable. In f(x)=x2+xf(x)=x^2+x, both occurrences change when evaluating f(a)f(a).
  • Losing brackets around a negative or algebraic input. If f(x)=x2f(x)=x^2, then f(3)=(3)2f(-3)=(-3)^2, and f(x+1)=(x+1)2f(x+1)=(x+1)^2.
  • Confusing f(x+1)f(x+1) with f(x)+1f(x)+1. If f(x)=x2f(x)=x^2, then f(x+1)=(x+1)2f(x+1)=(x+1)^2, while f(x)+1=x2+1f(x)+1=x^2+1. They are generally different.
  • Assuming one output has one input. A function requires one output per input, not one input per output. For f(x)=x2f(x)=x^2, both 22 and 2-2 produce 44.
  • Ignoring forbidden inputs. A formula containing a denominator or square root may have restrictions.

Let

f(x)=2x23x+1,qquadg(x)=4x.f(x)=2x^2-3x+1,qquad g(x)=4-x.

  1. Find f(2)f(-2).
  2. Simplify g(3t1)g(3t-1).
  3. Simplify f(x+1)f(x+1).
  4. Solve g(x)=5g(x)=-5.
  5. Solve f(x)=1f(x)=1.
  6. Find aa if f(a)=f(2)f(a)=f(2).
Answers

1.

f(2)=2(2)23(2)+1=8+6+1=15.f(-2)=2(-2)^2-3(-2)+1=8+6+1=15.

2.

g(3t1)=4(3t1)=53t.g(3t-1)=4-(3t-1)=5-3t.

The subtraction changes both terms inside the bracket.

3.

f(x+1)=2(x+1)23(x+1)+1=2x2+4x+23x3+1=2x2+x.\begin{aligned} f(x+1) &=2(x+1)^2-3(x+1)+1\\ &=2x^2+4x+2-3x-3+1\\ &=2x^2+x. \end{aligned}

4.

4x=5,4-x=-5,

so x=9x=9.

5.

2x23x+1=12x23x=0x(2x3)=0.\begin{aligned} 2x^2-3x+1&=1\\ 2x^2-3x&=0\\ x(2x-3)&=0. \end{aligned}

Therefore x=0x=0 or x=32x=\frac32.

6. First, f(2)=86+1=3f(2)=8-6+1=3. Now solve

2a23a+1=32a23a2=0(2a+1)(a2)=0.\begin{aligned} 2a^2-3a+1&=3\\ 2a^2-3a-2&=0\\ (2a+1)(a-2)&=0. \end{aligned}

Hence

a=12ora=2.a=-\frac12\quad\text{or}\quad a=2.

You should now be able to explain f(x)f(x) as an output, evaluate a function at numerical and algebraic inputs, solve equations involving function values, and determine simple function rules.

Next, study functions, domains and ranges for the full A-level language of mappings, domains, codomains, ranges and one-to-one functions. Then continue to composite and inverse functions and function graphs. If the algebraic manipulation was the main difficulty, strengthen algebraic fluency first.