One input, one out­put

Put a coin in a vend­ing machine, press a but­ton, and exactly one thing comes out. A func­tion behaves the same way: it is a rela­tion in which every ele­ment of the domain has exactly one image. Func­tions are the back­bone of cal­cu­lus, so this les­son mat­ters. We will test rela­tions to see whether they are func­tions, get to know the stan­dard real func­tions (iden­tity, con­stant, poly­no­mial, ratio­nal, mod­u­lus, signum and great­est inte­ger) through their graphs, domains and ranges, and then add, sub­tract, mul­ti­ply and divide func­tions.

Func­tions

A rela­tion ff from AA to BB is a func­tion if every a∈Aa \in A appears as a first ele­ment exactly once: not zero times, not twice. We write f:A→Bf : A \to B and y=f(x)y = f(x).

Exam­ple 1. Work on A={1,2,3}A = \{1, 2, 3\}. The rela­tion {(1,2),(2,2),(3,1)}\{(1, 2), (2, 2), (3, 1)\} is a func­tion; two ele­ments are allowed to share an image. The rela­tion {(1,2),(1,3),(2,1),(3,1)}\{(1, 2), (1, 3), (2, 1), (3, 1)\} is not, because 11 has two images. And {(1,1),(2,3)}\{(1, 1), (2, 3)\} is not a func­tion on AA either, because 33 has no image at all.

Ver­ti­cal line test. With a graph in front of you there is a quick check. A curve in the plane is the graph of a func­tion exactly when no ver­ti­cal line meets it twice. A cir­cle fails this test.

Two graphs with a dashed vertical line: it cuts a circle centred at the origin at two points, so the circle is not a function, but cuts the parabola y = x squared once.
The ver­ti­cal line test: a cir­cle fails, a parabola passes

Real func­tions

Func­tion Rule Domain Range
iden­tity f(x)=xf(x) = x R\mathbf{R} R\mathbf{R}
con­stant f(x)=cf(x) = c R\mathbf{R} {c}\{c\}
square f(x)=x2f(x) = x^2 R\mathbf{R} [0,∞)[0, \infty)
cube f(x)=x3f(x) = x^3 R\mathbf{R} R\mathbf{R}
rec­i­p­ro­cal f(x)=1x\displaystyle f(x) = \tfrac{1}{x} R−{0}\mathbf{R} - \{0\} R−{0}\mathbf{R} - \{0\}
mod­u­lus f(x)=∣x∣f(x) = \lvert x \rvert R\mathbf{R} [0,∞)[0, \infty)
signum f(x)=∣x∣x\displaystyle f(x) = \tfrac{\lvert x \rvert}{x}, f(0)=0f(0) = 0 R\mathbf{R} {−1,0,1}\{-1, 0, 1\}
great­est inte­ger f(x)=[x]f(x) = [x] R\mathbf{R} Z\mathbf{Z}
Six small graphs: identity line y = x, parabola y = x squared, cubic y = x cubed, two-branch reciprocal y = 1/x, V-shaped modulus y = |x|, and the signum function with values -1, 0 and 1.
Graphs of the stan­dard real func­tions in the table

The great­est inte­ger func­tion needs a word of care. [x][x] is the great­est inte­ger not exceed­ing xx, so [2.7]=2[2.7] = 2 and [5]=5[5] = 5. With neg­a­tives stu­dents often slip: [−2.7]=−3[-2.7] = -3, because you must step down to the inte­ger just below, not up towards zero. Its graph looks like a stair­case.

Staircase graph of y = [x] for x from -3 to 4: each step has a filled dot at its left end and an open circle at its right; [2.7] = 2 and [-2.7] = -3 are marked.
The great­est inte­ger func­tion is a stair­case

A poly­no­mial func­tion has the form f(x)=a0+a1x+⋯+anxnf(x) = a_0 + a_1 x + \cdots + a_n x^n, where nn is a whole num­ber. That rules out x\sqrt{x} and 1x\displaystyle \tfrac{1}{x}, which are not poly­no­mi­als. A ratio­nal func­tion is a quo­tient p(x)q(x)\displaystyle \tfrac{p(x)}{q(x)} of poly­no­mi­als, defined wher­ever q(x)≠0q(x) \ne 0.

For the domain, ask what would break the for­mula: a zero denom­i­na­tor, or a neg­a­tive num­ber under a square root. For the range, ask what val­ues the out­put can actu­ally reach.

Find­ing domain and range

Exam­ple 2. For f(x)=x2+1x2−5x+4\displaystyle f(x) = \frac{x^2 + 1}{x^2 - 5x + 4}, the denom­i­na­tor fac­tors as (x−1)(x−4)(x - 1)(x - 4) and van­ishes at 11 and 44. So the domain is R−{1,4}\mathbf{R} - \{1, 4\}.

Exam­ple 3. For f(x)=x−3f(x) = \sqrt{x - 3} the quan­tity under the root can­not be neg­a­tive, giv­ing domain [3,∞)[3, \infty) and range [0,∞)[0, \infty).

