2.2, 2.3 - Functions, domain and range

2.2, 2.3 - Functions, domain and range

Use function notation to connect an input to its output, then describe exactly which inputs and outputs are possible. In 2.2 you will interpret and use a function rule; in 2.3 you will work out domains and ranges, including quadratics whose smallest output occurs inside an interval.

Function rules, inputs and outputs

A function gives an output of 66 at the left end of an interval and 11 at the right end. Could its output still be −3-3 somewhere between them? Keep that question in mind: the answer will explain why checking just two inputs can be misleading.

Start with a familiar rule: square a number, double it, then subtract 33. Input 22 gives 2(22)−3=52(2^2)-3=5; input −2-2 also gives 55. Each input still gives one definite output. Sharing an output is allowed.

Function

A function assigns exactly one output to each input in its domain. The notation f(x)\mathrm{f}(x), read “f of x”, means the output of the function f\mathrm{f} when the input is xx. For example, f(x)=2x2−3\mathrm{f}(x)=2x^2-3 is a function. A rule saying “choose either square root of the input” is not a function on positive inputs: input 44 would have two outputs, 22 and −2-2.

The brackets tell you what to put into the rule. Thus f(−2)\mathrm{f}(-2) asks for an output, while f(x)=5\mathrm{f}(x)=5 gives an output and asks which input produced it. Neither notation means multiplication by a letter called f\mathrm{f}.

You already know

Substitute into every occurrence of a variable, using brackets around negative values. Solving an equation reverses that task: work out the unknown value that makes the equation true. In particular, x2=4x^2=4 has both solutions x=2x=2 and x=−2x=-2.

Here is the distinction in a pair of questions about the same rule. The rule itself is supplied in the question; function notation is not supplied on the formulae sheet.

Worked example 1: an input is given

Question. The function f\mathrm{f} is given by f(x)=2x2−3\mathrm{f}(x)=2x^2-3. Work out f(−2)\mathrm{f}(-2).

Plan. Replace xx by the complete input −2-2, then follow the order of operations.

f(−2)=2(−2)2−3substitute with brackets=2(4)−3square before multiplying=5complete the arithmetic\begin{aligned} \mathrm{f}(-2)&=2(-2)^2-3 && \text{substitute with brackets}\\ &=2(4)-3 && \text{square before multiplying}\\ &=5 && \text{complete the arithmetic} \end{aligned}

Why this step? The square applies to the whole input. Without brackets, −22-2^2 means −(22)-(2^2), which is a different calculation.

Answer. f(−2)=5\mathrm{f}(-2)=5.

Check. Input 22 has the same square as −2-2, so it must give the same output, 55.

Worked example 2 changes only the direction of the question: the output is given and the input is unknown. This time there may be more than one answer.

Worked example 2: an output is given

Question. The function f\mathrm{f} is given by f(x)=2x2−3\mathrm{f}(x)=2x^2-3. Work out the values of xx when f(x)=5\mathrm{f}(x)=5.

Plan. Equate the rule to the supplied output, then solve the resulting equation.

2x2−3=5the output equals 52x2=8add 3x2=4divide by 2x=2 or x=−2both squares equal 4\begin{aligned} 2x^2-3&=5 && \text{the output equals }5\\ 2x^2&=8 && \text{add }3\\ x^2&=4 && \text{divide by }2\\ x&=2\text{ or }x=-2 && \text{both squares equal }4 \end{aligned}

Why this step? The 55 is an output, so set the whole rule equal to 55. Substituting x=5x=5 would answer a different question.

Answer. x=2x=2 or x=−2x=-2.

Check. 2(2)2−3=52(2)^2-3=5 and 2(−2)2−3=52(-2)^2-3=5, so both inputs work.

Two inputs giving the same output do not break the definition of a function. Two outputs for one input would. That distinction will matter when you reverse a function in the next lesson.

Watch out

Wrong: “f(x)=5\mathrm{f}(x)=5, so calculate f(5)\mathrm{f}(5).” Right: solve the equation 2x2−3=52x^2-3=5. The given output is 55; the input is what you need to find.

Try the reverse direction again, with the coefficients changed.

The domain and forbidden inputs

The domain tells you which inputs a function is allowed to use, so it belongs to the function alongside its rule.

Domain

The domain of a function is the set of allowed input values. For example, x>2x>2 allows every real input greater than 22, including 2.12.1 and 52\frac52, but excludes 22. “For all xx, except x=0x=0” allows every real input apart from zero.

A question may choose a domain, such as −1⩽x⩽4-1\leqslant x\leqslant4, even when the rule could accept more inputs. Use that stated domain. If you are asked for all real inputs for which a rule is defined, look for operations that fail.

