3.6 Practice problems

Tutorial Sheet 2 in full. Work each question before opening the solution.

Problem 3.1. [Tutorial Sheet 2] Illustrate each of the following sets of ordered pairs on an arrow diagram. Which of them are functions? Give a reason in each case.

(i).
\(\{(0,-1),(2,2),(1,-2),(3,0)\}\)
(ii).
\(\{(1,a),(3,c),(2,b)\}\)
(iii).
\(\{(1,a),(1,b),(2,c),(1,d)\}\)
(iv).
\(\{(1,b),(2,b),(3,c),(4,b)\}\)

Show solution

Solution. An arrow diagram puts the first components in a left-hand oval and the second components in a right-hand one, with an arrow from each first component to its partner.

(0213-2-0(12abcdi)12iii)
Figure 12: Two of the four diagrams. In (i) exactly one arrow leaves each left-hand element; in (iii) three arrows leave the element 1.

The test is always the same: a set of ordered pairs is a function when every first component has exactly one arrow leaving it.

(i). The first components are \(0\), \(2\), \(1\), \(3\) — all different, so each has exactly one arrow. It is a function.

(ii). The first components are \(1\), \(3\), \(2\) — all different. It is a function.

(iii). The first component \(1\) appears three times, sending \(1\) to \(a\), to \(b\) and to \(d\). It is not a function, because a function must give one output for each input.

(iv). The first components are \(1\), \(2\), \(3\), \(4\) — all different. It is a function, even though three of them share the output \(b\).

Note 3.22. Compare (iii) and (iv). Repetition on the left destroys a function; repetition on the right does not. Several inputs are free to share an output — that is called many-to-one and is perfectly ordinary — but one input may never have two outputs.

Problem 3.2. [Tutorial Sheet 2] For each function, (i) list its domain and range, and (ii) form the inverse function \(f^{-1}\) and list its domain and range.

(a).
\(f=\{(1,5),(2,9),(5,21)\}\)
(b).
\(f=\{(0,0),(2,8),(-1,-1),(-2,-8)\}\)

Show solution

Solution. The domain is the set of first components and the range the set of second components. The inverse is formed by reversing every pair.

(a). \[\text {domain of } f=\{1,2,5\},\qquad \text {range of } f=\{5,9,21\}.\] Reversing each pair, \[f^{-1}=\{(5,1),(9,2),(21,5)\},\] \[\text {domain of } f^{-1}=\{5,9,21\},\qquad \text {range of } f^{-1}=\{1,2,5\}.\]

(b). \[\text {domain of } f=\{-2,-1,0,2\},\qquad \text {range of } f=\{-8,-1,0,8\}.\] \[f^{-1}=\{(0,0),(8,2),(-1,-1),(-8,-2)\},\] \[\text {domain of } f^{-1}=\{-8,-1,0,8\},\qquad \text {range of } f^{-1}=\{-2,-1,0,2\}.\]

Note 3.23. The domain of \(f^{-1}\) is the range of \(f\), and the range of \(f^{-1}\) is the domain of \(f\). That swap is not a separate fact to memorise — it follows immediately from reversing the pairs, and it is worth using as a check that no pair was dropped.

Note 3.24. Reversing the pairs only produces a function if no two pairs of \(f\) shared a second component. Both sets here pass. Had \(f\) contained \((1,5)\) and \((2,5)\), the reversed set would send \(5\) to both \(1\) and \(2\), and \(f^{-1}\) would not exist.

Problem 3.3. [Tutorial Sheet 2]

(a).
If \[f(x)=\begin {cases} 2x-3 & \text {for } x<0,\\ 3x+1 & \text {for } x\geq 0,\end {cases}\] compute \(f\left (\frac {1}{2}\right )\), \(f(0)\) and \(f(-3)\).
(b).
If \[f(x)=\begin {cases} -5 & \text {for } x<0,\\ 2x^2+3 & \text {for } 0\leq x\leq 3,\\ 5 & \text {for } x>3,\end {cases}\] compute \(f(-5)\), \(f\left (\frac {5}{2}\right )\), \(f(0)\) and \(f(10)\).

Show solution

Solution. With a piecewise function, the first job is always to decide which line applies, and only then to substitute.

