Source codeVideos

Command Palette

Search for a command to run...

Function Composition and Inverse Function

Addition and Subtraction of Functions

Combining Functions

Imagine you have two function machines, let's call them machine ff and machine gg. Each machine has its own rules, which are its function (f(x)f(x) and g(x)g(x)) and the raw materials it can process (its domain, DfD_f and DgD_g). We can combine these two machines to create a new machine using addition or subtraction operations.

Function Addition Visualization
Observe how the lines f(x)=xf(x)=x and g(x)=2g(x)=2 are added to become (f+g)(x)=x+2(f+g)(x)=x+2.

Addition of Two Functions

If we want to add function ff and function gg, we simply add the results from each function for the same value of xx. The result is a new function we call (f+g)(f+g).

(f+g)(x)=f(x)+g(x)(f+g)(x) = f(x) + g(x)

Important note: The combined machine (f+g)(f+g) can only process raw materials (values of xx) that can be processed by both original machines, ff and gg. So, the domain (domain of origin) of the function (f+g)(f+g) is the intersection of the domain of ff and the domain of gg.

Df+g=DfDgD_{f+g} = D_f \cap D_g

This means that xx must be a member of DfD_f AND also a member of DgD_g.

Example of Addition

Suppose we have two functions:

  1. f(x)=x2f(x) = x^2, with domain Df={xxR}D_f = \{x | x \in \mathbb{R}\} (all real numbers).
  2. g(x)=x+2g(x) = \sqrt{x+2}, with domain Dg={xx2,xR}D_g = \{x | x \ge -2, x \in \mathbb{R}\} (all real numbers greater than or equal to -2, because the square root cannot be negative).

Step 1: Determine the resulting function from addition

(f+g)(x)=f(x)+g(x)=x2+x+2(f+g)(x) = f(x) + g(x) = x^2 + \sqrt{x+2}

Step 2: Determine the domain of the resulting function

We find the intersection of DfD_f and DgD_g:

Df+g=DfDg={xxR}{xx2,xR}D_{f+g} = D_f \cap D_g = \{x | x \in \mathbb{R}\} \cap \{x | x \ge -2, x \in \mathbb{R}\}
Df+g={xx2,xR}D_{f+g} = \{x | x \ge -2, x \in \mathbb{R}\}

So, the resulting function from addition is (f+g)(x)=x2+x+2(f+g)(x) = x^2 + \sqrt{x+2} with domain {xx2,xR}\{x | x \ge -2, x \in \mathbb{R}\}.

Subtraction of Two Functions

The process is similar to addition. To subtract function gg from function ff, we subtract the result of g(x)g(x) from f(x)f(x) for the same value of xx. The result is a new function (fg)(f-g).

(fg)(x)=f(x)g(x)(f-g)(x) = f(x) - g(x)

Its domain is also the same as for addition, namely the intersection of the domain of ff and the domain of gg. Why? Because again, the value of xx must be processable by both initial functions before it can be subtracted.

Dfg=DfDgD_{f-g} = D_f \cap D_g

Example of Subtraction

We use the same functions as in the addition example:

  1. f(x)=x2f(x) = x^2, Df={xxR}D_f = \{x | x \in \mathbb{R}\}
  2. g(x)=x+2g(x) = \sqrt{x+2}, Dg={xx2,xR}D_g = \{x | x \ge -2, x \in \mathbb{R}\}

Step 1: Determine the resulting function from subtraction

(fg)(x)=f(x)g(x)=x2x+2(f-g)(x) = f(x) - g(x) = x^2 - \sqrt{x+2}

Step 2: Determine the domain of the resulting function Its domain is the same as the domain of the addition result because the intersection rule is the same:

Dfg=DfDg={xx2,xR}D_{f-g} = D_f \cap D_g = \{x | x \ge -2, x \in \mathbb{R}\}

So, the resulting function from subtraction is (fg)(x)=x2x+2(f-g)(x) = x^2 - \sqrt{x+2} with domain {xx2,xR}\{x | x \ge -2, x \in \mathbb{R}\}.

Practice Problems

Given the functions f(x)=2x1f(x) = 2x - 1 with Df={xxR}D_f = \{x | x \in \mathbb{R}\} and function g(x)=x2+3g(x) = x^2 + 3 with Dg={xxR}D_g = \{x | x \in \mathbb{R}\}.

  1. Determine (f+g)(x)(f+g)(x) and its domain Df+gD_{f+g}.
  2. Determine (fg)(x)(f-g)(x) and its domain DfgD_{f-g}.
  3. Calculate the value of (f+g)(2)(f+g)(2).
  4. Calculate the value of (fg)(1)(f-g)(-1).

Answer Key

  1. Finding (f+g)(x)(f+g)(x):

    (f+g)(x)=f(x)+g(x)(f+g)(x) = f(x) + g(x)
    =(2x1)+(x2+3)= (2x - 1) + (x^2 + 3)
    =x2+2x+2= x^2 + 2x + 2

    Finding Domain Df+gD_{f+g}:

    Df+g=DfDgD_{f+g} = D_f \cap D_g
    ={xxR}{xxR}= \{x | x \in \mathbb{R}\} \cap \{x | x \in \mathbb{R}\}
    ={xxR}= \{x | x \in \mathbb{R}\}

    So, (f+g)(x)=x2+2x+2(f+g)(x) = x^2 + 2x + 2 with domain all real numbers.

  2. Finding (fg)(x)(f-g)(x):

    (fg)(x)=f(x)g(x)(f-g)(x) = f(x) - g(x)
    =(2x1)(x2+3)= (2x - 1) - (x^2 + 3)
    =2x1x23= 2x - 1 - x^2 - 3
    =x2+2x4= -x^2 + 2x - 4

    Finding Domain DfgD_{f-g}:

    Dfg=DfDgD_{f-g} = D_f \cap D_g
    ={xxR}{xxR}= \{x | x \in \mathbb{R}\} \cap \{x | x \in \mathbb{R}\}
    ={xxR}= \{x | x \in \mathbb{R}\}

    So, (fg)(x)=x2+2x4(f-g)(x) = -x^2 + 2x - 4 with domain all real numbers.

  3. Calculating (f+g)(2)(f+g)(2):

    We use the result from number 1: (f+g)(x)=x2+2x+2(f+g)(x) = x^2 + 2x + 2

    (f+g)(2)=(2)2+2(2)+2(f+g)(2) = (2)^2 + 2(2) + 2
    =4+4+2= 4 + 4 + 2
    =10= 10
  4. Calculating (fg)(1)(f-g)(-1):

    We use the result from number 2: (fg)(x)=x2+2x4(f-g)(x) = -x^2 + 2x - 4

    (fg)(1)=(1)2+2(1)4(f-g)(-1) = -(-1)^2 + 2(-1) - 4
    =(1)24= -(1) - 2 - 4
    =7= -7