Division by zero is undefined. A real square root cannot have a negative number inside it, and a\sqrt{a} means the non-negative square root of aa. If the square root is also a denominator, zero must be excluded too.

Restrictions on real inputs

For real-valued functions,

1u(x) requires u(x)≠0u(x) requires u(x)⩾01u(x) requires u(x)>0\begin{aligned} \frac{1}{u(x)}&\text{ requires }u(x)\ne0\\ \sqrt{u(x)}&\text{ requires }u(x)\geqslant0\\ \frac{1}{\sqrt{u(x)}}&\text{ requires }u(x)>0 \end{aligned}

Any domain stated in the question must also be respected.
Not on the formulae sheet: learn it.

The last condition combines the first two: the quantity under the root may be neither negative nor zero.

Worked example 3: a zero denominator

Question. The function f\mathrm{f} is given by f(x)=5x−2\mathrm{f}(x)=\frac{5}{x-2}. Write down its domain for real inputs.

Plan. Work out which input makes the denominator zero, then exclude it.

x−2=0the forbidden denominatorx=2the forbidden inputx≠2all other real inputs work\begin{aligned} x-2&=0 && \text{the forbidden denominator}\\ x&=2 && \text{the forbidden input}\\ x&\ne2 && \text{all other real inputs work} \end{aligned}

Why this step? Negative denominators are allowed; only a zero denominator prevents this calculation.

Answer. The domain is all real xx, except x=2x=2.

Check. f(1)=−5\mathrm{f}(1)=-5 and f(3)=5\mathrm{f}(3)=5 both exist, while f(2)\mathrm{f}(2) would require division by zero.

Worked example 4 changes only the denominator: it is now the square root of the previous denominator. This excludes a whole side of the number line, not just one point.

Worked example 4: a root in the denominator

Question. The function g\mathrm{g} is given by g(x)=5x−2\mathrm{g}(x)=\frac{5}{\sqrt{x-2}}. Write down its domain for real inputs.

Plan. Require the quantity inside the root to be positive, because its root is a denominator.

x−2⩾0the root must be realx−2≠0the denominator must not vanishx−2>0combine the restrictionsx>2add 2\begin{aligned} x-2&\geqslant0 && \text{the root must be real}\\ x-2&\ne0 && \text{the denominator must not vanish}\\ x-2&>0 && \text{combine the restrictions}\\ x&>2 && \text{add }2 \end{aligned}

Why this step? The boundary input 22 gives 0=0\sqrt0=0. The square root exists there, but dividing by it does not.

Answer. The domain is x>2x>2.

Check. Input 33 gives 55; input 11 would require −1\sqrt{-1}; input 22 would give a zero denominator. Only the first is allowed for this real-valued rule.

Keep restrictions from the original rule when simplifying. For instance, x2−4x−2=x+2\frac{x^2-4}{x-2}=x+2 only for x≠2x\ne2: cancelling a factor does not make the original missing input reappear.

Watch out

Wrong: the domain of 5x−2\frac{5}{\sqrt{x-2}} is x⩾2x\geqslant2. Right: x>2x>2, because equality makes the denominator zero. For the rule x−2\sqrt{x-2} on its own, equality would be allowed.

Move the boundary and apply the same two restrictions yourself.

The range and interval endpoints

The range records every output the function actually reaches from its allowed inputs.

Range

The range of a function is the set of possible output values from its domain. For example, f(x)=x2\mathrm{f}(x)=x^2 on all real inputs has range f(x)⩾0\mathrm{f}(x)\geqslant0: zero is reached, but negative outputs are not. This is different from the statistical range, which is one number obtained by subtracting the smallest value from the largest.

Write a domain using xx, and a range using f(x)\mathrm{f}(x), g(x)\mathrm{g}(x) or the relevant output name. Think of a graph: the domain runs along the horizontal axis, while the range runs up the vertical axis.

If a rule increases throughout an interval, the smallest input gives the smallest output. If it decreases throughout, the smallest input gives the largest output. Endpoint calculations work in these cases because the rule keeps moving in the same direction and takes every value between the endpoint outputs.

Worked example 5: an increasing rule

Question. The function f\mathrm{f} is given by f(x)=3x+2\mathrm{f}(x)=3x+2, with domain −2<x⩽4-2<x\leqslant4. Work out the range, giving your answer as an inequality.

Plan. Evaluate the endpoint outputs and keep track of which endpoints are included.