(a). \[f\left (\tfrac {1}{2}\right ):\quad \tfrac {1}{2}\geq 0,\text { so use } 3x+1:\qquad 3\left (\tfrac {1}{2}\right )+1=\tfrac {3}{2}+1=\tfrac {5}{2}.\] \[f(0):\quad 0\geq 0,\text { so use } 3x+1:\qquad 3(0)+1=1.\] \[f(-3):\quad -3<0,\text { so use } 2x-3:\qquad 2(-3)-3=-6-3=-9.\]

(b). \[f(-5):\quad -5<0,\text { so } f(-5)=-5.\] \[f\left (\tfrac {5}{2}\right ):\quad 0\leq \tfrac {5}{2}\leq 3,\text { so use } 2x^2+3: \qquad 2\left (\tfrac {25}{4}\right )+3=\tfrac {25}{2}+3=\tfrac {31}{2}.\] \[f(0):\quad 0\leq 0\leq 3,\text { so use } 2x^2+3:\qquad 2(0)+3=3.\] \[f(10):\quad 10>3,\text { so } f(10)=5.\]

Note 3.25. In (b), \(f(-5)=-5\) is a coincidence of the numbers, not a rule. The first line says the output is \(-5\) for every negative input, so \(f(-100)\) is also \(-5\). Reading the line as “\(f(x)=x\)” because the two happen to agree at one point is a genuine trap.

Note 3.26. \(x=0\) appears in the condition of exactly one line in each part, because the inequalities are written as \(<\) and \(\geq \). That is deliberate. If both lines claimed \(x=0\) and gave different answers, \(f\) would not be a function at all.

Problem 3.4. [Tutorial Sheet 2] For each function, find in simplest form an expression for \[\frac {f(x+h)-f(x)}{h}.\] (i) \(f(x)=3x-2\), (ii) \(f(x)=2x^2-3x+1\), (iii) \(f(x)=\frac {1}{2x}\), (iv) \(f(x)=\frac {1}{\sqrt {x}}\).

Show solution

Solution. (i). \[f(x+h)=3(x+h)-2=3x+3h-2,\] \[f(x+h)-f(x)=(3x+3h-2)-(3x-2)=3h,\] \[\frac {f(x+h)-f(x)}{h}=\frac {3h}{h}=3.\]

(ii). \[f(x+h)=2(x+h)^2-3(x+h)+1=2x^2+4xh+2h^2-3x-3h+1,\] \[f(x+h)-f(x)=4xh+2h^2-3h=h(4x+2h-3),\] \[\frac {f(x+h)-f(x)}{h}=4x+2h-3.\]

(iii). Combine the two fractions over a common denominator first: \[f(x+h)-f(x)=\frac {1}{2(x+h)}-\frac {1}{2x}=\frac {x-(x+h)}{2x(x+h)}=\frac {-h}{2x(x+h)}.\] Dividing by \(h\) means multiplying by \(\frac {1}{h}\): \[\frac {f(x+h)-f(x)}{h}=\frac {-h}{2x(x+h)}\times \frac {1}{h}=\frac {-1}{2x(x+h)}.\]

(iv). Again combine first: \[f(x+h)-f(x)=\frac {1}{\sqrt {x+h}}-\frac {1}{\sqrt {x}} =\frac {\sqrt {x}-\sqrt {x+h}}{\sqrt {x}\sqrt {x+h}}.\] The numerator is a difference of surds, so rationalise it by multiplying top and bottom by \(\sqrt {x}+\sqrt {x+h}\): \[\left (\sqrt {x}-\sqrt {x+h}\right )\left (\sqrt {x}+\sqrt {x+h}\right )=x-(x+h)=-h,\] \[f(x+h)-f(x)=\frac {-h}{\sqrt {x}\sqrt {x+h}\left (\sqrt {x}+\sqrt {x+h}\right )}.\] Now divide by \(h\): \[\frac {f(x+h)-f(x)}{h} =\frac {-1}{\sqrt {x}\sqrt {x+h}\left (\sqrt {x}+\sqrt {x+h}\right )}.\]

Note 3.27. In every part the \(h\) cancels, and that is the point of the exercise. This expression is the derivative waiting to happen: letting \(h\to 0\) turns the four answers into \(3\), \(4x-3\), \(-\frac {1}{2x^2}\) and \(-\frac {1}{2x^{3/2}}\). Before the \(h\) is cancelled, letting \(h\to 0\) would give \(\frac {0}{0}\) and nothing could be concluded.

