Example. If f(x)=x−2 and g(x)=9−x2 find f+g, f−g, fg, and gf.
Domain of f(x) is x−2≥0 or interval [2,∞). Domain of g(x) is 9−x2≥0 or interval [−3,3].
So, the intersection of domains is [2, ∞]∩[−3, 3]=[2, 3].
Thus,
(f+g)(x)=f(x)+g(x)=x−2+9−x2 for 2≤x≤3.
(f−g)(x)=f(x)−g(x)=x−2−9−x2 for 2≤x≤3.
(fg)(x)=f(x)g(x)=x−29−x2=(x−2)(9−x2) for 2≤x≤3.
(gf)(x)=g(x)f(x)=9−x2x−2 for 2≤x<3.
Notice that the domain of gf is the interval [2,3), because we must exclude the points where g(x)=0, i.e. x=±3.