f(−2)=3(−2)+2=−4lower boundary, not reachedf(4)=3(4)+2=14upper boundary, reached−4<f(x)⩽14the rule increases throughout\begin{aligned} \mathrm{f}(-2)&=3(-2)+2=-4 && \text{lower boundary, not reached}\\ \mathrm{f}(4)&=3(4)+2=14 && \text{upper boundary, reached}\\ -4&<\mathrm{f}(x)\leqslant14 && \text{the rule increases throughout} \end{aligned}

Why this step? A positive coefficient of xx makes outputs increase with inputs, so the endpoint order stays the same.

Answer. −4<f(x)⩽14-4<\mathrm{f}(x)\leqslant14.

Check. Input 00 is allowed and gives 22, inside the proposed range. Output −4-4 would need the excluded input −2-2, while output 1414 comes from the included input 44.

Worked example 6 changes only the sign of the coefficient of xx. The rule now decreases, so the endpoints exchange their roles.

Worked example 6: a decreasing rule

Question. The function g\mathrm{g} is given by g(x)=−3x+2\mathrm{g}(x)=-3x+2, with domain −2<x⩽4-2<x\leqslant4. Work out the range, giving your answer as an inequality.

Plan. Evaluate both endpoint outputs, then write them in increasing order with their correct inclusion signs.

g(−2)=−3(−2)+2=8upper boundary, not reachedg(4)=−3(4)+2=−10lower boundary, reached−10⩽g(x)<8order outputs from small to large\begin{aligned} \mathrm{g}(-2)&=-3(-2)+2=8 && \text{upper boundary, not reached}\\ \mathrm{g}(4)&=-3(4)+2=-10 && \text{lower boundary, reached}\\ -10&\leqslant\mathrm{g}(x)<8 && \text{order outputs from small to large} \end{aligned}

Why this step? The excluded input now gives the upper boundary. Inclusion belongs to the endpoint that produced an output, not automatically to the left or right of the final inequality.

Answer. −10⩽g(x)<8-10\leqslant\mathrm{g}(x)<8.

Check. Input 00 gives 22, which lies in this interval. Output −10-10 occurs at x=4x=4; output 88 would require the excluded input −2-2.

The same endpoint reasoning works for a cubic such as h(x)=x3−1\mathrm{h}(x)=x^3-1, which increases throughout: domain −2<x<1-2<x<1 gives range −9<h(x)<0-9<\mathrm{h}(x)<0. But it does not work automatically for a quadratic that turns inside the domain. We will check that next.

Watch out

Wrong: write −10⩽x<8-10\leqslant x<8 as the range of g\mathrm{g}. Those are output values, so write −10⩽g(x)<8-10\leqslant\mathrm{g}(x)<8. A list of integers also misses the real values between them.

Try the decreasing rule with a new interval, including its left endpoint instead of its right endpoint.

Quadratic ranges and the turning point

A quadratic can turn between its endpoint inputs, so check its turning point as well as the interval boundaries.

You already know

Completing the square writes a quadratic as a(x−h)2+ka(x-h)^2+k. Since a square is non-negative, its turning point is (h,k)(h,k). If a>0a>0, this is a minimum; if a<0a<0, it is a maximum.

For f(x)=(x−2)2−3\mathrm{f}(x)=(x-2)^2-3, the smallest possible output is −3-3, reached at x=2x=2. That input only matters if the domain allows it. The same rule can therefore have different ranges when the domain changes.

[DIAGRAM: asset_name: A quadratic with and without its turning point; asset_slug: l2fm-quadratic-domain-range; caption: The domain determines whether the minimum output is reached; description: Two coordinate graphs of f(x) equals (x minus 2) squared minus 3. The left graph highlights domain minus 1 to 4 inclusive, with endpoint points (minus 1, 6) and (4, 1) and the minimum (2, minus 3). Its range is minus 3 to 6 inclusive. The right graph highlights only domain 3 to 4 inclusive, from (3, minus 2) to (4, 1); the turning point is shown faintly outside the chosen domain. Its range is minus 2 to 1 inclusive. Blue marks allowed parts of the curve and sage marks the output intervals.]
The domain determines whether the minimum output is reached

The squared distance (x−2)2(x-2)^2 is smallest at the allowed input nearest 22, and largest at the allowed input furthest from 22. This gives you a way to compare the necessary candidates without plotting a detailed graph.

Range of a completed-square quadratic

For a quadratic in the form

f(x)=a(x−h)2+k(a≠0)\mathrm{f}(x)=a(x-h)^2+k \qquad (a\ne0)

check the boundary outputs and check the turning-point output kk if x=hx=h is allowed. The sign of aa determines whether the turning point is a minimum or a maximum. Include an extreme output only if an allowed input actually reaches it.
Not on the formulae sheet: learn it.

Now use the rule from the opening question. Both endpoints are allowed, but the lowest point lies between them.