Note 3.28. Parts (iii) and (iv) cannot be done by expanding term by term. A fraction has to be combined over a common denominator before anything cancels, and a difference of surds has to be rationalised. Both are algebra from earlier chapters, reappearing where it matters.

Problem 3.5. [Tutorial Sheet 2] Find the domain and the range of each of the following. (i) \(f(x)=3x-7\), (ii) \(f(x)=\frac {2}{3x-5}\), (iii) \(f(x)=x^2-3x\), (iv) \(f(x)=\frac {1}{\sqrt {2x-7}}\), (v) \(f(x)=\sqrt {3-x}\).

Show solution

Solution. The domain is every \(x\) for which the formula makes sense. Two things break it: dividing by zero, and taking the square root of a negative number.

(i). A straight line, defined for every \(x\), and as \(x\) runs over all reals so does \(3x-7\): \[\text {domain}=\mathbb {R},\qquad \text {range}=\mathbb {R}.\]

(ii). The denominator vanishes when \[3x-5=0\quad \implies \quad x=\tfrac {5}{3}.\] \[\text {domain}=\mathbb {R}-\left \{\tfrac {5}{3}\right \}.\] For the range, no value of \(x\) makes the fraction zero, since a fraction is zero only when its numerator is, and the numerator is the constant \(2\). Every other value is attainable: \[\text {range}=\mathbb {R}-\{0\}.\]

(iii). A parabola, defined everywhere. Completing the square: \[x^2-3x=\left (x-\tfrac {3}{2}\right )^2-\tfrac {9}{4}.\] A square is never negative, so the smallest value is \(-\frac {9}{4}\), reached at \(x=\frac {3}{2}\): \[\text {domain}=\mathbb {R},\qquad \text {range}=\left [-\tfrac {9}{4},\ \infty \right ).\]

(iv). Here the root must be defined and non-zero, since it sits in a denominator. So we need \(2x-7>0\) rather than \(\geq 0\): \[2x-7>0\quad \implies \quad x>\tfrac {7}{2}.\] \[\text {domain}=\left (\tfrac {7}{2},\ \infty \right ).\] As \(x\) falls towards \(\frac {7}{2}\) the denominator shrinks to zero and \(f(x)\) grows without bound; as \(x\) grows the denominator grows and \(f(x)\) approaches zero without reaching it: \[\text {range}=(0,\ \infty ).\]

(v). A square root standing alone, so \(\geq 0\) suffices: \[3-x\geq 0\quad \implies \quad x\leq 3.\] \[\text {domain}=(-\infty ,\ 3],\qquad \text {range}=[0,\ \infty ),\] the range because a square root is never negative and takes every non-negative value as \(x\) runs down from \(3\).

Note 3.29. Compare (iv) and (v). The same square root gives a strict inequality in (iv) and a weak one in (v), purely because in (iv) it is in a denominator. Deciding between \(>0\) and \(\geq 0\) is the whole difficulty in these questions, and it turns on where the root sits, not on the root itself.

Problem 3.6. [Tutorial Sheet 2] Find \((f\circ g)(x)\) and \((g\circ f)(x)\), specifying the domain in each case.

(i).
\(f(x)=2x-6\), \(g(x)=x^2-3\)
(ii).
\(f(x)=\sqrt {x-2}\), \(g(x)=3x-1\)
(iii).
\(f(x)=\frac {1}{x-1}\), \(g(x)=\frac {2}{x}\)

Show solution

Solution. \((f\circ g)(x)\) means \(f\left (g(x)\right )\): apply \(g\) first, then feed the result into \(f\).

(i). \[(f\circ g)(x)=f\left (x^2-3\right )=2\left (x^2-3\right )-6=2x^2-6-6=2x^2-12,\] \[(g\circ f)(x)=g(2x-6)=(2x-6)^2-3=4x^2-24x+36-3=4x^2-24x+33.\] Both \(f\) and \(g\) are defined for every real number, so both composites have domain \(\mathbb {R}\).

(ii). \[(f\circ g)(x)=f(3x-1)=\sqrt {(3x-1)-2}=\sqrt {3x-3}.\] The root needs \(3x-3\geq 0\), so \[\text {domain}=[1,\infty ).\] \[(g\circ f)(x)=g\left (\sqrt {x-2}\right )=3\sqrt {x-2}-1.\] Here \(g\) accepts anything, but \(f\) must be defined first, needing \(x-2\geq 0\): \[\text {domain}=[2,\infty ).\]

