Operation with functions

To continue, we first need to quickly have a look at operations between functions. Consider two functions ff and gg, and a constant cc. It is possible to form a new function hh in several ways based on ff, gg and cc:

Definition 1

We can create the following new functions

Equation 1
cf,f+g,fg,fg,fg,fgc\cdot f,\, f+g,\, f-g,\, f\cdot g,\, \frac{f}{g},\, f\circ g

which are defined as follows:

  • (cf)(x)=cf(x)(c\cdot f)(x)=c\cdot f(x) (multiplication of a function with a constant)
  • (f+g)(x)=f(x)+g(x),(fg)(x)=f(x)+g(x)(f+g)(x)=f(x)+g(x),\,(f-g)(x)=f(x)+g(x) (addition or subtraction of two functions)
  • (fg)(x)=f(x)g(x)fg(x)=f(x)g(x)(f\cdot g)(x)=f(x)\cdot g(x)\, \frac{f}{g}(x)=\frac{f(x)}{g(x)} (multiplication or division of two functions)
  • (fg)(x)=f(g(x))(f\circ g)(x)=f(g(x)) (composition of two functions)

for all input values xx.

Note 1

The composition of two functions f(g(x))f(g(x)) is a chain, where the output of g(x)g(x) is the input of ff:

xgy=g(x)fy=f(g(x))\begin{array}{cll} x & \\ \large\downarrow & \\ \large\boxed{g} & \\ \large\downarrow & \\ y=g(x) & \\ \large\downarrow & \\ \large\boxed{f} & \\ \large\downarrow & \\ y=f(g(x)) \end{array}
Example 1

Consider the functions f(x)=3xf(x)=3x and g(x)=x2+1g(x)=x^2+1, and c=4c=4.

  1. (4f)(2)=4f(2)=46=24(4\cdot f)(2) = 4\cdot f(2) = 4\cdot 6= 24
  2. (f+g)(2)=f(2)+g(2)=6+5=11(f+g)(2)=f(2)+g(2)=6+5=11
  3. (fg)(2)=f(2)g(2)=65=1(f-g)(2)=f(2)-g(2)=6-5=1
  4. (fg)(2)=f(2)g(2)=65=30(f\cdot g)(2)=f(2)\cdot g(2)=6\cdot 5=30
  5. fg(2)=f(2)g(2)=65=1.2\frac{f}{g}(2)=\frac{f(2)}{g(2)}=\frac{6}{5}=1.2
  6. (fg)(2)=f(g(2))=f(5)=15(f\circ g)(2)=f(g(2))=f(5)=15
Exercise 1

Consider the functions f(x)=x2f(x)=x^2, g(x)=0.5xg(x)=0.5x, and the constant c=2c=2. Find the function equation of hh, where

  1. h=cfh=c\cdot f
  2. h=f±gh=f \pm g
  3. h=fgh=f\cdot g
  4. h=fgh=\frac{f}{g}
  5. h=fgh = f \circ g

Simplify the expression for hh as much as possible.

Solution
  1. h(x)=cf(x)=2x2=2x2h(x)=c\cdot f(x)= 2\cdot x^2 =2x^2
  2. h(x)=f(x)+g(x)=x2+0.5x=x(x+0.5)h(x)=f(x)+g(x)=x^2+0.5x=x(x+0.5) h(x)=f(x)g(x)=x20.5x=x(x0.5)h(x)=f(x)-g(x)=x^2-0.5x=x(x-0.5)
  3. h(x)=f(x)g(x)=x20.5x=0.5x3h(x)=f(x)\cdot g(x)=x^2\cdot 0.5x=0.5x^3
  4. h(x)=f(x)g(x)=x20.5x=2xh(x)=\frac{f(x)}{g(x)}=\frac{x^2}{0.5x}=2x
  5. h(x)=f(g(x))=(0.5x)2=0.25x2h(x)=f(g(x))=(0.5x)^2=0.25x^2

Note that in general it is

uvvuu\circ v \neq v\circ u

See the following exercise ... .

Exercise 2

Determine the function equation of u=fgu=f\circ g and v=gfv=g\circ f. Simplify the function equation of uu and vv as much as possible.

  1. f(x)=x and g(x)=x3f(x)=\sqrt{x}\, \text{ and }\, g(x)=x^3

  2. f(x)=x2+2x+2 and g(x)=3xf(x)=x^2+2x+2\, \text{ and }\, g(x)=3x

  3. f(x)=x2+2x+2 and g(x)=x+1f(x)=x^2+2x+2\, \text{ and }\, g(x)=x+1

  4. f(x)=2x and g(x)=2x2f(x)=\frac{2}{x}\, \text{ and }\, g(x)=2 x^2

  5. f(x)=(2x+1)2 and g(x)=x1f(x)=(2x+1)^2\, \text{ and }\, g(x)=x-1

Solution
  1. u(x)=f(g(x))=x3=x3/2u(x)=f(g(x))=\sqrt{x^3} =x^{3/2}, v(x)=g(f(x))=(x)3=x3/2v(x)=g(f(x))=(\sqrt{x})^3 = x^{3/2}
  2. u(x)=f(g(x))=(3x)2+2(3x)+2=9x2+6x+2u(x)=f(g(x))=(3x)^2+2(3x)+2=9x^2+6x+2, v(x)=g(f(x))=3(x2+2x+2)=3x2+6x+6v(x)=g(f(x))=3(x^2+2x+2)=3x^2+6x+6
  3. u(x)=f(g(x))=(x+1)2+2(x+1)+2=x2+4x+5u(x)=f(g(x))=(x+1)^2+2(x+1)+2=x^2+4x+5, v(x)=g(f(x))=x2+2x+2+1=x2+2x+3v(x)=g(f(x))=x^2+2x+2+1=x^2+2x+3
  4. u(x)=f(g(x))=22x2=1x2u(x)=f(g(x))=\frac{2}{2x^2}=\frac{1}{x^2}, v(x)=g(f(x))=2(2x)2=8x2v(x)=g(f(x))=2 \left(\frac{2}{x}\right)^2=\frac{8}{x^2}
  5. u(x)=f(g(x))=(2(x1)+1)2=(2x1)2=4x24x+1u(x)=f(g(x))=(2(x-1)+1)^2=(2x-1)^2=4x^2-4x+1, v(x)=g(f(x))=(2x+1)21=4x2+4x=4x(x+1)v(x)=g(f(x))=(2x+1)^2-1=4x^2+4x =4x(x+1)
Exercise 3

Consider two functions ff and gg with f(2)=7,f(3)=8.5,g(2)=3f(2)=7, f(3)=8.5, g(2)=3. Determine h(2)h(2) for

  1. h=4fh=4\cdot f

  2. h=f+gh=f+g

  3. h=fgh=f\cdot g

  4. h=fgh=\frac{f}{g}

  5. h=fgh=f\circ g

Solution
  1. h(2)=4f(2)=47=28h(2)=4\cdot f(2)= 4\cdot 7=28
  2. h(2)=f(2)+g(2)=7+3=10h(2)=f(2)+g(2)=7+3=10
  3. h(2)=f(2)g(2)=73=21h(2)=f(2)\cdot g(2)=7\cdot 3=21
  4. h(2)=f(2)g(2)=73h(2)=\frac{f(2)}{g(2)}=\frac{7}{3}
  5. h(2)=f(g(2))=f(3)=8.5h(2)=f(g(2))=f(3)=8.5
Exercise 4

Consider the graph of the following functions ff and gg shown below. Construct the graph of the function u=f+gu=f+g and v=fgv=f\circ g without determining the function equations of ff and gg.

Solution