Worked example 7: a minimum inside the domain

Question. The function f\mathrm{f} is given by f(x)=x2−4x+1\mathrm{f}(x)=x^2-4x+1, with domain −1⩽x⩽4-1\leqslant x\leqslant4. Work out the range.

Plan. Complete the square, then compare the turning-point output with both endpoint outputs.

f(x)=(x−2)2−3complete the squaref(2)=−3minimum; 2 is allowedf(−1)=9−3=6left endpointf(4)=4−3=1right endpoint\begin{aligned} \mathrm{f}(x)&=(x-2)^2-3 && \text{complete the square}\\ \mathrm{f}(2)&=-3 && \text{minimum; }2\text{ is allowed}\\ \mathrm{f}(-1)&=9-3=6 && \text{left endpoint}\\ \mathrm{f}(4)&=4-3=1 && \text{right endpoint} \end{aligned}

Why this step? The endpoint values 66 and 11 miss the minimum −3-3. The square reaches zero at an input inside the domain.

Answer. −3⩽f(x)⩽6-3\leqslant\mathrm{f}(x)\leqslant6.

Check. On this domain, the distance from 22 runs from 00 up to 33, so 0⩽(x−2)2⩽90\leqslant(x-2)^2\leqslant9. Subtracting 33 gives precisely the proposed range.

Worked example 8 changes only the domain. It now lies entirely to the right of the turning point, so that minimum output is unavailable.

Worked example 8: the turning point is excluded

Question. The function f\mathrm{f} is given by f(x)=x2−4x+1\mathrm{f}(x)=x^2-4x+1, with domain 3⩽x⩽43\leqslant x\leqslant4. Work out the range.

Plan. Use the same completed-square form, but check whether its turning point is still allowed.

f(x)=(x−2)2−3same rule as beforex=2 is outside the domaindo not include its outputf(3)=1−3=−2smallest allowed distance from 2f(4)=4−3=1largest allowed distance from 2\begin{aligned} \mathrm{f}(x)&=(x-2)^2-3 && \text{same rule as before}\\ x=2&\text{ is outside the domain} && \text{do not include its output}\\ \mathrm{f}(3)&=1-3=-2 && \text{smallest allowed distance from }2\\ \mathrm{f}(4)&=4-3=1 && \text{largest allowed distance from }2 \end{aligned}

Why this step? Completing the square locates a potential extreme; the domain decides whether it can be used. The graph increases throughout the chosen interval.

Answer. −2⩽f(x)⩽1-2\leqslant\mathrm{f}(x)\leqslant1.

Check. Here 1⩽x−2⩽21\leqslant x-2\leqslant2, so 1⩽(x−2)2⩽41\leqslant(x-2)^2\leqslant4. Subtracting 33 gives −2⩽f(x)⩽1-2\leqslant\mathrm{f}(x)\leqslant1.

For a downward-opening quadratic the roles reverse: q(x)=5−(x+1)2\mathrm{q}(x)=5-(x+1)^2 on all real inputs has a maximum of 55, so its range is q(x)⩽5\mathrm{q}(x)\leqslant5. There is no smallest output because the subtracted square can grow without bound.

Two different rules can even share both a domain and a range. On −1⩽x⩽1-1\leqslant x\leqslant1, the rules x2x^2 and x4x^4 both produce exactly the outputs from 00 to 11, yet at x=12x=\frac12 they give 14\frac14 and 116\frac1{16}. The domain and range tell you where a function starts and finishes; they do not tell you its whole rule.

Watch out

Wrong: use only the endpoint values to claim 1⩽f(x)⩽61\leqslant\mathrm{f}(x)\leqslant6 in Worked example 7. Right: include the interior minimum to obtain −3⩽f(x)⩽6-3\leqslant\mathrm{f}(x)\leqslant6. A quadratic's turning point can give an output beyond both endpoint values.

The opening question is settled: the function can give −3-3 between endpoint outputs 66 and 11, because it turns. For your final check, use a new quadratic whose domain lies on just one side of its turn.

Quick Recap

  • A function gives exactly one output for each allowed input; several inputs may share an output.
  • The domain contains inputs. The range contains outputs, and should use the function's output notation.
  • Exclude zero denominators and negative quantities inside real square roots; a root in a denominator also excludes zero.
  • Endpoint calculations give the range when a continuous rule moves in one direction throughout the domain. For a quadratic, also check any allowed turning point.

The opening function reaches −3-3 at x=2x=2, between its endpoint outputs of 66 and 11. Its range is −3⩽f(x)⩽6-3\leqslant\mathrm{f}(x)\leqslant6, because the domain includes the turning point.