(iii). \[(f\circ g)(x)=f\left (\frac {2}{x}\right )=\frac {1}{\frac {2}{x}-1} =\frac {1}{\frac {2-x}{x}}=\frac {x}{2-x}.\] Two conditions apply. First \(g\) must be defined, so \(x\neq 0\). Second, \(f\) must accept \(g(x)\), which needs \(\frac {2}{x}\neq 1\), that is \(x\neq 2\): \[\text {domain}=\mathbb {R}-\{0,2\}.\] \[(g\circ f)(x)=g\left (\frac {1}{x-1}\right )=\frac {2}{\frac {1}{x-1}}=2(x-1)=2x-2.\] Here \(f\) must be defined, so \(x\neq 1\). The value \(f(x)=\frac {1}{x-1}\) is never zero, so \(g\) raises no further objection: \[\text {domain}=\mathbb {R}-\{1\}.\]

Note 3.30. Part (iii) shows why the domain of a composite cannot be read off the final formula. \((g\circ f)(x)\) simplifies to \(2x-2\), which looks perfectly happy at \(x=1\) — but the composite is undefined there, because \(f(1)\) does not exist and the calculation never gets started. The simplified formula hides the exclusion, and the exclusion is still real.

Note 3.31. Composition is not commutative. In (i), \((f\circ g)(x)=2x^2-12\) while \((g\circ f)(x)=4x^2-24x+33\) — entirely different functions. The order in \(f\circ g\) means \(g\) acts first, which is the opposite of the reading order.

Problem 3.7. [Tutorial Sheet 2]

(a).
If \(f(x)=x^2-2\) and \(g(x)=x+4\), find \((f\circ g)(4)\) and \((g\circ f)(4)\).
(b).
Let \(g(x)=x^2-4\) and \(f(x)=\sqrt {x}\). Find \((f\circ g)(x)\) and \((g\circ f)(x)\), specifying the domain and range in each case.

Show solution

Solution. (a). There is no need to build the whole composite — substitute the number and work outwards. \[(f\circ g)(4)=f\left (g(4)\right )=f(4+4)=f(8)=8^2-2=62.\] \[(g\circ f)(4)=g\left (f(4)\right )=g\left (4^2-2\right )=g(14)=14+4=18.\]

(b). \[(f\circ g)(x)=f\left (x^2-4\right )=\sqrt {x^2-4}.\] For the domain, \(x^2-4\geq 0\), that is \(x^2\geq 4\), so \(x\leq -2\) or \(x\geq 2\): \[\text {domain}=(-\infty ,-2]\cup [2,\infty ).\] The inner expression \(x^2-4\) takes every value from \(0\) upwards on that domain, so \[\text {range}=[0,\infty ).\]

\[(g\circ f)(x)=g\left (\sqrt {x}\right )=\left (\sqrt {x}\right )^2-4=x-4.\] The formula looks like a straight line, but \(f\) must be defined first: \[\text {domain}=[0,\infty ),\] and as \(x\) runs from \(0\) upwards, \(x-4\) runs from \(-4\) upwards: \[\text {range}=[-4,\infty ).\]

Note 3.32. Again the simplified formula \(x-4\) conceals the restriction. Written without its domain it would suggest \((g\circ f)(-9)=-13\), but \(\sqrt {-9}\) does not exist, so the composite does not either. Always fix the domain from the original functions, not from the tidied answer.

Problem 3.8. [Tutorial Sheet 2]

(a).
Given \(f(x)=2x+3\) and \(g(x)=3x-5\), find (i) \((f\circ g)^{-1}(2)\), (ii) \(\left (f^{-1}\circ g^{-1}\right )(4)\), (iii) \(\left (g^{-1}\circ g^{-1}\right )(-10)\).
(b).
If \(f(x)=x-4\) and \(g(x)=\frac {3}{x+1}\), solve \((g\circ f)^{-1}(x)=6\).

Show solution

Solution. First find the two inverses, by writing \(y\) for the output and making \(x\) the subject. \[y=2x+3\ \implies \ x=\frac {y-3}{2}\quad \implies \quad f^{-1}(x)=\frac {x-3}{2},\] \[y=3x-5\ \implies \ x=\frac {y+5}{3}\quad \implies \quad g^{-1}(x)=\frac {x+5}{3}.\]

