girgit.org

Relations and Functions

Adding, multiplying and dividing functions

The big ideaReal functions on the same domain can be added, subtracted, multiplied and divided point by point: to find \( (f + g)(x) \), just work out \( f(x) \) and \( g(x) \) and add them.

In simple words

Suppose one machine tells you the cost of the milk and another the cost of the bread for the same day. A new machine can tell you the total: it asks both and adds the answers. In the same way you can make machines that take away, multiply or divide the two answers. Dividing only works on days when the second answer is not zero.

The setup

Let \( f : X \to \mathbf{R} \) and \( g : X \to \mathbf{R} \) be two real functions with the same domain \( X \), where \( X \subset \mathbf{R} \). From them we build new functions, each defined at every point \( x \in X \) separately. This is the algebra of real functions.

The five operations

OperationDefinitionDomain
Sum \( f + g \)\( (f + g)(x) = f(x) + g(x) \)\( X \)
Difference \( f - g \)\( (f - g)(x) = f(x) - g(x) \)\( X \)
Multiplication by a scalar \( \alpha f \)\( (\alpha f)(x) = \alpha\, f(x) \)\( X \)
Product \( fg \)\( (fg)(x) = f(x)\, g(x) \)\( X \)
Quotient \( \dfrac{f}{g} \)\( \left(\dfrac{f}{g}\right)(x) = \dfrac{f(x)}{g(x)} \)\( x \in X \) with \( g(x) \ne 0 \)
  • A scalar here simply means a real number, such as \( \alpha = 3 \) or \( -\tfrac{1}{2} \). So \( (3f)(x) = 3f(x) \): every output is tripled.
  • The product is also called pointwise multiplication, because you multiply the two values at each point \( x \).
  • The quotient is the only one that can lose points from the domain: wherever \( g(x) = 0 \), \( \dfrac{f}{g} \) is not defined.

Worked example

Let \( f(x) = x + 3 \) and \( g(x) = x^2 - 9 \), both on \( \mathbf{R} \). Find \( f + g \), \( f - g \), \( 2f \), \( fg \) and \( \dfrac{f}{g} \).

  1. \( (f + g)(x) = (x + 3) + (x^2 - 9) = x^2 + x - 6 \).
  2. \( (f - g)(x) = (x + 3) - (x^2 - 9) = -x^2 + x + 12 \). Watch the bracket: the minus sign flips both terms of \( g \).
  3. \( (2f)(x) = 2(x + 3) = 2x + 6 \).
  4. \( (fg)(x) = (x + 3)(x^2 - 9) = x^3 + 3x^2 - 9x - 27 \).
  5. \( \left(\dfrac{f}{g}\right)(x) = \dfrac{x + 3}{x^2 - 9} \), defined only where \( x^2 - 9 \ne 0 \), that is \( x \ne 3 \) and \( x \ne -3 \).

Careful: since \( x^2 - 9 = (x - 3)(x + 3) \), it is tempting to cancel and write \( \dfrac{1}{x - 3} \). That is the same value wherever both are defined, but the quotient \( \dfrac{f}{g} \) is still undefined at \( x = -3 \), where \( g(-3) = 0 \). Its domain is \( \mathbf{R} - \{-3, 3\} \).

Try it with the same \( f \) and \( g \): every value of the new function is made from just two numbers at the same \( x \).

Worked example

On the non-negative reals \( [0, \infty) \), let \( f(x) = \sqrt{x} \) and \( g(x) = x^2 \). Find \( fg \) and \( \dfrac{g}{f} \).

  1. \( (fg)(x) = \sqrt{x} \cdot x^2 = x^{1/2} \cdot x^2 = x^{5/2} \).
  2. \( \left(\dfrac{g}{f}\right)(x) = \dfrac{x^2}{\sqrt{x}} = x^{2 - 1/2} = x^{3/2} \), but only for \( x \ne 0 \), because \( f(0) = 0 \). Domain \( = (0, \infty) \).

Working at a single point

Often you need only one value. Then you do not need the formula at all.

Worked example

\( f(2) = 5 \) and \( g(2) = -4 \). Find \( (f + g)(2) \), \( (3f - g)(2) \) and \( \left(\dfrac{f}{g}\right)(2) \).

  1. \( (f + g)(2) = 5 + (-4) = 1 \).
  2. \( (3f - g)(2) = 3 \cdot 5 - (-4) = 19 \).
  3. \( \left(\dfrac{f}{g}\right)(2) = \dfrac{5}{-4} = -1.25 \).

Don't mix these up

  • \( (fg)(x) \) means \( f(x) \cdot g(x) \), the product of two values. It does not mean \( f(g(x)) \), putting one function inside the other (that is composition, in Class 12).
  • \( (f - g)(x) = f(x) - g(x) \): put \( g(x) \) in brackets before subtracting.
  • Simplifying \( \dfrac{f}{g} \) does not bring back points where \( g(x) = 0 \).

Try it. \( f(x) = 2x + 1 \) and \( g(x) = x - 4 \) on \( \mathbf{R} \). Find (a) \( (f + g)(x) \) (b) \( (f - g)(x) \) (c) \( (fg)(x) \) (d) \( \left(\dfrac{f}{g}\right)(x) \) and its domain.

Answer
(a) \( 3x - 3 \). (b) \( (2x + 1) - (x - 4) = x + 5 \). (c) \( (2x + 1)(x - 4) = 2x^2 - 7x - 4 \). (d) \( \dfrac{2x + 1}{x - 4} \), domain \( \mathbf{R} - \{4\} \).

Words to know

Algebra of real functions
Adding, subtracting, scaling, multiplying and dividing functions point by point.
Scalar
A real number that multiplies a function, as in \( \alpha f \).
Pointwise multiplication
\( (fg)(x) = f(x)\,g(x) \): multiply the values at each point.
Quotient \( f/g \)
\( f(x)/g(x) \), defined only where \( g(x) \ne 0 \).
Common domain \( X \)
The set on which both \( f \) and \( g \) are defined, \( X \subset \mathbf{R} \).

\( f(x) = x^2 \) and \( g(x) = 3x - 1 \). What is \( (f - g)(x) \)?

  1. \( x^2 - 3x - 1 \)
  2. \( x^2 - 3x + 1 \)
  3. \( -x^2 + 3x - 1 \)

\( f(x) = x + 1 \), \( g(x) = x - 2 \) on \( \mathbf{R} \). What is the domain of \( \dfrac{f}{g} \)?

  1. \( \mathbf{R} - \{-1\} \)
  2. \( \mathbf{R} - \{2\} \)
  3. \( \mathbf{R} - \{-1, 2\} \)

\( f(1) = 4 \) and \( g(1) = 3 \). What is \( (fg)(1) \)?

  1. \( 7 \)
  2. \( 12 \)
  3. It cannot be found without the formulas