Exam­ple 4. For f(x)=5−∣x−2∣f(x) = 5 - \lvert x - 2 \rvert, the mod­u­lus is never neg­a­tive, so the out­put never goes above five. Domain R\mathbf{R}, range (−∞,5](-\infty, 5].

Exam­ple 5. The same idea gives the range of f(x)=3−x2f(x) = 3 - x^2 as (−∞,3](-\infty, 3].

Alge­bra of func­tions

Func­tions can be com­bined point by point, just like num­bers. For f,g:X→Rf, g : X \to \mathbf{R} we define (f+g)(x)=f(x)+g(x)(f + g)(x) = f(x) + g(x), (f−g)(x)=f(x)−g(x)(f - g)(x) = f(x) - g(x), (fg)(x)=f(x)g(x)(fg)(x) = f(x) g(x) and (αf)(x)=αf(x)(\alpha f)(x) = \alpha f(x). For the quo­tient, (fg)(x)=f(x)g(x)\displaystyle \left(\tfrac{f}{g}\right)(x) = \tfrac{f(x)}{g(x)}, but only where g(x)≠0g(x) \ne 0.

Exam­ple 6. Let f(x)=x2−1f(x) = x^2 - 1 and g(x)=3x+2g(x) = 3x + 2. Then (f+g)(x)=x2+3x+1(f + g)(x) = x^2 + 3x + 1, (f−g)(x)=x2−3x−3(f - g)(x) = x^2 - 3x - 3 and (fg)(x)=3x3+2x2−3x−2(fg)(x) = 3x^3 + 2x^2 - 3x - 2. Finally (fg)(x)=x2−13x+2\displaystyle \left(\tfrac{f}{g}\right)(x) = \tfrac{x^2 - 1}{3x + 2}, which needs x≠−23\displaystyle x \ne -\tfrac{2}{3}.

Prac­tice ques­tions

  1. Which rela­tions on {1,2,3,4}\{1, 2, 3, 4\} are func­tions? (a) {(1,3),(2,3),(3,3),(4,3)}\{(1, 3), (2, 3), (3, 3), (4, 3)\}; (b) {(1,1),(2,1),(2,4),(3,2),(4,3)}\{(1, 1), (2, 1), (2, 4), (3, 2), (4, 3)\}; (c) {(1,4),(2,3),(3,2)}\{(1, 4), (2, 3), (3, 2)\}.
  2. f(x)=x2−4xf(x) = x^2 - 4x. Find f(0)f(0), f(−1)f(-1), f(4)f(4), f(a+1)f(a + 1).
  3. Eval­u­ate: [3.9][3.9]; [−0.4][-0.4]; [−6][-6]; ∣−7∣−∣2∣\lvert -7 \rvert - \lvert 2 \rvert.
  4. Find the domain: 1x2−9\displaystyle \frac{1}{x^2 - 9}; 8−2x\sqrt{8 - 2x}; xx2+4\displaystyle \frac{x}{x^2 + 4}.
  5. Find the range: x2+5x^2 + 5; ∣x+1∣−3\lvert x + 1 \rvert - 3; 1x2+1\displaystyle \frac{1}{x^2 + 1}.
  6. f(x)=2x−3f(x) = 2x - 3 and g(x)=x2g(x) = x^2. Find f+gf + g, fgfg, gf\displaystyle \tfrac{g}{f} and state the domain of gf\displaystyle \tfrac{g}{f}.
  7. Sketch f(x)=∣x−2∣f(x) = \lvert x - 2 \rvert and f(x)=[x]f(x) = [x] for −2≤x<3-2 \le x < 3.
  8. f={(x,3x−1):x∈Z}f = \{(x, 3x - 1) : x \in \mathbf{Z}\}. Find f(4)f(4) and the xx with f(x)=14f(x) = 14.
  9. Is {(x,y):y2=x}\{(x, y) : y^2 = x\} a func­tion of xx on [0,∞)[0, \infty)? Why?
  10. A taxi charges ₹4040 plus ₹1515 per km. Write the fare as a func­tion of dis­tance and find the fare for 1212 km.

Answers

Show answers
  1. (a) yes; (b) no (22 has two images); (c) no (44 has none).
  2. 00; 55; 00; a2−2a−3a^2 - 2a - 3.
  3. 33; −1-1; −6-6; 55.
  4. R−{−3,3}\mathbf{R} - \{-3, 3\}; (−∞,4](-\infty, 4]; R\mathbf{R}.
  5. [5,∞)[5, \infty); [−3,∞)[-3, \infty); (0,1](0, 1].
  6. x2+2x−3x^2 + 2x - 3; 2x3−3x22x^3 - 3x^2; x22x−3\displaystyle \tfrac{x^2}{2x - 3}, domain R−{32}\displaystyle \mathbf{R} - \{\tfrac{3}{2}\}.
  7. Sketches: a V with ver­tex (2,0)(2, 0); a stair­case.
  8. 1111; x=5x = 5.
  9. No, because x=4x = 4 pairs with both y=2y = 2 and y=−2y = -2.
  10. F(d)=40+15dF(d) = 40 + 15d; ₹220220.