(a)(i). Build the composite, then invert it: \[(f\circ g)(x)=f(3x-5)=2(3x-5)+3=6x-10+3=6x-7.\] \[y=6x-7\ \implies \ x=\frac {y+7}{6}\quad \implies \quad (f\circ g)^{-1}(x)=\frac {x+7}{6}.\] \[\therefore \quad (f\circ g)^{-1}(2)=\frac {2+7}{6}=\frac {9}{6}=\frac {3}{2}.\]

(ii). Work from the inside out. \(g^{-1}\) acts first: \[g^{-1}(4)=\frac {4+5}{3}=\frac {9}{3}=3,\] \[f^{-1}(3)=\frac {3-3}{2}=0.\] \[\therefore \quad \left (f^{-1}\circ g^{-1}\right )(4)=0.\]

(iii). Apply \(g^{-1}\) twice: \[g^{-1}(-10)=\frac {-10+5}{3}=\frac {-5}{3},\] \[g^{-1}\left (-\tfrac {5}{3}\right )=\frac {-\frac {5}{3}+5}{3}=\frac {\frac {10}{3}}{3} =\frac {10}{9}.\] \[\therefore \quad \left (g^{-1}\circ g^{-1}\right )(-10)=\frac {10}{9}.\]

(b). Build the composite: \[(g\circ f)(x)=g(x-4)=\frac {3}{(x-4)+1}=\frac {3}{x-3}.\] Now the equation \((g\circ f)^{-1}(x)=6\) says that the inverse sends \(x\) to \(6\). Reading that the other way round, the function itself sends \(6\) to \(x\): \[x=(g\circ f)(6)=\frac {3}{6-3}=\frac {3}{3}=1.\]

\[\therefore \quad x=1.\]

Note 3.33. Part (b) needs no inverse to be calculated at all. The statement \(h^{-1}(x)=6\) is equivalent to \(h(6)=x\), so applying \(h\) to \(6\) answers it directly. Finding \((g\circ f)^{-1}\) explicitly and then solving would reach the same answer after a good deal more work.

Note 3.34. In (a)(i) and (a)(ii) the composite and the inverses are taken in different orders, and the answers \(\frac {3}{2}\) and \(0\) differ. In general \((f\circ g)^{-1}=g^{-1}\circ f^{-1}\) — the inverses compose in the reverse order, like undoing socks and shoes.

Problem 3.9. [Tutorial Sheet 2] Determine whether each function is odd, even, or neither. (a) \(f(x)=4x^5-7x^3+x\), (b) \(f(x)=x^4-x\), (c) \(f(x)=\frac {x^2}{x^2+1}\), (d) \(f(x)=\frac {x}{x^2+1}\), (e) \(f(x)=\frac {1+x}{1-x}\).

Show solution

Solution. The test is to compute \(f(-x)\) and compare it with \(f(x)\): \[f(-x)=f(x)\ \implies \ \text {even},\qquad f(-x)=-f(x)\ \implies \ \text {odd},\] and if it is neither, the function is neither.

(a). Odd powers change sign, so \[f(-x)=4(-x)^5-7(-x)^3+(-x)=-4x^5+7x^3-x=-\left (4x^5-7x^3+x\right )=-f(x).\] Odd.

(b). \[f(-x)=(-x)^4-(-x)=x^4+x.\] This is not \(f(x)=x^4-x\), and it is not \(-f(x)=-x^4+x\) either. Neither.

(c). Both \(x^2\) terms are unaffected by the sign change: \[f(-x)=\frac {(-x)^2}{(-x)^2+1}=\frac {x^2}{x^2+1}=f(x).\] Even.

(d). The numerator changes sign and the denominator does not: \[f(-x)=\frac {-x}{(-x)^2+1}=\frac {-x}{x^2+1}=-f(x).\] Odd.

(e). \[f(-x)=\frac {1+(-x)}{1-(-x)}=\frac {1-x}{1+x}.\] Comparing with \(f(x)=\frac {1+x}{1-x}\): the numerator and denominator have swapped, which is neither leaving the function alone nor negating it. Neither.

Note 3.35. Part (b) is the useful one. A sum of an even term and an odd term is generally neither, so mixing even and odd powers — as \(x^4-x\) does — is enough to rule both out. In (a) every power is odd, which is exactly why it comes out odd.

Note 3.36. In (e) the answer \(\frac {1-x}{1+x}\) is in fact \(\frac {1}{f(x)}\), which is a genuine relationship but not one of the two being tested for. A function can have a neat symmetry of some other kind and still be neither odd nor even.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.