If f and g are two functions, we can define new functions f+g,fg, f.g, and f/g by the formulas:

(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)
The domains of f+g, fg, f.g consist of all x for which both f(x) and g(x) are defined:
{x| xDom(f) and xDom(g)}

That is, the domains of these functions are the intersection of the domain of f and the domain of g:
Dom(f)Dom(g)

The domain of f/g is trickier. Its domain consists of all x for which f(x) and g(x) are defined but g(x)0, because division by zero is not defined. Therefore:

Dom(f/g)={x| xDom(f) and xDom(g) and g(x)0}, which also can be written as:
Dom(f/g)=Dom(f)Dom(g){x| g(x)0}.

Example 1
Let f(x)=1x3 and g(x)=x2
(a) Find the functions f+g,fg,fg, f/g and g/f and their domains.

(b) Find (f+g)(5),(fg)(5),(fg)(5), (f/g)(5), and (g/f)(5).

Solution
(a) The domain of f is {x| x3} or R{3} because division by zero is not defined. The square root of negative numbers is not defined [square root of a negative number becomes imaginary], thus the domain of g is {x| x2}. The intersection of the domains of f and g is
{x| x2 and x3}=[2,3)(3,). Thus we have
(f+g)(x)=f(x)+g(x)=1x3+x2(fg)(x)=f(x)g(x)=1x3x2(fg)(x)=f(x)g(x)=x2x3,
and the domains of all of these functions are
{x| x2 and x3}=[2,3)(3,).(try them!) To determine the domain of (f/g)(x), from this set of numbers we need to exclude 2 because g(2)=0. That is, the domain of (f/g)(x) is
{x| x>2 and x3}=(2,3)(3,), and
(fg)(x)=1(x3)x2. Because f does not vanish (f(x)0) in its domain,* the domain of (g/f)(x) is the same as Dom(f)Dom(g)=[2,3)(3,),and
(gf)(x)=x21x3=(x3)x2.

(b) Because x=5 is in the domain of each function, each of these values exists:
(f+g)(5)=f(5)+g(5)=153+52=12+3(fg)(5)=f(5)g(5)=15352=123(fg)(5)=f(5)g(5)=15352=32(fg)(5)=f(5)g(5)=15352=123(gf)(5)=g(5)f(5)=52153=23

*  You may sketch the graph of y=1/(x3) to see that. Note that the graph of y=1/(x3) is the graph of y=1/x shifted horizontally 3 units to the right. See Section 2.11 for more details.

Example 2
What is the natural domain of H(x)=x1+2x?
Solution
We have already determined the domain of this function in Example 1 in the Section on Natural Domain and Range of a Function. But now, let’s use what we learned in this section. Let f(x)=x1, g(x)=2x, and H=f+g. The function f is defined for all x such that x10. That is, Dom(f)={x| x1}=[1,). The domain of g consists of all x for which 2x0, i.e. Dom(g)={x| x2}=(,2]. The intersection of the domains of f and g is
Dom(H)={x| x2 and x1}={x| 1x2}=[1,2],
or
Dom(H)=Dom(f)Dom(g)=[1,)(,2]=[1,2], which is exactly the same as we saw in Example 1 in Section 2.3.
Example 3
Are the following functions equal?

(a)h1(x)=x12x and h2(x)=(x1)(2x)

(b)u1(x)=x1x2 and u2(x)=(x1)(x2)

Solution
The functions h1(x) and h2(x), and u1(x) and u2(x) can be equal functions if they have the same (natural) domains. [Note that if r and s are both nonnegative, then rs0. Therefore if A=rs, then we can also write A as
A=rs. However, if B=pq, without knowing that p and q are both nonnegative, we cannot write B as pq. For example, if p=2, and q=3, then we can calculate (2)(3)
but 2 or 3 are not defined.] To determine the domains of these functions, we note that:
◻ is defined if the sign of ◻ is not negative and
sign (◻×)=sign (◻)×sign () (a) First, we should determine the signs of all expressions under . 
From what we learned in this section:
Dom(h1)=Dom(x1)Dom(2x)=[1,)(,2]=[1,2],
and from the above table:
Dom(h2)=Dom((x1)(2x)=[1,2]. Therefore h1(x)=h2(x) everywhere they are defined. In other words, they are equal functions.

(b) Similarly, using the following table: 

Dom(u1)=Dom(x1)Dom(x2)=[1,)[2,)=[2,)
but
Dom(u2)=(,1][2,). Therefore u1(x) and u2(x) are equal only when x[2,). Because the domains of u1(x) and u2(x) are not equal, they are not equal functions.

Example 4
Determine the natural domain of the following functions:
(a) f(x)=1xlogx

(b)g(u)=eu|1+u|

Solution
Recall that logx is defined when x>0 and
logx=0x=1 (a)
Dom(f)=Dom(1x)Dom(logx){x|logx0}=(,1](0,){x|x1}=(0,1).
(b)
Dom(g)=Dom(eu)Dom(|1+u|){u| |1+u|0}=RR{u| |1+u|0}=RR{u| u±1}={u| u±1}=R{1,1},
which can also be written as
Dom(g)=(,1)(1,1)(1,).

Graphs of Combined Functions

Suppose the graphs of f and g are known:

  •  to obtain the graph of the function f+g, we just add the corresponding y-coordinates f(x) and g(x) at each x that belongs both to the domain of f and the domain of g
  •  to obtain the graph of the function f+g, we just subtract the y-coordinate g(x) from the corresponding y-coordinate f(x) at each x that belongs both to the domain of f and the domain of g
  •  to obtain the graph of the function fg, we multiply the correspondingy-coordinates f(x) and g(x) at each x that belongs both to the domain of f and the domain of g.